diff options
-rw-r--r-- | chrome/browserOverlay.xul | 17 | ||||
-rw-r--r-- | chrome/images/statusactive.png | bin | 360 -> 340 bytes | |||
-rw-r--r-- | chrome/images/statusinactive.png | bin | 396 -> 621 bytes | |||
-rw-r--r-- | chrome/js/browserOverlay.js | 47 | ||||
-rw-r--r-- | chrome/redirector.html | 2 | ||||
-rw-r--r-- | defaults/preferences/redirector.preferences.js | 3 | ||||
-rw-r--r-- | 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);"/> </menupopup> - <popup id="contentAreaContextMenu"> - <menuitem id="redirector-context" label="&RedirectorContext.label;" - accesskey="&RedirectorContext.accesskey;" - insertafter="context-stop" - oncommand="RedirectorOverlay.onContextMenuCommand(event)"/> - </popup> - <statusbar id="status-bar"> - <statusbarpanel id="redirector-status"> - <image id="redirector-statusbar-img" src="chrome://redirector/content/images/statusactive.png" - tooltiptext="Redirector is enabled;" - style="width:16px; height:16px;" - onclick="RedirectorOverlay.statusBarClick(event);" /> - </statusbarpanel> - </statusbar> <toolbarpalette id="BrowserToolbarPalette"> <toolbarbutton id="redirector-toolbar-img" label="Redirector" + class="toolbarbutton-1 chromeclass-toolbar-additional" image="chrome://redirector/content/images/statusactive.png" - onclick="RedirectorOverlay.statusBarClick(event);return false;" /> + onclick="RedirectorOverlay.toolBarClick(event);return false;" /> </toolbarpalette> </overlay> diff --git a/chrome/images/statusactive.png b/chrome/images/statusactive.png Binary files differindex 06ce766..3127229 100644 --- a/chrome/images/statusactive.png +++ b/chrome/images/statusactive.png diff --git a/chrome/images/statusinactive.png b/chrome/images/statusinactive.png Binary files differindex 8b83562..4c0438e 100644 --- a/chrome/images/statusinactive.png +++ b/chrome/images/statusinactive.png 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 @@ <div id="config" class="dialog"> <h2>Settings</h2> <input type="checkbox" id="enable-redirector" data-pref="enabled" /><label>Enable</label><br /> - <!-- <input type="checkbox" id="show-status-bar-icon" data-pref="showStatusBarIcon"/><label>Statusbar icon</label><br /> --> - <input type="checkbox" id="show-context-menu" data-pref="showContextMenu"/><label>Context menu</label><br /> <input type="checkbox" id="enable-shortcut-key" data-pref="enableShortcutKey"/><label>Toggle via Alt-r</label><br /> <input type="checkbox" id="enable-debug-output" data-pref="debugEnabled"/><label>Debug output</label><br /> <div class="button-row"> 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 @@ <Description about="urn:mozilla:install-manifest"> <em:id>redirector@einaregilsson.com</em:id> <em:name>Redirector</em:name> - <em:version>2.9.2</em:version> + <em:version>2.9.3</em:version> <em:creator>Einar Egilsson</em:creator> <em:contributor>Noah Luck Easterly</em:contributor> <em:contributor>https://github.com/gitoffthelawn</em:contributor> @@ -19,7 +19,7 @@ <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox --> - <em:minVersion>5.0</em:minVersion> + <em:minVersion>17.0</em:minVersion> <em:maxVersion>38.*</em:maxVersion> </Description> </em:targetApplication> |