diff options
author | papush | 2025-10-22 19:07:48 +0200 |
---|---|---|
committer | papush | 2025-10-22 19:07:48 +0200 |
commit | af4010e8bdd9aa1735af2f12e2875770379d82c4 (patch) | |
tree | 3095a9f100c9c74b1f04216f889d3aca15130856 /chrome/js/redirect.js | |
parent | 4d08f9c36f4f510b59961ba77bdb083acc2c784e (diff) |
Diffstat (limited to 'chrome/js/redirect.js')
-rw-r--r-- | chrome/js/redirect.js | 13 |
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 |