From 97631f0a8a17ad72ecd5cbdd4a5ece5dfaa3815a Mon Sep 17 00:00:00 2001 From: Gokulakrishna Date: Wed, 16 May 2018 19:15:38 +0530 Subject: Added patternDesc field to prototype and initialization --- js/redirect.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/redirect.js') diff --git a/js/redirect.js b/js/redirect.js index 83681fc..3b772b8 100644 --- a/js/redirect.js +++ b/js/redirect.js @@ -33,6 +33,7 @@ Redirect.prototype = { error : null, includePattern : '', excludePattern : '', + patternDesc:'', redirectUrl : '', patternType : '', processMatches : 'noProcessing', @@ -56,6 +57,7 @@ Redirect.prototype = { && this.exampleUrl == redirect.exampleUrl && this.includePattern == redirect.includePattern && this.excludePattern == redirect.excludePattern + && this.patternDesc == redirect.patternDesc && this.redirectUrl == redirect.redirectUrl && this.patternType == redirect.patternType && this.processMatches == redirect.processMatches @@ -70,6 +72,7 @@ Redirect.prototype = { error : this.error, includePattern : this.includePattern, excludePattern : this.excludePattern, + patternDesc : this.patternDesc, redirectUrl : this.redirectUrl, patternType : this.patternType, processMatches : this.processMatches, @@ -208,6 +211,7 @@ Redirect.prototype = { this.excludePattern = o.excludePattern || ''; this.redirectUrl = o.redirectUrl || ''; this.patternType = o.patternType || Redirect.WILDCARD; + this.patternDesc = o.patternDesc || ''; this.processMatches = o.processMatches || 'noProcessing'; if (!o.processMatches && o.unescapeMatches) { this.processMatches = 'urlDecode'; -- cgit v1.2.3 From 7490d7adee1d7f938ee92f743c8d17f87e554848 Mon Sep 17 00:00:00 2001 From: Gokulakrishna Date: Fri, 18 May 2018 22:47:29 +0530 Subject: Fix #115 responsive images type in Firefox --- js/controllers/editredirect.js | 2 +- js/redirect.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'js/redirect.js') diff --git a/js/controllers/editredirect.js b/js/controllers/editredirect.js index 811c92d..216581d 100644 --- a/js/controllers/editredirect.js +++ b/js/controllers/editredirect.js @@ -66,7 +66,7 @@ redirectorApp.controller('EditRedirectCtrl', ['$scope', function($s) { arr.splice(index, 1); } - var order = 'main_frame,sub_frame,stylesheet,script,image,object,xmlhttprequest,other'; + var order = 'main_frame,sub_frame,stylesheet,script,image,imageset,object,xmlhttprequest,other'; arr.sort(function(a,b) { return order.indexOf(a) - order.indexOf(b); diff --git a/js/redirect.js b/js/redirect.js index 3b772b8..75f000d 100644 --- a/js/redirect.js +++ b/js/redirect.js @@ -18,6 +18,7 @@ Redirect.requestTypes = { stylesheet : "Stylesheets", script : "Scripts", image : "Images", + imageset: "Responsive Images in Firefox", object : "Objects (e.g. Flash videos, Java applets)", xmlhttprequest : "XMLHttpRequests (Ajax)", other : "Other" -- cgit v1.2.3 From 1e351b9a7c5d7aa4c1dd65ba3f3ef3b45ac5689a Mon Sep 17 00:00:00 2001 From: Gokulakrishna Date: Mon, 28 May 2018 15:13:33 +0530 Subject: For ExcludeMatch, switched regex.exec to regex.test As per Mozilla documentation, regex test() is faster than exec(). For ExcludeMatch, we just need to see true or false, that can be done faster with test() for large exclude patterns. --- js/redirect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/redirect.js') diff --git a/js/redirect.js b/js/redirect.js index 75f000d..ac06ff7 100644 --- a/js/redirect.js +++ b/js/redirect.js @@ -266,7 +266,7 @@ Redirect.prototype = { if (!this._rxExclude) { return false; } - var shouldExclude = !!this._rxExclude.exec(url); + var shouldExclude = this._rxExclude.test(url); this._rxExclude.lastIndex = 0; return shouldExclude; } -- cgit v1.2.3