diff options
author | Einar Egilsson | 2011-08-26 15:11:28 +0200 |
---|---|---|
committer | Einar Egilsson | 2011-08-26 15:11:28 +0200 |
commit | e3b36411d27c6fa6575b386738f9bfd3d582c50a (patch) | |
tree | 6f1f129bb38005e3bf9e597363e7181f318e0aec /chrome/content/code/browserOverlay.xul.js | |
parent | 32da992f75bf6046a8b1d829e742ef1bf0f98d89 (diff) |
Deleted old files
Diffstat (limited to 'chrome/content/code/browserOverlay.xul.js')
-rw-r--r-- | chrome/content/code/browserOverlay.xul.js | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/chrome/content/code/browserOverlay.xul.js b/chrome/content/code/browserOverlay.xul.js deleted file mode 100644 index 19a37df..0000000 --- a/chrome/content/code/browserOverlay.xul.js +++ /dev/null @@ -1,105 +0,0 @@ -//// $Id$ - -var Redirector = Components.classes["@einaregilsson.com/redirector;1"].getService(Components.interfaces.rdIRedirector); - -var RedirectorOverlay = { - - strings : null, - prefs : null, - - 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); - this.prefs.addListener(this); - } catch(e) { - if (this.strings) { - alert(this.strings.getString("initError") + "\n\n" + e); - } else { - alert(e); - } - } - }, - - onUnload : function(event) { - this.prefs.dispose(); - Redirector.debug("Finished cleanup"); - }, - - changedPrefs : function(prefs) { - var statusImg = document.getElementById('redirector-statusbar-img'); - - if (prefs.enabled) { - statusImg.src = 'chrome://redirector/skin/statusactive.png' - statusImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip')); - } else { - statusImg.src = 'chrome://redirector/skin/statusinactive.png' - statusImg.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(); - } - - var args = { saved : false, 'redirect' : redirect }; - window.openDialog("chrome://redirector/content/ui/editRedirect.xul", "redirect", "chrome,dialog,modal,centerscreen", args); - if (args.saved) { - Redirector.addRedirect(args.redirect); - } - }, - - onMenuItemCommand: function(event) { - this.openSettings(); - }, - - toggleEnabled : function(event) { - this.prefs.enabled = !this.prefs.enabled; - }, - - openSettings : function() { - var windowName = "redirectorSettings"; - var windowsMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator); - var win = windowsMediator.getMostRecentWindow(windowName); - if (win) { - win.focus(); - } else { - window.openDialog("chrome://redirector/content/ui/settings.xul", - windowName, - "chrome,dialog,resizable=yes,centerscreen", this); - } - - }, - - statusBarClick : function(event) { - var LEFT = 0, RIGHT = 2; - - if (event.button == LEFT) { - RedirectorOverlay.toggleEnabled(); - } else if (event.button == RIGHT) { - this.openSettings(); - } - } - -}; -window.addEventListener("load", function(event) { RedirectorOverlay.onLoad(event); }, false); -window.addEventListener("unload", function(event) { RedirectorOverlay.onUnload(event); }, false); |