Filter fixes.
This commit is contained in:
parent
576361aac2
commit
93934566e8
@ -591,6 +591,7 @@
|
|||||||
node: function(post) {
|
node: function(post) {
|
||||||
var Filter, el, firstThread, isOP, key, result, thisThread, value, _i, _len, _ref;
|
var Filter, el, firstThread, isOP, key, result, thisThread, value, _i, _len, _ref;
|
||||||
if (post.isInlined) return;
|
if (post.isInlined) return;
|
||||||
|
isOP = post.isOP, el = post.el;
|
||||||
for (key in filter.filters) {
|
for (key in filter.filters) {
|
||||||
value = filter[key](post);
|
value = filter[key](post);
|
||||||
if (value === false) continue;
|
if (value === false) continue;
|
||||||
@ -598,7 +599,6 @@
|
|||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
Filter = _ref[_i];
|
Filter = _ref[_i];
|
||||||
if (!(result = Filter(value, isOP))) continue;
|
if (!(result = Filter(value, isOP))) continue;
|
||||||
isOP = post.isOP, el = post.el;
|
|
||||||
if (result === true) {
|
if (result === true) {
|
||||||
if (isOP) {
|
if (isOP) {
|
||||||
if (!g.REPLY) {
|
if (!g.REPLY) {
|
||||||
@ -655,7 +655,7 @@
|
|||||||
comment: function(post) {
|
comment: function(post) {
|
||||||
var data, i, nodes, text, _ref;
|
var data, i, nodes, text, _ref;
|
||||||
text = [];
|
text = [];
|
||||||
nodes = d.evaluate('.//br|.//text()', post.bq, null, 7, null);
|
nodes = d.evaluate('.//br|.//text()', post.el.lastChild, null, 7, null);
|
||||||
for (i = 0, _ref = nodes.snapshotLength; 0 <= _ref ? i < _ref : i > _ref; 0 <= _ref ? i++ : i--) {
|
for (i = 0, _ref = nodes.snapshotLength; 0 <= _ref ? i < _ref : i > _ref; 0 <= _ref ? i++ : i--) {
|
||||||
text.push((data = nodes.snapshotItem(i).data) ? data : '\n');
|
text.push((data = nodes.snapshotItem(i).data) ? data : '\n');
|
||||||
}
|
}
|
||||||
@ -3849,7 +3849,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$.id('navtopr')) return;
|
if (!$.id('navtopr')) return;
|
||||||
$.addClass(d.body, "chanx_" + (VERSION.match(/\.(\d+)/)[1]));
|
$.addClass(d.body, "chanx_" + (VERSION.split('.')[1]));
|
||||||
$.addClass(d.body, engine);
|
$.addClass(d.body, engine);
|
||||||
_ref = ['navtop', 'navbot'];
|
_ref = ['navtop', 'navbot'];
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
@ -3924,8 +3924,7 @@
|
|||||||
filesize: $('.filesize', node),
|
filesize: $('.filesize', node),
|
||||||
img: $('img[md5]', node),
|
img: $('img[md5]', node),
|
||||||
quotes: $$('.quotelink', node),
|
quotes: $$('.quotelink', node),
|
||||||
backlinks: $$('.backlink', node),
|
backlinks: $$('.backlink', node)
|
||||||
bq: node.lastChild
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_ref = g.callbacks;
|
_ref = g.callbacks;
|
||||||
|
|||||||
@ -516,6 +516,7 @@ filter =
|
|||||||
|
|
||||||
node: (post) ->
|
node: (post) ->
|
||||||
return if post.isInlined
|
return if post.isInlined
|
||||||
|
{isOP, el} = post
|
||||||
for key of filter.filters
|
for key of filter.filters
|
||||||
value = filter[key] post
|
value = filter[key] post
|
||||||
if value is false
|
if value is false
|
||||||
@ -524,7 +525,6 @@ filter =
|
|||||||
for Filter in filter.filters[key]
|
for Filter in filter.filters[key]
|
||||||
unless result = Filter value, isOP
|
unless result = Filter value, isOP
|
||||||
continue
|
continue
|
||||||
{isOP, el} = post
|
|
||||||
|
|
||||||
# Hide
|
# Hide
|
||||||
if result is true
|
if result is true
|
||||||
@ -570,7 +570,7 @@ filter =
|
|||||||
comment: (post) ->
|
comment: (post) ->
|
||||||
text = []
|
text = []
|
||||||
# XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE is 7
|
# XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE is 7
|
||||||
nodes = d.evaluate './/br|.//text()', post.bq, null, 7, null
|
nodes = d.evaluate './/br|.//text()', post.el.lastChild, null, 7, null
|
||||||
for i in [0...nodes.snapshotLength]
|
for i in [0...nodes.snapshotLength]
|
||||||
text.push if data = nodes.snapshotItem(i).data then data else '\n'
|
text.push if data = nodes.snapshotItem(i).data then data else '\n'
|
||||||
text.join ''
|
text.join ''
|
||||||
@ -3139,7 +3139,7 @@ Main =
|
|||||||
return
|
return
|
||||||
if not $.id 'navtopr'
|
if not $.id 'navtopr'
|
||||||
return
|
return
|
||||||
$.addClass d.body, "chanx_#{VERSION.match(/\.(\d+)/)[1]}"
|
$.addClass d.body, "chanx_#{VERSION.split('.')[1]}"
|
||||||
$.addClass d.body, engine
|
$.addClass d.body, engine
|
||||||
for nav in ['navtop', 'navbot']
|
for nav in ['navtop', 'navbot']
|
||||||
$.addClass $("a[href$='/#{g.BOARD}/']", $.id nav), 'current'
|
$.addClass $("a[href$='/#{g.BOARD}/']", $.id nav), 'current'
|
||||||
@ -3232,7 +3232,6 @@ Main =
|
|||||||
img: $ 'img[md5]', node
|
img: $ 'img[md5]', node
|
||||||
quotes: $$ '.quotelink', node
|
quotes: $$ '.quotelink', node
|
||||||
backlinks: $$ '.backlink', node
|
backlinks: $$ '.backlink', node
|
||||||
bq: node.lastChild
|
|
||||||
for callback in g.callbacks
|
for callback in g.callbacks
|
||||||
try
|
try
|
||||||
callback post for post in posts
|
callback post for post in posts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user