From 4d9993f230c59f8a97767599b1d81eeeac3d35ec Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Sun, 7 Jun 2015 22:30:34 +0000 Subject: Fix toolbar issues --- chrome/browserOverlay.xul | 17 ++------- chrome/images/statusactive.png | Bin 360 -> 340 bytes chrome/images/statusinactive.png | Bin 396 -> 621 bytes chrome/js/browserOverlay.js | 47 ++++++------------------- chrome/redirector.html | 2 -- defaults/preferences/redirector.preferences.js | 3 -- install.rdf | 4 +-- 7 files changed, 14 insertions(+), 59 deletions(-) diff --git a/chrome/browserOverlay.xul b/chrome/browserOverlay.xul index 5dbe4a5..f3ddff7 100644 --- a/chrome/browserOverlay.xul +++ b/chrome/browserOverlay.xul @@ -13,24 +13,11 @@ accesskey="&RedirectorMenuItem.accesskey;" oncommand="RedirectorOverlay.onMenuItemCommand(event);"/> - - - - - - - - + onclick="RedirectorOverlay.toolBarClick(event);return false;" /> diff --git a/chrome/images/statusactive.png b/chrome/images/statusactive.png index 06ce766..3127229 100644 Binary files a/chrome/images/statusactive.png and b/chrome/images/statusactive.png differ diff --git a/chrome/images/statusinactive.png b/chrome/images/statusinactive.png index 8b83562..4c0438e 100644 Binary files a/chrome/images/statusinactive.png and b/chrome/images/statusinactive.png differ diff --git a/chrome/js/browserOverlay.js b/chrome/js/browserOverlay.js index 0963d04..cc29a2a 100644 --- a/chrome/js/browserOverlay.js +++ b/chrome/js/browserOverlay.js @@ -9,10 +9,6 @@ var RedirectorOverlay = { onLoad : function(event) { try { - // initialization code - document.getElementById('contentAreaContextMenu') - .addEventListener("popupshowing", function(e) { RedirectorOverlay.showContextMenu(e); }, false); - this.strings = document.getElementById("redirector-strings"); this.prefs = new RedirectorPrefs(); this.changedPrefs(this.prefs); @@ -37,42 +33,19 @@ var RedirectorOverlay = { }, changedPrefs : function(prefs) { - var statusImg = document.getElementById('redirector-statusbar-img'); var toolbarImg = document.getElementById('redirector-toolbar-img'); - if (prefs.enabled) { - statusImg.src = 'chrome://redirector/content/images/statusactive.png' - statusImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip')); - toolbarImg.setAttribute('image', 'chrome://redirector/content/images/statusactive.png'); - toolbarImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip')); - } else { - statusImg.src = 'chrome://redirector/content/images/statusinactive.png' - statusImg.setAttribute('tooltiptext', this.strings.getString('disabledTooltip')); - toolbarImg.setAttribute('image', 'chrome://redirector/content/images/statusinactive.png'); - toolbarImg.setAttribute('tooltiptext', this.strings.getString('disabledTooltip')); - } - - document.getElementById('redirector-status').hidden = !prefs.showStatusBarIcon; - document.getElementById('redirector-context').hidden = !prefs.showContextMenu; - }, - - showContextMenu : function(event) { - if (gContextMenu.onLink) { - document.getElementById("redirector-context").label = this.strings.getString('addLinkUrl'); - } else { - document.getElementById("redirector-context").label = this.strings.getString('addCurrentUrl'); - } - }, - - onContextMenuCommand: function(event) { - var redirect = new Redirect(window.content.location.href, window.content.location.href); - if (gContextMenu.onLink) { - redirect.redirectUrl = gContextMenu.link.toString(); + if (toolbarImg) { + if (prefs.enabled) { + toolbarImg.setAttribute('image', 'chrome://redirector/content/images/statusactive.png'); + toolbarImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip')); + } else { + toolbarImg.setAttribute('image', 'chrome://redirector/content/images/statusinactive.png'); + toolbarImg.setAttribute('tooltiptext', this.strings.getString('disabledTooltip')); + } } - - gBrowser.selectedTab = gBrowser.addTab("chrome://redirector/content/redirector.html"); }, - + onMenuItemCommand: function(event) { this.openSettings(); }, @@ -85,7 +58,7 @@ var RedirectorOverlay = { gBrowser.selectedTab = gBrowser.addTab("chrome://redirector/content/redirector.html"); }, - statusBarClick : function(event) { + toolBarClick : function(event) { var LEFT = 0, RIGHT = 2; if (event.button == LEFT) { diff --git a/chrome/redirector.html b/chrome/redirector.html index 632b5d2..d03f0b1 100644 --- a/chrome/redirector.html +++ b/chrome/redirector.html @@ -31,8 +31,6 @@

Settings


- -


diff --git a/defaults/preferences/redirector.preferences.js b/defaults/preferences/redirector.preferences.js index c6b864f..e7cc381 100644 --- a/defaults/preferences/redirector.preferences.js +++ b/defaults/preferences/redirector.preferences.js @@ -1,9 +1,6 @@ pref("extensions.redirector.debugEnabled", false); pref("extensions.redirector.enabled", true); -pref("extensions.redirector.showContextMenu", true); -pref("extensions.redirector.showStatusBarIcon", true); pref("extensions.redirector.enableShortcutKey", true); pref("extensions.redirector.version", 'undefined'); pref("extensions.redirector.defaultDir", ''); -pref("extensions.redirector.proxyServerPort", 4815); diff --git a/install.rdf b/install.rdf index 5312015..6ab60a0 100644 --- a/install.rdf +++ b/install.rdf @@ -4,7 +4,7 @@ redirector@einaregilsson.com Redirector - 2.9.2 + 2.9.3 Einar Egilsson Noah Luck Easterly https://github.com/gitoffthelawn @@ -19,7 +19,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 5.0 + 17.0 38.* -- cgit v1.2.3