From 14c86c9676cd02a61c0a2d1254ea1843d7713473 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Mon, 29 Aug 2011 15:40:18 +0200 Subject: Very rough draft of html settings --- chrome/code/redirect.js | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'chrome/code/redirect.js') diff --git a/chrome/code/redirect.js b/chrome/code/redirect.js index 5b977d0..8b0b1d2 100644 --- a/chrome/code/redirect.js +++ b/chrome/code/redirect.js @@ -41,10 +41,7 @@ Redirect.prototype = { //Functions clone : function() { - return new Redirect(this.exampleUrl, this.includePattern, - this.redirectUrl, this.patternType, - this.excludePattern, this.unescapeMatches, - this.disabled); + return new Redirect().fromObject(this.toObject()); }, compile : function() { @@ -68,6 +65,7 @@ Redirect.prototype = { for (var prop in o) { this[prop] = o[prop]; } + return this; }, copyValues : function(other) { @@ -80,17 +78,6 @@ Redirect.prototype = { this.disabled = other.disabled; }, - deserialize : function(str) { - if (!str || !str.split) { - throw Error("Invalid serialized redirect: " + str); - } - var parts = str.split(',,,'); - if (parts.length < 5) { - throw Error("Invalid serialized redirect, too few fields: " + str); - } - this._init.apply(this, parts); - }, - equals : function(redirect) { return this.exampleUrl == redirect.exampleUrl && this.includePattern == redirect.includePattern @@ -137,16 +124,6 @@ Redirect.prototype = { return this.patternType == Redirect.WILDCARD; }, - serialize : function() { - return [ this.exampleUrl - , this.includePattern - , this.redirectUrl - , this.patternType - , this.excludePattern - , this.unescapeMatches - , this.disabled ].join(',,,'); - }, - test : function() { return this.getMatch(this.exampleUrl); }, -- cgit v1.2.3-70-g09d2