coffeescript syntax

This commit is contained in:
Zixaphir 2015-01-12 23:38:37 -07:00
parent 7b5f19ec81
commit 653a7e96fa
3 changed files with 28 additions and 37 deletions

View File

@ -7502,10 +7502,7 @@
return; return;
} }
for (key in Filter.filters) { for (key in Filter.filters) {
value = Filter[key](this); if (value = Filter[key](this)) {
if (value === false) {
continue;
}
_ref = Filter.filters[key]; _ref = Filter.filters[key];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
filter = _ref[_i]; filter = _ref[_i];
@ -7522,6 +7519,7 @@
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);
} }
} }
}
}, },
stringTest: function(string, value) { stringTest: function(string, value) {
return string === value; return string === value;

View File

@ -7544,10 +7544,7 @@
return; return;
} }
for (key in Filter.filters) { for (key in Filter.filters) {
value = Filter[key](this); if (value = Filter[key](this)) {
if (value === false) {
continue;
}
_ref = Filter.filters[key]; _ref = Filter.filters[key];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
filter = _ref[_i]; filter = _ref[_i];
@ -7564,6 +7561,7 @@
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);
} }
} }
}
}, },
stringTest: function(string, value) { stringTest: function(string, value) {
return string === value; return string === value;

View File

@ -93,15 +93,10 @@ Filter =
node: -> node: ->
return if @isClone or @isFetchedQuote return if @isClone or @isFetchedQuote
for key of Filter.filters for key of Filter.filters when value = Filter[key] @
value = Filter[key] @
# Continue if there's nothing to filter (no tripcode for example). # 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 # Hide
if result.hide if result.hide
continue unless @isReply or g.VIEW is 'index' continue unless @isReply or g.VIEW is 'index'