You can specify a highlight class. Defaults to filter_highlight.
This commit is contained in:
parent
31eea0a7bd
commit
70cee9ca8b
@ -534,7 +534,7 @@
|
|||||||
filter = {
|
filter = {
|
||||||
filters: {},
|
filters: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
var boards, filter, hl, key, op, regexp, _i, _len, _ref, _ref2, _ref3;
|
var boards, filter, hl, key, op, regexp, _i, _len, _ref, _ref2, _ref3, _ref4;
|
||||||
for (key in config.filter) {
|
for (key in config.filter) {
|
||||||
this.filters[key] = [];
|
this.filters[key] = [];
|
||||||
_ref = conf[key].split('\n');
|
_ref = conf[key].split('\n');
|
||||||
@ -554,7 +554,9 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
op = ((_ref3 = filter.match(/op:(yes|no|only)/)) != null ? _ref3[1].toLowerCase() : void 0) || 'no';
|
op = ((_ref3 = filter.match(/op:(yes|no|only)/)) != null ? _ref3[1].toLowerCase() : void 0) || 'no';
|
||||||
hl = /highlight/.test(filter);
|
if (hl = /highlight/.test(filter)) {
|
||||||
|
hl = ((_ref4 = filter.match(/highlight:(\w+)/)) != null ? _ref4[1].toLowerCase() : void 0) || 'filter_highlight';
|
||||||
|
}
|
||||||
this.filters[key].push(this.createFilter(regexp, op, hl));
|
this.filters[key].push(this.createFilter(regexp, op, hl));
|
||||||
}
|
}
|
||||||
if (!this.filters[key].length) delete this.filters[key];
|
if (!this.filters[key].length) delete this.filters[key];
|
||||||
@ -566,7 +568,7 @@
|
|||||||
if (isOP && op === 'no' || !isOP && op === 'only') return false;
|
if (isOP && op === 'no' || !isOP && op === 'only') return false;
|
||||||
if (!regexp.test(value)) return false;
|
if (!regexp.test(value)) return false;
|
||||||
if (hl) {
|
if (hl) {
|
||||||
$.addClass(root, 'filter_highlight');
|
$.addClass(root, hl);
|
||||||
} else if (isOP) {
|
} else if (isOP) {
|
||||||
if (!g.REPLY) threadHiding.hideHide(root.parentNode);
|
if (!g.REPLY) threadHiding.hideHide(root.parentNode);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -441,8 +441,10 @@ filter =
|
|||||||
op = filter.match(/op:(yes|no|only)/)?[1].toLowerCase() or 'no'
|
op = filter.match(/op:(yes|no|only)/)?[1].toLowerCase() or 'no'
|
||||||
|
|
||||||
# Highlight the post, or hide it.
|
# Highlight the post, or hide it.
|
||||||
|
# If not specified, the highlight class will be filter_highlight.
|
||||||
# Defaults to post hiding.
|
# Defaults to post hiding.
|
||||||
hl = /highlight/.test filter
|
if hl = /highlight/.test filter
|
||||||
|
hl = filter.match(/highlight:(\w+)/)?[1].toLowerCase() or 'filter_highlight'
|
||||||
|
|
||||||
@filters[key].push @createFilter regexp, op, hl
|
@filters[key].push @createFilter regexp, op, hl
|
||||||
|
|
||||||
@ -460,7 +462,7 @@ filter =
|
|||||||
unless regexp.test value
|
unless regexp.test value
|
||||||
return false
|
return false
|
||||||
if hl
|
if hl
|
||||||
$.addClass root, 'filter_highlight'
|
$.addClass root, hl
|
||||||
else if isOP
|
else if isOP
|
||||||
unless g.REPLY
|
unless g.REPLY
|
||||||
threadHiding.hideHide root.parentNode
|
threadHiding.hideHide root.parentNode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user