diff --git a/css/popup.css b/css/popup.css index 2ef52c730..a8db1f4a9 100644 --- a/css/popup.css +++ b/css/popup.css @@ -86,10 +86,20 @@ p { text-align: center; cursor: pointer; } -#dynamicFilteringToggler::after { +#dynamicFilteringToggler a { + padding: 0 2px; + position: absolute; + __MSG_@@bidi_end_edge__: 0; + color: #aaa; + visibility: hidden; + } +#dynamicFilteringToggler.on a { + visibility: visible; + } +#dynamicFilteringToggler::before { content: '\f107'; } -#dynamicFilteringToggler.on::after { +#dynamicFilteringToggler.on::before { content: '\f106'; } #dynamicFilteringContainer { @@ -116,10 +126,10 @@ p { } .dynamicFiltering > div { margin: 0; - border: 1px solid #eee; + border: 1px solid #e6e6e6; padding: 0; box-sizing: border-box; - background-color: #eee; + background-color: #e6e6e6; position: absolute; cursor: pointer; } @@ -173,14 +183,14 @@ p { background-color: transparent; } .dynamicFiltering > div.blocked { - border-color: #fdd; - background-color: #fdd; + border-color: #fbb; + background-color: #fbb; } .dynamicFiltering > div.ownFilter { border-color: #bbb; background-color: #bbb; } .dynamicFiltering > div.blocked.ownFilter { - border-color: #eaa; - background-color: #eaa; + border-color: #f66; + background-color: #f66; } diff --git a/js/messaging-handlers.js b/js/messaging-handlers.js index 7085b431f..5c061865c 100644 --- a/js/messaging-handlers.js +++ b/js/messaging-handlers.js @@ -650,27 +650,24 @@ var getUserData = function(callback) { /******************************************************************************/ var restoreUserData = function(userData) { - var onUserFiltersSaved = function() { - µb.XAL.restart(); - }; - µb.destroySelfie(); + // If we are going to restore all, might as well wipe out clean local + // storage + µb.XAL.keyvalRemoveAll(); + µBlock.saveLocalSettings(); µb.XAL.keyvalSetMany(userData.userSettings); µb.XAL.keyvalSetOne('remoteBlacklists', userData.filterLists); µb.XAL.keyvalSetOne('netWhitelist', userData.netWhitelist); - µb.assets.put('assets/user/filters.txt', userData.userFilters, onUserFiltersSaved); + µb.assets.put('assets/user/filters.txt', userData.userFilters); + µb.XAL.restart(); }; /******************************************************************************/ var resetUserData = function() { - var onAllDone = function() { - µb.XAL.restart(); - }; + µb.XAL.keyvalRemoveAll(); // Keep global counts, people can become quite attached to numbers - var onAllRemoved = function() { - µBlock.saveLocalSettings(onAllDone); - }; - µb.XAL.keyvalRemoveAll(onAllRemoved); + µBlock.saveLocalSettings(); + µb.XAL.restart(); }; /******************************************************************************/ diff --git a/js/popup.js b/js/popup.js index 427e7d6ed..28d3c2f17 100644 --- a/js/popup.js +++ b/js/popup.js @@ -235,7 +235,11 @@ var onDynamicFilterClicked = function(ev) { /******************************************************************************/ -var toggleDynamicFiltering = function() { +var toggleDynamicFiltering = function(ev) { + // Discard events destined to child elements. + if ( ev !== undefined && ev.target !== this ) { + return; + } var el = uDom('#dynamicFilteringToggler'); el.toggleClass('on'); messaging.tell({ diff --git a/js/xal.js b/js/xal.js index fa9727979..9eef68b29 100644 --- a/js/xal.js +++ b/js/xal.js @@ -28,6 +28,7 @@ /******************************************************************************/ var exports = {}; +var noopFunc = function(){}; /******************************************************************************/ @@ -74,7 +75,7 @@ exports.keyvalSetMany = function(dict) { /******************************************************************************/ exports.keyvalRemoveAll = function(callback) { - chrome.storage.local.clear(callback); + chrome.storage.local.clear(callback || noopFunc); }; /******************************************************************************/ diff --git a/popup.html b/popup.html index 9ea4b5977..ab86a8b3d 100644 --- a/popup.html +++ b/popup.html @@ -24,7 +24,9 @@
?
- +