From 653a7e96fa34f58eaf1d2585e94d9b9bce7386d2 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Mon, 12 Jan 2015 23:38:37 -0700 Subject: [PATCH] coffeescript syntax --- builds/appchan-x.user.js | 28 +++++++++++++--------------- builds/crx/script.js | 28 +++++++++++++--------------- src/Filtering/Filter.coffee | 9 ++------- 3 files changed, 28 insertions(+), 37 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 34672f909..244d7b252 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -7502,24 +7502,22 @@ return; } for (key in Filter.filters) { - value = Filter[key](this); - if (value === false) { - continue; - } - _ref = Filter.filters[key]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - filter = _ref[_i]; - if (!(result = filter(value, this.isReply))) { - continue; - } - if (result.hide) { - if (!(this.isReply || g.VIEW === 'index')) { + if (value = Filter[key](this)) { + _ref = Filter.filters[key]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + filter = _ref[_i]; + if (!(result = filter(value, this.isReply))) { continue; } - this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub); - return; + if (result.hide) { + if (!(this.isReply || g.VIEW === 'index')) { + continue; + } + this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub); + return; + } + this.highlight("Highlighted by filtering the " + key + ": " + result.match, result["class"], result.top); } - this.highlight("Highlighted by filtering the " + key + ": " + result.match, result["class"], result.top); } } }, diff --git a/builds/crx/script.js b/builds/crx/script.js index a21954ca5..5a175427d 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -7544,24 +7544,22 @@ return; } for (key in Filter.filters) { - value = Filter[key](this); - if (value === false) { - continue; - } - _ref = Filter.filters[key]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - filter = _ref[_i]; - if (!(result = filter(value, this.isReply))) { - continue; - } - if (result.hide) { - if (!(this.isReply || g.VIEW === 'index')) { + if (value = Filter[key](this)) { + _ref = Filter.filters[key]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + filter = _ref[_i]; + if (!(result = filter(value, this.isReply))) { continue; } - this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub); - return; + if (result.hide) { + if (!(this.isReply || g.VIEW === 'index')) { + continue; + } + this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub); + return; + } + this.highlight("Highlighted by filtering the " + key + ": " + result.match, result["class"], result.top); } - this.highlight("Highlighted by filtering the " + key + ": " + result.match, result["class"], result.top); } } }, diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index e7bcd4808..bc727066f 100755 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -93,15 +93,10 @@ Filter = node: -> return if @isClone or @isFetchedQuote - for key of Filter.filters - value = Filter[key] @ + for key of Filter.filters when value = Filter[key] @ # Continue if there's nothing to filter (no tripcode for example). - continue if value is false - - for filter in Filter.filters[key] - unless result = filter value, @isReply - continue + for filter in Filter.filters[key] when result = filter value, @isReply # Hide if result.hide continue unless @isReply or g.VIEW is 'index'