aboutsummaryrefslogtreecommitdiff
path: root/chrome/content/code
diff options
context:
space:
mode:
authorEinar Egilsson2009-10-18 18:32:45 +0000
committerEinar Egilsson2009-10-18 18:32:45 +0000
commitf289589830a0deaec0169672391b7b7ace6bc1cc (patch)
tree2d018641f2321c55d858efb54433dfaacf679bb1 /chrome/content/code
parent3c1f07fa816bf348555b96b5b7df9a29675de09a (diff)
Issue with upgrading should be fixed
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@276 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/code')
-rw-r--r--chrome/content/code/redirect.js19
-rw-r--r--chrome/content/code/redirector.prototype.js4
2 files changed, 11 insertions, 12 deletions
diff --git a/chrome/content/code/redirect.js b/chrome/content/code/redirect.js
index dcd3596..439dd92 100644
--- a/chrome/content/code/redirect.js
+++ b/chrome/content/code/redirect.js
@@ -1,7 +1,9 @@
//// $Id$
-function Redirect(exampleUrl, includePattern, excludePattern, patternType, unescapeMatches, disabled) {
- this._init(exampleUrl, includePattern, excludePattern, patternType, unescapeMatches, disabled);
+ exampleUrl,pattern,redirectUrl,patternType,excludePattern
+
+function Redirect(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, disabled) {
+ this._init(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, disabled);
}
//Static
@@ -68,7 +70,7 @@ Redirect.prototype = {
return new RegExp(this._preparePattern(pattern),"gi");
},
- _init : function(exampleUrl, includePattern, excludePattern, redirectUrl, patternType, unescapeMatches, disabled) {
+ _init : function(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, disabled) {
this.exampleUrl = exampleUrl || '';
this.includePattern = includePattern || '';
this.excludePattern = excludePattern || '';
@@ -101,24 +103,25 @@ Redirect.prototype = {
test : function() {
return this.getMatch(this.exampleUrl);
},
+ exampleUrl,pattern,redirectUrl,patternType,excludePattern
serialize : function() {
return [ this.exampleUrl
, this.includePattern
- , this.excludePattern
, this.redirectUrl
, this.patternType
+ , this.excludePattern
, this.unescapeMatches
, this.disabled ].join(',,,');
},
deserialize : function(str) {
if (!str || !str.split) {
- //TODO: THROW ERROR
+ throw Error("Invalid serialized redirect: " + str);
}
var parts = str.split(',,,');
if (parts.length < 5) {
- ///TODO: throw
+ throw Error("Invalid serialized redirect, too few fields: " + str);
}
this._init.apply(this, parts);
},
@@ -172,8 +175,8 @@ Redirect.prototype = {
clone : function() {
return new Redirect(this.exampleUrl, this.includePattern,
- this.excludePattern, this.redirectUrl,
- this.patternType, this.unescapeMatches,
+ this.redirectUrl, this.patternType,
+ this.excludePattern, this.unescapeMatches,
this.disabled);
},
diff --git a/chrome/content/code/redirector.prototype.js b/chrome/content/code/redirector.prototype.js
index a20a46a..9135e50 100644
--- a/chrome/content/code/redirector.prototype.js
+++ b/chrome/content/code/redirector.prototype.js
@@ -46,10 +46,6 @@ Redirector.prototype = {
}
},
- observe : function(topic, subject, data) {
- dump("HEEEEEEEEEEEEEEEEEEEEE");
- },
-
loadStrings : function() {
var src = 'chrome://redirector/locale/redirector.properties';
var localeService = Cc["@mozilla.org/intl/nslocaleservice;1"].getService(Ci.nsILocaleService);