[Pkg-mozext-commits] [nosquint] 13/47: Import of 2.0.1b2 release into git

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


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

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

commit 9f6dbca6a9a16f58d8e9fffc64bedce84af2facb
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Fri Jan 13 19:41:13 2012 -0500

    Import of 2.0.1b2 release into git
---
 src/content/browser.js  | 88 ++++++++++++++++++++++++++++++-------------------
 src/content/cmd.js      |  4 +--
 src/content/overlay.xul |  2 +-
 src/content/prefs.js    |  2 +-
 src/install.rdf         |  2 +-
 5 files changed, 60 insertions(+), 38 deletions(-)

diff --git a/src/content/browser.js b/src/content/browser.js
index 70af012..7cf85f4 100644
--- a/src/content/browser.js
+++ b/src/content/browser.js
@@ -10,6 +10,7 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     var zoomAllTimer = null;             // Timer for queueZoomAll()
     var styleAllTimer = null;            // Timer for queueStyleAll()
     var updateStatusTimer = null;        // Timer for queueUpdateStatus()
+    var tooltipDirty = false;            // True if tooltip needs updating on hover
 
     this.init = function() {
         this.gBrowser = gBrowser;
@@ -56,6 +57,8 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     };
 
     this.destroy = function() {
+        if (NSQ.storage.dialogs.site)
+            NSQ.storage.dialogs.site.die();
     };
 
 
@@ -162,10 +165,53 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     };
 
 
+    this.updateStatusTooltip = function() {
+        if (!tooltipDirty)
+            return;
+        tooltipDirty = false;
+
+        // Get cached sitename for current browser.
+        var browser = gBrowser.selectedBrowser;
+        var site = browser.getUserData('nosquint').site;
+        var text = Math.round(browser.markupDocumentViewer.textZoom * 100);
+        var full = Math.round(browser.markupDocumentViewer.fullZoom * 100);
+
+        var e = $('nosquint-status');
+        // updateStatusTooltip() won't be called unless site is not null.
+        $('nosquint-status-tooltip-site').value = site.replace(/%20/g, ' ');
+        $('nosquint-status-tooltip-full').value = full + '%';
+        $('nosquint-status-tooltip-text').value = text + '%';
+
+        var style = this.getStyleForBrowser(browser);
+        var label = $('nosquint-status-tooltip-textcolor');
+        label.style.color = style.colorText || 'inherit';
+        label.style.backgroundColor = style.colorBackground || 'inherit';
+        label.value = (style.colorText || style.colorBackground) ? 'Sample' : 'Site Controlled';
+
+        var vis = $('nosquint-status-tooltip-vis-link');
+        var unvis = $('nosquint-status-tooltip-unvis-link');
+        unvis.value = vis.value = '';
+        vis.style.color = vis.style.textDecoration = 'inherit';
+        unvis.style.color = unvis.style.textDecoration = 'inherit';
+
+        if (!style.linksUnvisited && !style.linksVisited)
+            unvis.value = 'Site Controlled';
+        else {
+            for (let [attr, elem] in items({'linksUnvisited': unvis, 'linksVisited': vis})) {
+                if (style[attr]) {
+                    elem.value = attr.replace('links', '');
+                    elem.style.color = style[attr];
+                    elem.style.textDecoration = style.linksUnderline ? 'underline' : 'inherit';
+                }
+            }
+        }
+    };
+
     /* Updates the status panel and tooltip to reflect current site name
      * and zoom levels.
      */
     this.updateStatus = function() {
+        // Get cached sitename for current browser.
         var browser = gBrowser.selectedBrowser;
         var site = browser.getUserData('nosquint').site;
         // Disable/enable context menu item.
@@ -180,45 +226,20 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
             // Pref indicates we're hiding status panel, no sense in updating.
             return;
 
-        var text = Math.round(browser.markupDocumentViewer.textZoom * 100);
-        var full = Math.round(browser.markupDocumentViewer.fullZoom * 100);
-        var [text_default, full_default] = NSQ.prefs.getZoomDefaults();
-
         var e = $('nosquint-status');
         if (site) {
+            var text = Math.round(browser.markupDocumentViewer.textZoom * 100);
+            var full = Math.round(browser.markupDocumentViewer.fullZoom * 100);
+            var [text_default, full_default] = NSQ.prefs.getZoomDefaults();
+
             if (NSQ.prefs.fullZoomPrimary)
-                e.label = full + '%' + (text == 100 ? '' : (' / ' + text + '%'));
+                e.label = full + '%' + (text == text_default ? '' : (' / ' + text + '%'));
             else
-                e.label = text + '%' + (full == 100 ? '' : (' / ' + full + '%'));
-            $('nosquint-status-tooltip-site').value = site.replace(/%20/g, ' ');
-            $('nosquint-status-tooltip-full').value = full + '%';
-            $('nosquint-status-tooltip-text').value = text + '%';
-
-            var style = this.getStyleForBrowser(browser);
-            var label = $('nosquint-status-tooltip-textcolor');
-            label.style.color = style.colorText || 'inherit';
-            label.style.backgroundColor = style.colorBackground || 'inherit';
-            label.value = (style.colorText || style.colorBackground) ? 'Sample' : 'Site Controlled';
-
-            var vis = $('nosquint-status-tooltip-vis-link');
-            var unvis = $('nosquint-status-tooltip-unvis-link');
-            unvis.value = vis.value = '';
-            vis.style.color = vis.style.textDecoration = 'inherit';
-            unvis.style.color = unvis.style.textDecoration = 'inherit';
-
-            if (!style.linksUnvisited && !style.linksVisited)
-                unvis.value = 'Site Controlled';
-            else {
-                for (let [attr, elem] in items({'linksUnvisited': unvis, 'linksVisited': vis})) {
-                    if (style[attr]) {
-                        elem.value = attr.replace('links', '');
-                        elem.style.color = style[attr];
-                        elem.style.textDecoration = style.linksUnderline ? 'underline' : 'inherit';
-                    }
-                }
-            }
+                e.label = text + '%' + (full == full_default ? '' : (' / ' + full + '%'));
+
             $('nosquint-status-tooltip').style.display = '';
             e.style.fontStyle = e.style.opacity = 'inherit';
+            tooltipDirty = true;
         } else {
             $('nosquint-status-tooltip').style.display = 'none';
             e.label = 'N/A';
@@ -228,6 +249,7 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
              */
             e.style.opacity = 0.5;
             e.style.fontStyle = 'italic';
+            tooltipDirty = false;
         }
     };
 
diff --git a/src/content/cmd.js b/src/content/cmd.js
index eba119a..ec41b28 100644
--- a/src/content/cmd.js
+++ b/src/content/cmd.js
@@ -161,7 +161,7 @@ NoSquint.cmd = NoSquint.ns(function() { with (NoSquint) {
         var dlg = NSQ.storage.dialogs.site;
         if (dlg)
             return dlg.setBrowser(NSQ.browser, browser);
-        window.openDialog('chrome://nosquint/content/dlg-site.xul', null, 'chrome', NSQ.browser, browser);
+        window.openDialog('chrome://nosquint/content/dlg-site.xul', 'nsqSite', 'chrome', NSQ.browser, browser);
     };
 
 
@@ -178,7 +178,7 @@ NoSquint.cmd = NoSquint.ns(function() { with (NoSquint) {
                 host += ':' + browser.currentURI.port;
         } catch (err) {};
         var url = host + browser.currentURI.path;
-        window.openDialog('chrome://nosquint/content/dlg-global.xul', null, 'chrome', url);
+        window.openDialog('chrome://nosquint/content/dlg-global.xul', 'nsqGlobal', 'chrome', url);
     };
 
 }});
diff --git a/src/content/overlay.xul b/src/content/overlay.xul
index cc12c52..ad034e5 100644
--- a/src/content/overlay.xul
+++ b/src/content/overlay.xul
@@ -50,7 +50,7 @@
     </popup>
 
     <statusbar id="status-bar">
-        <tooltip id="nosquint-status-tooltip" orient="vertical">
+        <tooltip id="nosquint-status-tooltip" orient="vertical" onpopupshowing="NoSquint.browser.updateStatusTooltip()">
             <grid>
                 <columns>
                     <column />
diff --git a/src/content/prefs.js b/src/content/prefs.js
index 579eb74..dec1d15 100644
--- a/src/content/prefs.js
+++ b/src/content/prefs.js
@@ -550,7 +550,7 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
          * changes the zoom several times in a short period of time, we aren't
          * needlessly iterating over the sites array.
          */
-        debug("queueSaveSiteList(): delay=" + this.saveDelay + ', window=' + window);
+        debug("queueSaveSiteList(): delay=" + this.saveDelay);
         saveTimer = this.winFunc('setTimeout', function() NSQ.prefs.saveSiteList(), this.saveDelay);
     };
 
diff --git a/src/install.rdf b/src/install.rdf
index 0ce1b26..d3e47f1 100644
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -6,7 +6,7 @@
     
         <em:id>nosquint at urandom.ca</em:id>
         <em:name>NoSquint</em:name>
-        <em:version>2.0.1b1</em:version>
+        <em:version>2.0.1b2</em:version>
         <em:description>Manage site-specific zoom levels and color settings</em:description>
         <em:creator>Jason Tackaberry</em:creator>
         <!-- optional items -->

-- 
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