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;
}
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);
}
}
},

View File

@ -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);
}
}
},

View File

@ -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'