[Pkg-mozext-commits] [nosquint] 05/13: Detect new site name caused by changes to exceptions

David Prévot taffit at moszumanska.debian.org
Tue Apr 28 01:41:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 2.1.7
in repository nosquint.

commit 9de8b6d1cc1bef41196393cc32283540203e8a05
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Sun Mar 31 19:49:46 2013 -0400

    Detect new site name caused by changes to exceptions
    
    If the user opens the global settings via the site settings dialog
    and modifies the exceptions list in a way that applies to the current
    site, the site settings dialog will now update to reflect the new
    site name.
---
 src/content/dlg-global.js | 2 ++
 src/content/dlg-site.js   | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/content/dlg-global.js b/src/content/dlg-global.js
index c3ec240..1a08ca3 100644
--- a/src/content/dlg-global.js
+++ b/src/content/dlg-global.js
@@ -103,6 +103,8 @@ NoSquint.dialogs.global = NoSquint.ns(function() { with (NoSquint) {
             }
         }
         NSQ.prefs.saveAll(exceptions);
+        if (NSQ.storage.dialogs.site)
+            NSQ.storage.dialogs.site.discoverSiteNameChange();
         this.finalize();
     };
 
diff --git a/src/content/dlg-site.js b/src/content/dlg-site.js
index c88d9d5..245a6c5 100644
--- a/src/content/dlg-site.js
+++ b/src/content/dlg-site.js
@@ -43,9 +43,13 @@ NoSquint.dialogs.site = NoSquint.ns(function() { with (NoSquint) {
         NSQ.storage.dialogs.site = null;
     };
 
+    this.discoverSiteNameChange = function() {
+        var site = this.browser.getUserData('nosquint').site;
+        if (site != this.site)
+            this.setBrowser(NSQ.browser, this.browser);
+    };
 
     this.setBrowser = function(nsqBrowser, mozBrowser) {
-        NSQ.browser = nsqBrowser;
         var site = mozBrowser.getUserData('nosquint').site;
         if (this.site) {
             if (this.browser != mozBrowser || this.site != site)
@@ -57,6 +61,8 @@ NoSquint.dialogs.site = NoSquint.ns(function() { with (NoSquint) {
                 return;
             }
         }
+
+        NSQ.browser = nsqBrowser;
         this.browser = mozBrowser;
         this.site = site;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nosquint.git



More information about the Pkg-mozext-commits mailing list