Skip to content

Commit

Permalink
Version 1.9.6
Browse files Browse the repository at this point in the history
- Added possibility to change 'default values' (interval, mode, etc.)
#48
- Added possibility to ignore link addresses #52
- Added possibility to delete HTML comments #51
- Minor changes
- Fiexed bugs
  • Loading branch information
WaldiPL committed Jul 24, 2020
1 parent a412d01 commit 12cddae
Show file tree
Hide file tree
Showing 13 changed files with 385 additions and 90 deletions.
34 changes: 32 additions & 2 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"message": "Title:"
},
"scanFreq": {
"message": "Scan every:"
"message": "Interval:"
},
"minutes": {
"message": "Minute(s)"
Expand Down Expand Up @@ -234,7 +234,7 @@
"message": "Skip minor changes"
},
"highlightOutsideChanges": {
"message": "Highlight changes outside the scanned element"
"message": "Show changes outside the scanned element"
},
"subHighlightOutside": {
"message": "Applies to partially scanned pages"
Expand Down Expand Up @@ -488,6 +488,12 @@
"deleteScripts":{
"message": "Delete scripts"
},
"deleteComments":{
"message": "Delete comments"
},
"ignoreHrefs":{
"message": "Ignore link addresses"
},
"yes":{
"message": "Yes"
},
Expand All @@ -514,5 +520,29 @@
},
"tooltipStopOpening":{
"message": "\r Stop opening changed pages (middle-click)"
},
"h3sidebar":{
"message": "Sidebar"
},
"h3defaultValues":{
"message": "Default values"
},
"defaultInterval":{
"message": "Default interval"
},
"defaultMode":{
"message": "Default mode"
},
"defaultIgnoreNumbers":{
"message": "By default, ignore number changes"
},
"defaultDeleteScripts":{
"message": "By default, delete scripts"
},
"defaultDeleteComments":{
"message": "By default, delete comments"
},
"defaultIgnoreHrefs":{
"message": "By default, ignore link addresses"
}
}
38 changes: 37 additions & 1 deletion src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"message": "Titre :"
},
"scanFreq": {
"message": "Tout scanner :"
"message": "Intervalle :"
},
"minutes": {
"message": "Minute(s)"
Expand Down Expand Up @@ -233,6 +233,12 @@
"skipMinorChanges": {
"message": "Passer les modifications mineures"
},
"highlightOutsideChanges": {
"message": "Afficher les changements en dehors de l'élément scanné"
},
"subHighlightOutside": {
"message": "Pour les pages partiellement scannées"
},
"changeOf": {
"message": "Modification $1 sur $2"
},
Expand Down Expand Up @@ -482,6 +488,12 @@
"deleteScripts":{
"message": "Supprimer les scripts"
},
"deleteComments":{
"message": "Supprimer les commentaires"
},
"ignoreHrefs":{
"message": "Ignorer les adresses des liens"
},
"yes":{
"message": "Oui"
},
Expand All @@ -508,5 +520,29 @@
},
"tooltipStopOpening":{
"message": "\r Arrêtez d'ouvrir les pages modifiées (Clic du milieu)"
},
"h3sidebar":{
"message": "Panneau latéral"
},
"h3defaultValues":{
"message": "Valeurs par défaut"
},
"defaultInterval":{
"message": "Intervalle par défaut"
},
"defaultMode":{
"message": "Mode par défaut"
},
"defaultIgnoreNumbers":{
"message": "Par défaut, ignorer les modifications de nombres"
},
"defaultDeleteScripts":{
"message": "Par défaut, supprimer les scripts"
},
"defaultDeleteComments":{
"message": "Par défaut, supprimer les commentaires"
},
"defaultIgnoreHrefs":{
"message": "Par défaut, ignorer les adresses des liens"
}
}
34 changes: 32 additions & 2 deletions src/_locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"message": "Tytuł:"
},
"scanFreq": {
"message": "Skanuj co:"
"message": "Interwał:"
},
"minutes": {
"message": "Minut/y"
Expand Down Expand Up @@ -234,7 +234,7 @@
"message": "Pomiń drobne zmiany"
},
"highlightOutsideChanges": {
"message": "Podświetl zmiany poza skanowanym elementem"
"message": "Pokaż zmiany poza skanowanym elementem"
},
"subHighlightOutside": {
"message": "Dotyczy stron skanowanych częściowo"
Expand Down Expand Up @@ -488,6 +488,12 @@
"deleteScripts":{
"message": "Usuwaj skrypty"
},
"deleteComments":{
"message": "Usuwaj komentarze"
},
"ignoreHrefs":{
"message": "Ignoruj adresy odnośników"
},
"yes":{
"message": "Tak"
},
Expand All @@ -514,5 +520,29 @@
},
"tooltipStopOpening":{
"message": "\r Zatrzymaj otwieranie zmienionych stron (środkowy przycisk)"
},
"h3sidebar":{
"message": "Panel boczny"
},
"h3defaultValues":{
"message": "Wartości domyślne"
},
"defaultInterval":{
"message": "Domyślny interwał"
},
"defaultMode":{
"message": "Domyślny tryb"
},
"defaultIgnoreNumbers":{
"message": "Domyślnie ignoruj zmiany liczb"
},
"defaultDeleteScripts":{
"message": "Domyślnie usuwaj skrypty"
},
"defaultDeleteComments":{
"message": "Domyślnie usuwaj komentarze"
},
"defaultIgnoreHrefs":{
"message": "Domyślnie ignoruj adresy odnośników"
}
}
8 changes: 7 additions & 1 deletion src/bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ function handleInstalled(details) {
"scrollbarMarkers":true,
"faviconService":"native",
"notificationSound":"notification.opus",
"defaultFreq":8,
"defaultMode":"m0",
"defaultIgnoreNumbers":false,
"defaultDeleteScripts":true,
"defaultDeleteComments":true,
"defaultIgnoreHrefs":false,
};
if(details.reason==="install"){
browser.storage.local.get(['sites','settings']).then(result=>{
Expand Down Expand Up @@ -122,7 +128,7 @@ let delayCurrentId,

browser.runtime.onMessage.addListener(run);
function run(m,s){
if(m.addThis)rqstAdd(m.url,m.title,m.favicon,m.mode,m.freq,m.addBookmark,m.cssSelector,m.ignoreNumbers,m.deleteScript);
if(m.addThis)rqstAdd(m.url,m.title,m.favicon,m.mode,m.freq,m.addBookmark,m.cssSelector,m.ignoreNumbers,m.deleteScript,m.deleteComments,m.ignoreHrefs);
if(m.scanSites)scanSites(m.force);
if(m.openSites)openSite();
if(m.addToContextMenu!==undefined)showContext(m.addToContextMenu);
Expand Down
4 changes: 4 additions & 0 deletions src/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ function generateChangelog(){
changelogGenerated=true;

let changelog=`[
{"version":"1.9.6",
"changes":["Added possibility to change 'default values' (interval, mode, etc.)","#48","Added possibility to ignore link addresses","#52","Added possibility to delete HTML comments","#51","Moved execution of some functions from sidebar to background","Minor changes","Fiexed bugs"],
"changesPL":["Dodano możliwość zmiany 'wartości domyślnych' (interwał, tryb, itp.)","#48","Dodano możliwość ignorowania adresów odnośników","#52","Dodano możliwość usunięcia komentarzy HTML","#51","Przeniesiono wykonywanie niektórtch funkcji z panelu bocznego do tła","Drobne zmiany","Naprawiono błędy"]
},
{"version":"1.9.5",
"changes":["Fixed bug","#36","Added possibility to change options individually for each pages","Added possibility to delete JS scripts","Added links to GitHub in 'Changelog'","Added possibility to change sound of the notification","Added possibility to stop openning next pages (Middle-click the button on a toolbar)","#42","Minor changes","Fixed bugs"],
"changesPL":["Naprawiono błąd","#36","Dodano możliwość zmiany opcji indywidualnie dla każdej strony","Dodano możliwość usunięcia skryptów JS","Dodano odnośniki do GitHuba w 'Historii zmian' ","Dodano możliwość zmiany dźwięku powiadomienia","Dodano możliwość zatrzymania otwierania kolejnych stron (Kliknięcie środkowym przyciskiem myszy przycisku na pasku narzędzi)","#42","Drobne zmiany","Naprawiono błędy"]
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.9.5.1",
"version": "1.9.6",
"default_locale": "en",
"icons": {
"48": "icons/icon.svg",
Expand Down
64 changes: 48 additions & 16 deletions src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,28 @@ <h3 id="thGeneral"></h3>
<input type="checkbox" id="openChangelog"><label id="labelOpenChangelog" for="openChangelog"></label>
</div>
<div class="row">
<label id="labelTheme"></label
><select id="theme">
<option value="light"></option>
<option value="dark"></option>
</select>
</div>
<div class="row">
<label id="labelDefaultCharset"></label><input type="text" id="defaultCharset" placeholder="utf-8">
<input type="checkbox" id="autoScanPause"><label id="labelAutoScanPause" for="autoScanPause"></label>
</div>
<div class="row" id="groupPeriod">
<label id="labelPeriod"></label><input id="period" type="number" min="5" max="1440" placeholder="60">
<p id="sublabelPeriod" class="subLabel"></p>
</div>
<div class="row">
<input type="checkbox" id="autoScanPause"><label id="labelAutoScanPause" for="autoScanPause"></label>
<label id="labelTheme"></label
><select id="theme">
<option value="light"></option>
<option value="dark"></option>
</select>
</div>
<div class="row">
<input type="checkbox" id="showSearchbar"><label id="labelShowSearchbar" for="showSearchbar"></label>
<label id="labelFavicon"></label
><select id="favicon">
<option value="native"></option>
<option value="duckduckgo">DuckDuckGo</option>
<option value="google">Google</option>
</select>
</div>
<h3 id="h3sidebar"></h3>
<div class="row" id="shortcut">
<label id="labelShortcut"></label
><select id="shortcut1">
Expand All @@ -69,12 +72,7 @@ <h3 id="thGeneral"></h3>
</select>+<input type="text" id="shortcut3" placeholder="Q" pattern="([A-Za-z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right|([Ff][1-9]|[Ff]1[0-2]))\s*$">
</div>
<div class="row">
<label id="labelFavicon"></label
><select id="favicon">
<option value="native"></option>
<option value="duckduckgo">DuckDuckGo</option>
<option value="google">Google</option>
</select>
<input type="checkbox" id="showSearchbar"><label id="labelShowSearchbar" for="showSearchbar"></label>
</div>
<h3 id="h3pageView"></h3>
<div class="row">
Expand Down Expand Up @@ -144,6 +142,40 @@ <h3 id="thNotifications"></h3>
<div class="row none" id="rowExternalSound">
<input type="text" id="externalSound">
</div>
<h3 id="h3defaultValues"></h3>
<div class="row">
<label id="labelDefaultCharset"></label><input type="text" id="defaultCharset" placeholder="utf-8">
</div>
<div class="row">
<label id="labelDefaultInterval"></label><input id="defaultFreq" type="number" min="1"
><select id="defaultUnit">
<option value="0.0166667"></option>
<option value="1"></option>
<option value="24"></option>
<option value="168"></option>
</select>
</div>
<div class="row">
<label id="labelDefaultMode"></label><select id="defaultMode">
<option value="m0"></option>
<option value="m3"></option>
<option value="m4"></option>
<option value="m1"></option>
<option value="m2"></option>
</select>
</div>
<div class="row">
<input type="checkbox" id="defaultIgnoreNumbers"><label id="labelDefaultIgnoreNumbers" for="defaultIgnoreNumbers"></label>
</div>
<div class="row">
<input type="checkbox" id="defaultIgnoreHrefs"><label id="labelDefaultIgnoreHrefs" for="defaultIgnoreHrefs"></label>
</div>
<div class="row">
<input type="checkbox" id="defaultDeleteScripts"><label id="labelDefaultDeleteScripts" for="defaultDeleteScripts"></label>
</div>
<div class="row">
<input type="checkbox" id="defaultDeleteComments"><label id="labelDefaultDeleteComments" for="defaultDeleteComments"></label>
</div>
</form>
</section>
<section id="management">
Expand Down
47 changes: 45 additions & 2 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@

function saveOptions(){
const rqstTime=parseInt(document.getElementById("requestTime").value*1000),
period=parseInt(document.getElementById("period").value);
period=parseInt(document.getElementById("period").value),
freq=parseInt(document.getElementById("defaultFreq").value);
let settings={
notificationVolume: parseInt(document.getElementById("notificationVolume").value),
notificationTime: parseInt(document.getElementById("notificationTime").value),
Expand All @@ -115,7 +116,13 @@ function saveOptions(){
highlightOutsideChanges: document.getElementById("highlightOutsideChanges").checked,
scrollbarMarkers: document.getElementById("scrollbarMarkers").checked,
faviconService: document.getElementById("favicon").value,
notificationSound: document.getElementById("notificationSound").value||document.getElementById("externalSound").value
notificationSound: document.getElementById("notificationSound").value||document.getElementById("externalSound").value,
defaultFreq: freq>0?freq*parseFloat(document.getElementById("defaultUnit").value):8,
defaultMode: document.getElementById("defaultMode").value,
defaultIgnoreNumbers: document.getElementById("defaultIgnoreNumbers").checked,
defaultDeleteScripts: document.getElementById("defaultDeleteScripts").checked,
defaultDeleteComments: document.getElementById("defaultDeleteComments").checked,
defaultIgnoreHrefs: document.getElementById("defaultIgnoreHrefs").checked,
};
browser.storage.local.set({settings:settings});
if(!settings.popupList)browser.browserAction.setPopup({popup:"/popup.html"});
Expand Down Expand Up @@ -171,6 +178,23 @@ function restoreOptions(){
document.getElementById("externalSound").value=s.notificationSound;
document.getElementById("rowExternalSound").className="row";
}
const freq=s.defaultFreq||8;
let unit;
if(!(freq%168))
unit=168;
else if(!(freq%24))
unit=24;
else if(freq<1)
unit=0.0166667;
else
unit=1;
document.getElementById("defaultFreq").value=parseInt(freq/unit);
document.getElementById("defaultUnit").value=unit;
document.getElementById("defaultMode").value=s.defaultMode;
document.getElementById("defaultIgnoreNumbers").checked=s.defaultIgnoreNumbers;
document.getElementById("defaultDeleteScripts").checked=s.defaultDeleteScripts;
document.getElementById("defaultDeleteComments").checked=s.defaultDeleteComments;
document.getElementById("defaultIgnoreHrefs").checked=s.defaultIgnoreHrefs;
});
restoreShortcut();
}
Expand Down Expand Up @@ -291,6 +315,25 @@ function translate(){
sound[1].text=i18n("sound")+"2";
sound[2].text=i18n("externalSound");
document.getElementById("externalSound").placeholder=i18n("soundUrl");
document.getElementById("h3sidebar").textContent=i18n("h3sidebar");
document.getElementById("h3defaultValues").textContent=i18n("h3defaultValues");
document.getElementById("labelDefaultInterval").textContent=i18n("defaultInterval");
document.getElementById("labelDefaultMode").textContent=i18n("defaultMode");
let selectFreq=document.getElementById("defaultUnit").options;
selectFreq[0].text=i18n("minutes");
selectFreq[1].text=i18n("hours");
selectFreq[2].text=i18n("days");
selectFreq[3].text=i18n("weeks");
let selectMode=document.getElementById("defaultMode").options;
selectMode[0].text=i18n("modeM0");
selectMode[1].text=i18n("modeM3");
selectMode[2].text=i18n("modeM4");
selectMode[3].text=i18n("modeM1");
selectMode[4].text=i18n("modeM2");
document.getElementById("labelDefaultIgnoreNumbers").textContent=i18n("defaultIgnoreNumbers");
document.getElementById("labelDefaultDeleteScripts").textContent=i18n("defaultDeleteScripts");
document.getElementById("labelDefaultDeleteComments").textContent=i18n("defaultDeleteComments");
document.getElementById("labelDefaultIgnoreHrefs").textContent=i18n("defaultIgnoreHrefs");

document.body.removeAttribute("class");
}
Expand Down
Loading

0 comments on commit 12cddae

Please sign in to comment.