From ca4130f47bbe7f461dc1bc29d4aebb2dec305677 Mon Sep 17 00:00:00 2001
From: Einar Egilsson
Date: Mon, 28 May 2007 22:35:59 +0000
Subject: git-svn-id:
http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@55
119bf307-c92d-0410-89bd-8f53e6181181
---
chrome/content/common.js | 37 ----------
chrome/content/overlay.xul | 6 +-
chrome/content/redirect.js | 5 +-
chrome/content/redirect.xul | 2 +-
chrome/content/redirector.js | 163 ++++++++++++++++++++++---------------------
5 files changed, 91 insertions(+), 122 deletions(-)
delete mode 100644 chrome/content/common.js
(limited to 'chrome')
diff --git a/chrome/content/common.js b/chrome/content/common.js
deleted file mode 100644
index 7d13e4b..0000000
--- a/chrome/content/common.js
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-var RedirectorCommon = {
-
- wildcardMatch : function(pattern, text) {
- var parts
- , part
- , i
- , pos;
-
- parts = pattern.split('*');
-
- for (i in parts) {
-
- part = parts[i];
-
- pos = text.indexOf(part);
-
- if (pos == -1) {
- return false;
- }
-
- if (i == 0 && pos != 0) {
- return false;
- }
-
- if (i == parts.length -1 && i != "" && text.substr(text.length - part.length) != part) {
- return false;
-
- }
-
- text = text.substr(pos + part.length);
- }
-
- return true;
- }
-};
\ No newline at end of file
diff --git a/chrome/content/overlay.xul b/chrome/content/overlay.xul
index 7951516..c65df70 100644
--- a/chrome/content/overlay.xul
+++ b/chrome/content/overlay.xul
@@ -6,8 +6,8 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
+
@@ -16,12 +16,12 @@
\ No newline at end of file
diff --git a/chrome/content/redirect.js b/chrome/content/redirect.js
index bd1a686..cfd2a2e 100644
--- a/chrome/content/redirect.js
+++ b/chrome/content/redirect.js
@@ -14,7 +14,8 @@ var Redirect = {
var params = window.arguments[0];
params.out.pattern = $('txtPattern').value;
- params.out.patternType = 'Wildcard';
+ params.out.patternType = kRedirectorWildcard;
+ params.out.exampleUrl =$('txtExampleUrl').value;
params.out.redirectUrl = $('txtRedirectUrl').value;
params.out.onlyIfLinkExists = $('chkOnlyIfLinkExists').checked;
@@ -23,7 +24,7 @@ var Redirect = {
testPattern : function() {
try {
- alert(RedirectorCommon.wildcardMatch($('txtPattern').value, $('txtExampleUrl').value));
+ alert(Redirector.wildcardMatch($('txtPattern').value, $('txtExampleUrl').value));
} catch(e) {alert(e);}
}
diff --git a/chrome/content/redirect.xul b/chrome/content/redirect.xul
index ea8ac02..5d6ff2c 100644
--- a/chrome/content/redirect.xul
+++ b/chrome/content/redirect.xul
@@ -10,8 +10,8 @@
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
+