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,24 +7502,22 @@
return; return;
} }
for (key in Filter.filters) { for (key in Filter.filters) {
value = Filter[key](this); if (value = Filter[key](this)) {
if (value === false) { _ref = Filter.filters[key];
continue; for (_i = 0, _len = _ref.length; _i < _len; _i++) {
} filter = _ref[_i];
_ref = Filter.filters[key]; if (!(result = filter(value, this.isReply))) {
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')) {
continue; continue;
} }
this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub); if (result.hide) {
return; 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);
} }
} }
}, },

View File

@ -7544,24 +7544,22 @@
return; return;
} }
for (key in Filter.filters) { for (key in Filter.filters) {
value = Filter[key](this); if (value = Filter[key](this)) {
if (value === false) { _ref = Filter.filters[key];
continue; for (_i = 0, _len = _ref.length; _i < _len; _i++) {
} filter = _ref[_i];
_ref = Filter.filters[key]; if (!(result = filter(value, this.isReply))) {
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')) {
continue; continue;
} }
this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub); if (result.hide) {
return; 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);
} }
} }
}, },

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'