aboutsummaryrefslogtreecommitdiff
path: root/js/redirect.js
diff options
context:
space:
mode:
authorEinar Egilsson <einar@einaregilsson.com>2019-12-11 13:17:42 +0000
committerEinar Egilsson <einar@einaregilsson.com>2019-12-11 13:17:42 +0000
commitb53d093463e94096f16f0fd7656fc88d642faa3d (patch)
treeef8b1a0b8f07c2ab965a805421e1564622ac814f /js/redirect.js
parentcdb8d5e3d5af6dc2d4d630481c4385734ecc6a1d (diff)
Completely removed angular.js
Diffstat (limited to 'js/redirect.js')
-rw-r--r--js/redirect.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/js/redirect.js b/js/redirect.js
index ac06ff7..3bdf0f0 100644
--- a/js/redirect.js
+++ b/js/redirect.js
@@ -93,9 +93,8 @@ Redirect.prototype = {
redirectTo : '',
toString : function() { return JSON.stringify(this); }
};
- var redirectTo = null;
+ var redirectTo = this._includeMatch(url);
- redirectTo = this._includeMatch(url);
if (redirectTo !== null) {
if (this.disabled && !forceIgnoreDisabled) {
result.isDisabledMatch = true;
@@ -204,6 +203,7 @@ Redirect.prototype = {
},
_init : function(o) {
+ o = o || {};
this.description = o.description || '';
this.exampleUrl = o.exampleUrl || '';
this.exampleResult = o.exampleResult || '';
@@ -212,6 +212,9 @@ Redirect.prototype = {
this.excludePattern = o.excludePattern || '';
this.redirectUrl = o.redirectUrl || '';
this.patternType = o.patternType || Redirect.WILDCARD;
+
+ this.patternTypeText = this.patternType == 'W' ? 'Wildcard' : 'Regular Expression'
+
this.patternDesc = o.patternDesc || '';
this.processMatches = o.processMatches || 'noProcessing';
if (!o.processMatches && o.unescapeMatches) {
@@ -228,7 +231,22 @@ Redirect.prototype = {
this.appliesTo = ['main_frame'];
}
},
+
+ get appliesToText() {
+ return this.appliesTo.map(type => Redirect.requestTypes[type]).join(', ');
+ },
+ get processMatchesExampleText() {
+ let examples = {
+ noProcessing : 'Use matches as they are',
+ urlEncode : 'E.g. turn /bar/foo?x=2 into %2Fbar%2Ffoo%3Fx%3D2',
+ urlDecode : 'E.g. turn %2Fbar%2Ffoo%3Fx%3D2 into /bar/foo?x=2',
+ base64Decode : 'E.g. turn aHR0cDovL2Nubi5jb20= into http://cnn.com'
+ };
+
+ return examples[this.processMatches];
+ },
+
toString : function() {
return JSON.stringify(this.toObject(), null, 2);
},