From a703799580a208beac24c827fcd54b799f46a3d7 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Wed, 7 Oct 2009 11:24:44 +0000 Subject: Finally working normally again after massive refactoring. Disabling single redirects works but needs more GUI work. Added Redirector log file since the Error Console keeps deleting our messages. git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@253 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/code/browserOverlay.xul.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 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 636c02b..968e9c4 100644 --- a/chrome/content/code/browserOverlay.xul.js +++ b/chrome/content/code/browserOverlay.xul.js @@ -4,7 +4,6 @@ var Redirector = Components.classes["@einaregilsson.com/redirector;1"].getServic var RedirectorOverlay = { - id : "redirector@einaregilsson.com", name : "Redirector", initialized : false, strings : null, @@ -29,10 +28,10 @@ var RedirectorOverlay = { Redirector.debug("Finished initialization"); this.initialized = true; - + } catch(e) { if (this.strings) { - alert(this.strings.getFormattedString("initError", [this.name]) + "\n\n" + e); + alert(this.strings.getString("initError") + "\n\n" + e); } else { alert(e); } @@ -53,21 +52,18 @@ var RedirectorOverlay = { }, onContextMenuCommand: function(event) { - - var item = { exampleUrl : window.content.location.href, pattern: window.content.location.href}; + var redirect = new Redirect(window.content.location.href, window.content.location.href); if (gContextMenu.onLink) { - item.redirectUrl = gContextMenu.link.toString(); + redirect.redirectUrl = gContextMenu.link.toString(); } - window.openDialog("chrome://redirector/content/ui/editRedirect.xul", - "redirect", - "chrome,dialog,modal,centerscreen", item); - - if (item.saved) { - Redirector.addRedirect(item); + 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(); }, -- cgit v1.2.3-70-g09d2