diff options
author | Einar Egilsson | 2009-10-08 11:41:58 +0000 |
---|---|---|
committer | Einar Egilsson | 2009-10-08 11:41:58 +0000 |
commit | 18628591d8bad26265a5a16055285b50e0184b11 (patch) | |
tree | 68f3f4df517155bc080be94fbc847929812d3d22 /chrome/content/code/browserOverlay.xul.js | |
parent | fa392246ec57c59614e02645aa0fe74a0bd71ac7 (diff) |
Tooltips and accesskeys
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@257 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/code/browserOverlay.xul.js')
-rw-r--r-- | chrome/content/code/browserOverlay.xul.js | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/chrome/content/code/browserOverlay.xul.js b/chrome/content/code/browserOverlay.xul.js index 5c84859..129da48 100644 --- a/chrome/content/code/browserOverlay.xul.js +++ b/chrome/content/code/browserOverlay.xul.js @@ -4,30 +4,21 @@ var Redirector = Components.classes["@einaregilsson.com/redirector;1"].getServic var RedirectorOverlay = { - name : "Redirector", - initialized : false, strings : null, onLoad : function(event) { try { // initialization code - Redirector.debug("Initializing..."); document.getElementById('contentAreaContextMenu') .addEventListener("popupshowing", function(e) { RedirectorOverlay.showContextMenu(e); }, false); - if (!Redirector.getBoolPref('showContextMenu')) { - document.getElementById('redirector-context').hidden = true; - } - if (!Redirector.getBoolPref('showStatusBarIcon')) { - document.getElementById('redirector-status').hidden = true; - } + document.getElementById('redirector-status').hidden = !Redirector.getBoolPref('showStatusBarIcon'); + document.getElementById('redirector-context').hidden = !Redirector.getBoolPref('showContextMenu'); + this.strings = document.getElementById("redirector-strings"); this.prefObserver.register(); this.setStatusBarImg(); - - Redirector.debug("Finished initialization"); - this.initialized = true; } catch(e) { if (this.strings) { @@ -123,8 +114,15 @@ var RedirectorOverlay = { }, observe : function(subject, topic, data) { - if (topic == 'nsPref:changed' && data == 'extensions.redirector.enabled') { + if (topic != 'nsPref:changed') { + return; + } + if (data == 'extensions.redirector.enabled') { RedirectorOverlay.setStatusBarImg(); + } else if (data == 'extensions.redirector.showStatusBarIcon') { + document.getElementById('redirector-status').hidden = !Redirector.getBoolPref('showStatusBarIcon'); + } else if (data == 'extensions.redirector.showContextMenu') { + document.getElementById('redirector-context').hidden = !Redirector.getBoolPref('showContextMenu'); } } } |