From 502c24f18cdfa0f808d9383313bb4f965c7fb11f Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Mon, 21 May 2007 22:03:05 +0000 Subject: Redirector git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@53 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome.manifest | 5 + chrome/content/common.js | 37 +++++ chrome/content/overlay.xul | 27 ++++ chrome/content/redirect.js | 30 +++++ chrome/content/redirect.xul | 39 ++++++ chrome/content/redirectList.js | 30 +++++ chrome/content/redirectList.xul | 37 +++++ chrome/content/redirector.js | 97 +++++++++++++ chrome/content/redirector.png | Bin 0 -> 1462 bytes chrome/content/redirlib.js | 217 ++++++++++++++++++++++++++++++ chrome/locale/en-US/redirect.dtd | 8 ++ chrome/locale/en-US/redirectList.dtd | 9 ++ chrome/locale/en-US/redirector.dtd | 5 + chrome/locale/en-US/redirector.properties | 4 + chrome/skin/overlay.css | 1 + defaults/preferences/redirector.js | 6 + install.rdf | 23 ++++ make.bat | 11 ++ 18 files changed, 586 insertions(+) create mode 100644 chrome.manifest create mode 100644 chrome/content/common.js create mode 100644 chrome/content/overlay.xul create mode 100644 chrome/content/redirect.js create mode 100644 chrome/content/redirect.xul create mode 100644 chrome/content/redirectList.js create mode 100644 chrome/content/redirectList.xul create mode 100644 chrome/content/redirector.js create mode 100644 chrome/content/redirector.png create mode 100644 chrome/content/redirlib.js create mode 100644 chrome/locale/en-US/redirect.dtd create mode 100644 chrome/locale/en-US/redirectList.dtd create mode 100644 chrome/locale/en-US/redirector.dtd create mode 100644 chrome/locale/en-US/redirector.properties create mode 100644 chrome/skin/overlay.css create mode 100644 defaults/preferences/redirector.js create mode 100644 install.rdf create mode 100644 make.bat diff --git a/chrome.manifest b/chrome.manifest new file mode 100644 index 0000000..a64fc76 --- /dev/null +++ b/chrome.manifest @@ -0,0 +1,5 @@ +# $Id$ +content redirector file:chrome/content/ +locale redirector en-US file:chrome/locale/en-US/ +skin redirector classic/1.0 file:chrome/skin/ +overlay chrome://browser/content/browser.xul chrome://redirector/content/overlay.xul \ No newline at end of file diff --git a/chrome/content/common.js b/chrome/content/common.js new file mode 100644 index 0000000..7d13e4b --- /dev/null +++ b/chrome/content/common.js @@ -0,0 +1,37 @@ + + +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 new file mode 100644 index 0000000..7951516 --- /dev/null +++ b/chrome/content/overlay.xul @@ -0,0 +1,27 @@ + + + + + + +