diff options
author | Einar Egilsson | 2007-10-05 21:10:42 +0000 |
---|---|---|
committer | Einar Egilsson | 2007-10-05 21:10:42 +0000 |
commit | d30ede45e7ff0624ca4a1bcc565c344a6df23ee2 (patch) | |
tree | db69cf7e65971d7764a9505afc2f36cb1ae6ac61 /chrome | |
parent | 44344acd49dbd1781825644deee839d7de132e00 (diff) |
Redirector 1.0.2.1
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@94 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/content/overlay.js | 4 | ||||
-rw-r--r-- | chrome/content/overlay.xul | 2 | ||||
-rw-r--r-- | chrome/content/redirector.js | 36 |
3 files changed, 20 insertions, 22 deletions
diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js index 7795372..b7bd560 100644 --- a/chrome/content/overlay.js +++ b/chrome/content/overlay.js @@ -160,11 +160,11 @@ var RedirectorOverlay = { var statusImg = $('redirector-statusbar-img'); if (RedirLib.getBoolPref('enabled')) { - statusImg.src = 'chrome://redirector/content/statusactive.png' + statusImg.src = 'chrome://redirector/content/statusactive.PNG' statusImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip')); Redirector.enabled = true; } else { - statusImg.src = 'chrome://redirector/content/statusinactive.png' + statusImg.src = 'chrome://redirector/content/statusinactive.PNG' statusImg.setAttribute('tooltiptext', this.strings.getString('disabledTooltip')); Redirector.enabled = false; } diff --git a/chrome/content/overlay.xul b/chrome/content/overlay.xul index d180d1f..e229530 100644 --- a/chrome/content/overlay.xul +++ b/chrome/content/overlay.xul @@ -26,7 +26,7 @@ </popup> <statusbar id="status-bar"> <statusbarpanel id="redirector-status"> - <image id="redirector-statusbar-img" src="chrome://redirector/content/statusactive.png" + <image id="redirector-statusbar-img" src="chrome://redirector/content/statusactive.PNG" tooltiptext="Redirector is enabled;" style="width:16px; height:16px;" onclick="RedirectorOverlay.toggleEnabled();" /> diff --git a/chrome/content/redirector.js b/chrome/content/redirector.js index 1c77ed6..cc09300 100644 --- a/chrome/content/redirector.js +++ b/chrome/content/redirector.js @@ -57,25 +57,23 @@ var Redirector = { getRedirectUrlForInstantRedirect : function(url) { var redirect, link, links, redirectUrl; - if (!this.enabled) { - return null; - } - - for each (redirect in this.list) { - - redirectUrl = this.getRedirectUrl(url, redirect); - //Can't do fast redirect if it requires that link exists - //we need the original page to verify that it exists. - //Slow redirect will be done automatically. - if (redirectUrl) { - - if (!redirect.onlyIfLinkExists && !redirect.redirectUrl.startsWith('xpath:')) { - RedirLib.debug('%1 matches %2, and it\'s not only if link exists and not an xpath expression. Can do instant redirect.'._(redirect.pattern, url)); - return { 'url' : redirectUrl, 'pattern' : redirect.pattern}; - } else if (redirect.redirectUrl.startsWith('xpath:')) { - RedirLib.debug('%1 matches %2, but the redirect is a xpath expression and so has to be a slow redirect'._(redirect.pattern, url)); - } else { - RedirLib.debug('%1 matches %2, but it\'s "only if link exists" and so has to be a slow redirect'._(redirect.pattern, url)); + if (this.enabled) { + + for each (redirect in this.list) { + + redirectUrl = this.getRedirectUrl(url, redirect); + //Can't do fast redirect if it requires that link exists + //we need the original page to verify that it exists. + //Slow redirect will be done automatically. + if (redirectUrl) { + if (!redirect.onlyIfLinkExists && !redirect.redirectUrl.startsWith('xpath:')) { + RedirLib.debug('%1 matches %2, and it\'s not only if link exists and not an xpath expression. Can do instant redirect.'._(redirect.pattern, url)); + return { 'url' : redirectUrl, 'pattern' : redirect.pattern}; + } else if (redirect.redirectUrl.startsWith('xpath:')) { + RedirLib.debug('%1 matches %2, but the redirect is a xpath expression and so has to be a slow redirect'._(redirect.pattern, url)); + } else { + RedirLib.debug('%1 matches %2, but it\'s "only if link exists" and so has to be a slow redirect'._(redirect.pattern, url)); + } } } } |