Skip to content

Commit

Permalink
web theming
Browse files Browse the repository at this point in the history
  • Loading branch information
richja committed Dec 22, 2014
1 parent ec2079f commit a4d7505
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 9 deletions.
6 changes: 3 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Zbývá udělat:
- v pozadavcich ciselne hodnoceni z CSFD a IMDB misto textu, klikaci odkazy na dane weby
- vypsat existenci (ano/ne) anglickych titulek k filmu z subtitleseeker api?
- vytvořit vlastní API wrapper
- pouzit CSFDapi v2 pro overeni nalezeni spravneho filmu dle IMDB
- ve vlastních požadavcích zobrazit, zda je už film překládán či nikoliv

Hotovo:
- ve vlastních požadavcích zobrazit, zda je už film překládán či nikoliv
- v pozadavcich ciselne hodnoceni z CSFD a IMDB misto textu, klikaci odkazy na dane weby
- vytvořit vlastní API wrapper
- u CSFD hodnoceni barevne odlisit pozadi (modre/cervene 70%+)
- pridat hodnoceni a odkazy do vypisu konkretniho filmu
- nastaveni vlastnich sablon pro automaticke predvyplneni u noveho zapisu do rozpracovanych a pridani novych titulku
Expand Down
Binary file added christmas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added christmas.old.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion content.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ $(document).ready(function() {
});
});

$.getJSON("http://79.143.181.180/titulky/",{multi: true, imdb: imdbs.join(),stamp:stamp},function(data)
$.getJSON("http://richja.cz/titulky/",{multi: true, imdb: imdbs.join(),stamp:stamp},function(data)
{
// console.log(data);
pusher.disconnect();
Expand Down Expand Up @@ -625,6 +625,7 @@ $(document).ready(function() {
domu: true,
premium: false,
hlavicka: false,
udalost: true,
rozpracovane: '',
poznamky: '',
release: true,
Expand Down Expand Up @@ -666,6 +667,25 @@ $(document).ready(function() {
}
}

var date = new Date(),
year = date.getFullYear();

if (items.udalost && year == "2014")
{
// hlavni stranka (index)
if ($(".iboxcover").length) //orloj (by fredikoun) :)
{
console.log("Vánoce!!!");
$("#slider li").eq(1).find("img").attr("src","chrome-extension://"+chrome.runtime.id+"/christmas.jpg");
}

if ($("#head_a1").length) //orloj (by fredikoun) :)
{
$(this).hide();
$("#head_a1").append("<img class =\"plus-snowman\" src =\"chrome-extension://"+chrome.runtime.id+"/snowman.png\">");
}
}

// vysledky hledani (fulltext i prime)
if (location.href.indexOf("Fulltext") !== -1 || location.href.indexOf("Searching") !== -1)
{
Expand Down
8 changes: 8 additions & 0 deletions cstyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,12 @@
.search-choice-close {
/*background: url(chrome-extension://mmokpgfcoggceagfifgeaihaebemhapj/chosen-sprite.png) -42px 1px no-repeat !important;*/
background: url(chrome-extension://abgigldmglfimgechooinbdblfmipabb/chosen-sprite.png) -42px 1px no-repeat !important;
}

/*extra*/

.plus-snowman {
position: relative;
left: 155px;
top: -87px;
}
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Titulky plus",
"short_name": "Titulky+",
"author": "Jan Richter",
"version": "0.8.3",
"version": "0.8.4",
"description": "Vylepšení webu titulky.com pro pohodlnější práci (nejen pro překladatele).",
"manifest_version": 2,
"icons": {
Expand All @@ -11,7 +11,8 @@
"128": "icon128.png"
},
"web_accessible_resources": [
"*.png"
"*.png",
"*.jpg"
],
"content_scripts": [
{
Expand All @@ -26,7 +27,6 @@
},
"options_page": "options.html",
"permissions": [
"http://79.143.181.180/titulky/*",
"tabs",
"declarativeContent",
"storage"
Expand Down
12 changes: 11 additions & 1 deletion options.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ <h2>Obecné</h2>
Zobrazit klasickou modrou klikací hlavičku webu (je-li například skrytá kvůli reklamě)
</label>
<br>
<h2>Extra</h2>
<br>
<label>
<input type="checkbox" id="udalost" name ="udalost">
Povolit tematické upravení webu (Vánoce, Velikonoce apod.)
</label>
<br>
<h2>Šablony</h2>
<br>
<label>
Expand All @@ -46,8 +53,11 @@ <h2>Šablony</h2>
<label>
Šablona pro nahrávání nových titulků
<br>
<textarea name ="poznamky" id="poznamky"></textarea>
<textarea class ="notes" name ="poznamky" id="poznamky"></textarea>
</label>
<br>

<!-- <button id="nova">Přidat další šablonu pro nové titulky</button> -->

<br>

Expand Down
29 changes: 28 additions & 1 deletion options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function save_options() {
var domu = document.getElementById('domu').checked;
var premium = document.getElementById('premium').checked;
var hlavicka = document.getElementById('hlavicka').checked;
var udalost = document.getElementById('udalost').checked;
var rozpracovane = document.getElementById('rozpracovane').value;
var poznamky = document.getElementById('poznamky').value;

Expand All @@ -12,6 +13,7 @@ function save_options() {
domu: domu,
premium: premium,
hlavicka: hlavicka,
udalost: udalost,
rozpracovane: rozpracovane,
poznamky: poznamky
}, function() {
Expand All @@ -33,17 +35,42 @@ function restore_options() {
domu: true,
premium: false,
hlavicka: false,
udalost: true,
rozpracovane: '',
poznamky: ''
}, function(items) {
document.getElementById('vyhledavani').checked = items.vyhledavani;
document.getElementById("domu").checked = items.domu;
document.getElementById("premium").checked = items.premium;
document.getElementById("hlavicka").checked = items.hlavicka;
document.getElementById("udalost").checked = items.udalost;
document.getElementById("rozpracovane").value = items.rozpracovane;
document.getElementById("poznamky").value = items.poznamky;
});
}

function add_textarea (argument) {
var notes = document.querySelectorAll(".notes").length;

var label = document.createElement("label"),
label_text = document.createTextNode("Šablona #"+notes),
textarea = document.createElement("textarea"),
br = document.createElement("br");
textarea.class = "notes";
textarea.name = "poznamky"+notes;
textarea.id = "poznamky"+notes;

var preparedNode = "<label>Šablona #"+notes+"<br><textarea class = \"notes\" name =\"poznamky"+notes+"\" id=\"poznamky"+notes+"\"></textarea></label><br>";

// document.getElementById("poznamka").referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
document.getElementById("poznamky").parentNode.insertBefore(textarea,document.getElementById("poznamka"));
document.getElementById("poznamky").parentNode.insertBefore(br,document.getElementById("poznamka"))

}

document.addEventListener('DOMContentLoaded', restore_options);
document.getElementById('save').addEventListener('click',
save_options);
save_options);

document.getElementById('nova').addEventListener('click',
add_textarea);
Binary file added snowman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a4d7505

Please sign in to comment.