diff --git a/.gitignore b/.gitignore index 15d2cea..e822220 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ # Ignore Mac DS_Store files .DS_Store + +# Ignore JetBrains IDEA files +.idea + +# Ignore node modules +node_modules diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json new file mode 100644 index 0000000..10875bf --- /dev/null +++ b/_locales/cs/messages.json @@ -0,0 +1,34 @@ +{ + "appDesc": { + "message": "Chraňte svoje blízké před nedůvěryhodným obsahem.", + "description":"The description of the application, displayed in the web store." + }, + "notification_warning": { + "message": "Zvyšte opatrnost! Tato stránka je zařazena
v seznamu nedůvěryhodných webů.
", + "description":"Warning text" + }, + "notification_more": { + "message": "Více zjistíte na", + "description":"Find more at" + }, + "notification_close": { + "message": "Zavřít upozornění", + "description":"Close warning" + }, + "dialog_doubts": { + "message": "Máte pochybnosti
o důvěryhodnosti této
stránky?", + "description":"Doubts text" + }, + "dialog_check": { + "message": "Nechte ji prověřit odbornou komisí!", + "description":"Check text" + }, + "dialog_report": { + "message": "Nahlásit web", + "description":"Report web" + }, + "dialog_about": { + "message": "Více o rozšíření", + "description":"Find more" + } +} \ No newline at end of file diff --git a/_locales/sk/messages.json b/_locales/sk/messages.json new file mode 100644 index 0000000..4d0beef --- /dev/null +++ b/_locales/sk/messages.json @@ -0,0 +1,34 @@ +{ + "appDesc": { + "message": "Chráňte vašich blízkych pred nedôveryhodným obsahom.", + "description":"The description of the application, displayed in the web store." + }, + "notification_warning": { + "message": "Zvýšte opatrnosť! Táto stránka je zaradená
v zozname nedôveryhodných webov.
", + "description":"Warning text" + }, + "notification_more": { + "message": "Zistite viac na", + "description":"Find more at" + }, + "notification_close": { + "message": "Zavrieť upozornenie", + "description":"Close warning" + }, + "dialog_doubts": { + "message": "Máte pochybnosti
o dôveryhodnosti tejto
stránky?", + "description":"Doubts text" + }, + "dialog_check": { + "message": "Nechajte ju preveriť odbornej komisii!", + "description":"Check text" + }, + "dialog_report": { + "message": "Nahlásiť web", + "description":"Report web" + }, + "dialog_about": { + "message": "Viac o rozšíreniu", + "description":"Find more" + } +} \ No newline at end of file diff --git a/assets/dialog/dialog.css b/assets/dialog/dialog.css index 0051500..5a394fa 100644 --- a/assets/dialog/dialog.css +++ b/assets/dialog/dialog.css @@ -25,6 +25,7 @@ footer, header, hgroup, menu, nav, section { } body { line-height: 1; + overflow: hidden; } ol, ul { list-style: none; diff --git a/assets/dialog/dialog.html b/assets/dialog/dialog.html index 317d478..76150a1 100644 --- a/assets/dialog/dialog.html +++ b/assets/dialog/dialog.html @@ -1,5 +1,5 @@ - + @@ -7,18 +7,16 @@
-

Máte pochybnosti
- o dôveryhodnosti tejto
- stránky? -

+

-

Nechajte ju preveriť odbornej komisii


- Nahlásiť web +


+
- Viac o plugine
- +
+ +
diff --git a/assets/dialog/dialog.js b/assets/dialog/dialog.js index 00b3c88..42fde05 100644 --- a/assets/dialog/dialog.js +++ b/assets/dialog/dialog.js @@ -2,7 +2,21 @@ var link_report = "https://www.konspiratori.sk/nahlasenie-stranky.php"; var link_about = "https://www.websupport.sk/bullshit-detector"; var link_konspiratori = "https://www.konspiratori.sk/"; var link_websupport = "https://www.websupport.sk/"; -document.getElementById("report").href = link_report; -document.getElementById("about").href = link_about; -document.getElementById("konspiratori").href = link_konspiratori; -document.getElementById("websupport").href = link_websupport; + +function setLink(elementId, url) { + document.getElementById(elementId).href = url; +} + +function setText(key) { + document.getElementById(key).innerHTML = chrome.i18n.getMessage(key); +} + +setLink("dialog_report", link_report); +setLink("dialog_about", link_about); +setLink("dialog_konspiratori", link_konspiratori); +setLink("dialog_websupport", link_websupport); + +setText("dialog_doubts"); +setText("dialog_check"); +setText("dialog_report"); +setText("dialog_about"); diff --git a/manifest.json b/manifest.json index 94c6538..5417e9d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,11 @@ { "manifest_version": 2, "name": "Bullshit Detector", + "description": "__MSG_appDesc__", + "default_locale": "sk", + "version": "0.9", - "description": "Chráňte vašich blízkych pred nedôveryhodným obsahom", "icons": { "16": "icons/icon16.png", "48": "icons/icon48.png", diff --git a/show_warning.js b/show_warning.js index d8478f0..bf2bf0e 100644 --- a/show_warning.js +++ b/show_warning.js @@ -1,6 +1,10 @@ // generate unique ID var bullshit_detector = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); +function getMessage(key) { + return chrome.i18n.getMessage(key); +} + // notification area var content = "
" + "
" + "
" - + "Zvýšte opatrnosť! Táto stránka je zaradená
" - + "v zozname nedôveryhodných webov
" + + getMessage("notification_warning") + "
" + "" - + "Zistite viac na konspiratori.sk" + + getMessage("notification_more") + + " konspiratori.sk" + "" + "" - + "Zavrieť upozornenie" + + getMessage("notification_close") + "" + "
" + "
"; + document.body.innerHTML = content + document.body.innerHTML; // close notification