diff --git a/clearurls.js b/clearurls.js index f201043..4cdbe39 100644 --- a/clearurls.js +++ b/clearurls.js @@ -14,7 +14,7 @@ var badgedStatus; var tabid = 0; var globalCounter; var globalurlcounter; -var siteBlockedAlert = browser.extension.getURL('./siteBlockedAlert.html'); +var siteBlockedAlert = browser.extension.getURL('./'); var dataHash; var localDataHash; @@ -98,20 +98,20 @@ function loadOldDataFromStore() /** * Save the hash status to the local storage. * The status can have the following values: - * 1 "unchanged" - * 2 "authorized, changed" - * 3 "unauthorized, changed" + * 1 "up to date" + * 2 "updated" + * 3 "update available" * @param status_code the number for the status */ function storeHashStatus(status_code) { switch(status_code) { - case 1: status_code = "unchanged"; + case 1: status_code = "up to date"; break; - case 2: status_code = "authorized, changed"; + case 2: status_code = "updated"; break; - case 3: status_code = "unauthorized, changed"; + case 3: status_code = "update available"; break; default: status_code = "error"; } @@ -619,13 +619,6 @@ function getLoggingStatus() browser.windows.onRemoved.addListener(saveLog); browser.tabs.onCreated.addListener(saveLog); -/** -* Call by each tab is closed. -*/ -function handleRemoved(tabId, removeInfo) { - delete badges[tabId]; -} - /** * Function that calls some function on storage change. */ @@ -672,9 +665,20 @@ getLogOnStart(); browser.storage.onChanged.addListener(reactToStorageChange); /** -* Call by each tab is closed. +* Call by each tab is updated. +* And if url has changed. */ -browser.tabs.onRemoved.addListener(handleRemoved); +function handleUpdated(tabId, changeInfo, tabInfo) { + if(changeInfo.url) + { + delete badges[tabId]; + } +} + +/** +* Call by each tab is updated. +*/ +browser.tabs.onUpdated.addListener(handleUpdated); /** * Call by each tab change to set the actual tab id diff --git a/log.js b/core_js/log.js similarity index 100% rename from log.js rename to core_js/log.js diff --git a/popup_new.js b/core_js/popup_new.js similarity index 98% rename from popup_new.js rename to core_js/popup_new.js index f207465..32a92f7 100644 --- a/popup_new.js +++ b/core_js/popup_new.js @@ -183,7 +183,7 @@ $(document).ready(function(){ $('#reset_counter_btn').on("click", resetGlobalCounter); $('#tabcounter').on('change', changeTabcounter); $('#logging').on('change', changeLogging); - $('#loggingPage').attr('href', browser.extension.getURL('./log.html')); + $('#loggingPage').attr('href', browser.extension.getURL('./html/log.html')); browser.storage.onChanged.addListener(changeStatistics); }); diff --git a/core_js/write_version.js b/core_js/write_version.js new file mode 100644 index 0000000..3d8f894 --- /dev/null +++ b/core_js/write_version.js @@ -0,0 +1,6 @@ +/** + * This file writes only the version into every page. + * @return version + */ +var version = "1.2"; +$('#version').text(version); diff --git a/bootstrap.min.css b/css/bootstrap.min.css similarity index 100% rename from bootstrap.min.css rename to css/bootstrap.min.css diff --git a/css/core.css b/css/core.css new file mode 100644 index 0000000..a73fc80 --- /dev/null +++ b/css/core.css @@ -0,0 +1,16 @@ +body { + font-size: 13px; +} + +.small-version { + font-size: 10px; +} + +.navbar-header { + margin-top: 0; + margin-bottom: 8px; +} + +.col-sm-1 { + margin-top: -10px; +} diff --git a/dataTables.bootstrap.min.css b/css/dataTables.bootstrap.min.css similarity index 100% rename from dataTables.bootstrap.min.css rename to css/dataTables.bootstrap.min.css diff --git a/switchButtons.css b/css/switchButtons.css similarity index 96% rename from switchButtons.css rename to css/switchButtons.css index 2c21c96..ac6c5fa 100644 --- a/switchButtons.css +++ b/css/switchButtons.css @@ -64,4 +64,8 @@ input:checked + .slider:before { .switch label { position: absolute; left: 60px; -} \ No newline at end of file +} + +label { + font-weight: normal; +} diff --git a/bootstrap.min.js b/external_js/bootstrap.min.js similarity index 100% rename from bootstrap.min.js rename to external_js/bootstrap.min.js diff --git a/dataTables.bootstrap.min.js b/external_js/dataTables.bootstrap.min.js similarity index 100% rename from dataTables.bootstrap.min.js rename to external_js/dataTables.bootstrap.min.js diff --git a/external_js/desktop.ini b/external_js/desktop.ini new file mode 100644 index 0000000..6e81bd2 --- /dev/null +++ b/external_js/desktop.ini @@ -0,0 +1,6 @@ +[LocalizedFileNames] +sha256.jquery.js=@sha256.jquery.js,0 +jquery.dataTables.min.js=@jquery.dataTables.min.js,0 +dataTables.bootstrap.min.js=@dataTables.bootstrap.min.js,0 +bootstrap.min.js=@bootstrap.min.js,0 +jquery-3.2.1.min.js=@jquery-3.2.1.min.js,0 diff --git a/jquery-3.2.1.min.js b/external_js/jquery-3.2.1.min.js similarity index 100% rename from jquery-3.2.1.min.js rename to external_js/jquery-3.2.1.min.js diff --git a/jquery.dataTables.min.js b/external_js/jquery.dataTables.min.js similarity index 100% rename from jquery.dataTables.min.js rename to external_js/jquery.dataTables.min.js diff --git a/sha256.jquery.js b/external_js/sha256.jquery.js similarity index 100% rename from sha256.jquery.js rename to external_js/sha256.jquery.js diff --git a/log.html b/html/log.html similarity index 59% rename from log.html rename to html/log.html index 96c0e23..aa37927 100644 --- a/log.html +++ b/html/log.html @@ -7,8 +7,9 @@ - - + + +