aboutsummaryrefslogtreecommitdiff
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/js/redirect.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/js/redirect.js b/chrome/js/redirect.js
index 756ae15..bedacf0 100644
--- a/chrome/js/redirect.js
+++ b/chrome/js/redirect.js
@@ -1,8 +1,8 @@
var EXPORTED_SYMBOLS = ['Redirect'];
-function Redirect(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, escapeMatches, disabled) {
- this._init(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, escapeMatches, disabled);
+function Redirect(description, exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, escapeMatches, disabled) {
+ this._init(description, exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, escapeMatches, disabled);
}
//Static
@@ -51,6 +51,7 @@ Redirect.prototype = {
toObject : function() {
return {
+ description : this.description,
exampleUrl : this.exampleUrl,
includePattern : this.includePattern,
excludePattern : this.excludePattern,
@@ -70,6 +71,7 @@ Redirect.prototype = {
},
copyValues : function(other) {
+ this.description = other.description;
this.exampleUrl = other.exampleUrl;
this.includePattern = other.includePattern;
this.excludePattern = other.excludePattern;
@@ -81,7 +83,8 @@ Redirect.prototype = {
},
equals : function(redirect) {
- return this.exampleUrl == redirect.exampleUrl
+ return this.description == redirect.description
+ && this.exampleUrl == redirect.exampleUrl
&& this.includePattern == redirect.includePattern
&& this.excludePattern == redirect.excludePattern
&& this.redirectUrl == redirect.redirectUrl
@@ -168,7 +171,8 @@ Redirect.prototype = {
return new RegExp(this._preparePattern(pattern),"gi");
},
- _init : function(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, escapeMatches, disabled) {
+ _init : function(description, exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, escapeMatches, disabled) {
+ this.description = description || '';
this.exampleUrl = exampleUrl || '';
this.includePattern = includePattern || '';
this.excludePattern = excludePattern || '';
@@ -181,6 +185,7 @@ Redirect.prototype = {
toString : function() {
return 'REDIRECT: {'
+ + '\n\tDescription : ' + this.description
+ '\n\tExample url : ' + this.exampleUrl
+ '\n\tInclude pattern : ' + this.includePattern
+ '\n\tExclude pattern : ' + this.excludePattern