aboutsummaryrefslogtreecommitdiff
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browserOverlay.xul17
-rw-r--r--chrome/images/statusactive.pngbin360 -> 340 bytes
-rw-r--r--chrome/images/statusinactive.pngbin396 -> 621 bytes
-rw-r--r--chrome/js/browserOverlay.js47
-rw-r--r--chrome/redirector.html2
5 files changed, 12 insertions, 54 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
index 06ce766..3127229 100644
--- a/chrome/images/statusactive.png
+++ b/chrome/images/statusactive.png
Binary files differ
diff --git a/chrome/images/statusinactive.png b/chrome/images/statusinactive.png
index 8b83562..4c0438e 100644
--- a/chrome/images/statusinactive.png
+++ b/chrome/images/statusinactive.png
Binary files 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 @@
<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">