From 100883d6c539e0fa23b2baec668e4d48cf5d2506 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Wed, 11 Nov 2009 07:59:43 +0000 Subject: Fixed error when pressing Cancel on the Import file picker. Converted spaces to tabs on all .js files. git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@294 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/code/browserOverlay.xul.js | 164 +++++++++++++++--------------- 1 file changed, 82 insertions(+), 82 deletions(-) (limited to 'chrome/content/code/browserOverlay.xul.js') diff --git a/chrome/content/code/browserOverlay.xul.js b/chrome/content/code/browserOverlay.xul.js index 2a6fbac..e194e5f 100644 --- a/chrome/content/code/browserOverlay.xul.js +++ b/chrome/content/code/browserOverlay.xul.js @@ -4,101 +4,101 @@ var Redirector = Components.classes["@einaregilsson.com/redirector;1"].getServic var RedirectorOverlay = { - strings : null, - prefs : null, + strings : null, + prefs : null, - onLoad : function(event) { - try { + 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 Prefs(); - 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"); - }, + // initialization code + document.getElementById('contentAreaContextMenu') + .addEventListener("popupshowing", function(e) { RedirectorOverlay.showContextMenu(e); }, false); + + this.strings = document.getElementById("redirector-strings"); + this.prefs = new Prefs(); + 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'); + 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')); - } + 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-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'); - } - }, + }, + + 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) { + onContextMenuCommand: function(event) { var redirect = new Redirect(window.content.location.href, window.content.location.href); - if (gContextMenu.onLink) { - redirect.redirectUrl = gContextMenu.link.toString(); - } + 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(); - }, + 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; - }, + 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; + 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(); - } - } + if (event.button == LEFT) { + RedirectorOverlay.toggleEnabled(); + } else if (event.button == RIGHT) { + this.openSettings(); + } + } }; window.addEventListener("load", function(event) { RedirectorOverlay.onLoad(event); }, false); -- cgit v1.2.3-70-g09d2