[Pkg-mozext-commits] [greasemonkey] 08/19: The notification bar (persistence)

David Prévot taffit at moszumanska.debian.org
Fri May 6 12:48:48 UTC 2016


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

taffit pushed a commit to branch master
in repository greasemonkey.

commit 8e19516aec00ebfcbb5f7cbdb585452e0e340fe9
Author: janekptacijarabaci <janekptacijarabaci at seznam.cz>
Date:   Mon Apr 11 13:25:50 2016 +0200

    The notification bar (persistence)
---
 content/browser.js      |  3 ++-
 content/config.js       |  3 ++-
 modules/remoteScript.js | 10 ++++------
 modules/stats.js        |  3 ++-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/content/browser.js b/content/browser.js
index c2671d2..e1ed4f8 100644
--- a/content/browser.js
+++ b/content/browser.js
@@ -231,13 +231,14 @@ GM_BrowserUI.checkDisabledScriptNavigation = function(aContentType, aHref) {
   }];
 
   var notificationBox = gBrowser.getNotificationBox();
-  notificationBox.appendNotification(
+  var notification = notificationBox.appendNotification(
     GM_BrowserUI.bundle.GetStringFromName('greeting.msg'),
     "install-userscript",
     "chrome://greasemonkey/skin/icon16.png",
     notificationBox.PRIORITY_WARNING_MEDIUM,
     buttons
   );
+  notification.persistence = -1;
 };
 
 GM_BrowserUI.init();
diff --git a/content/config.js b/content/config.js
index 7e719a8..46ef38f 100644
--- a/content/config.js
+++ b/content/config.js
@@ -267,13 +267,14 @@ Config.prototype.updateModifiedScripts = function(
             "callback": function () {}
           });
           var notificationBox = chromeWin.gBrowser.getNotificationBox();
-          notificationBox.appendNotification(
+          var notification = notificationBox.appendNotification(
             msg,
             "parse-userscript",
             "chrome://greasemonkey/skin/icon16.png",
             notificationBox.PRIORITY_WARNING_MEDIUM,
             buttons
           );
+          notification.persistence = -1;
         }
         GM_util.logError(msg, true, script.fileURL, null);
       }
diff --git a/modules/remoteScript.js b/modules/remoteScript.js
index 45d04fe..a351497 100644
--- a/modules/remoteScript.js
+++ b/modules/remoteScript.js
@@ -489,18 +489,16 @@ RemoteScript.prototype.showSource = function(aBrowser) {
         GM_util.timeout(function() { tabBrowser.removeTab(tab); }, 0);
       })
     }];
-  function addNotification() {
-    tab.removeEventListener('load', addNotification, true);
-    var notificationBox = tabBrowser.getNotificationBox();
-    notificationBox.appendNotification(
+  // See #2348
+  var notificationBox = tabBrowser.getNotificationBox();
+  var notification = notificationBox.appendNotification(
       stringBundleBrowser.GetStringFromName('greeting.msg'),
       "install-userscript",
       "chrome://greasemonkey/skin/icon16.png",
       notificationBox.PRIORITY_WARNING_MEDIUM,
       buttons
     );
-  }
-  tab.addEventListener('load', addNotification, true);
+  notification.persistence = -1;
 };
 
 RemoteScript.prototype.toString = function() {
diff --git a/modules/stats.js b/modules/stats.js
index e2cab16..dba907d 100644
--- a/modules/stats.js
+++ b/modules/stats.js
@@ -153,7 +153,7 @@ function promptUser() {
   var browser = win.gBrowser;
 
   var notificationBox = browser.getNotificationBox();
-  notificationBox.appendNotification(
+  var notification = notificationBox.appendNotification(
     gStringBundle.GetStringFromName('stats-prompt.msg'),
     "greasemonkey-stats-opt-in",
     "chrome://greasemonkey/skin/icon16.png",
@@ -177,4 +177,5 @@ function promptUser() {
       }
     }]
   );
+  notification.persistence = -1;
 }

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



More information about the Pkg-mozext-commits mailing list