Fix post.id in Main.preParse for inlined quotes.

This commit is contained in:
Nicolas Stepien 2012-03-05 05:02:10 +01:00
parent 1e4cb0457d
commit 46c908bdbf
2 changed files with 14 additions and 17 deletions

View File

@ -3932,12 +3932,13 @@
}
},
preParse: function(node) {
var klass, post;
var klass;
klass = node.className;
post = {
return {
root: node,
el: klass === 'op' ? node : node.firstChild.firstChild.lastChild,
"class": klass,
id: $('input', node).name,
threadId: g.THREAD_ID || $.x('ancestor::div[contains(@class,"thread")]', node).firstChild.id,
isOP: klass === 'op',
isInlined: /\binline\b/.test(klass),
@ -3946,8 +3947,6 @@
quotes: $$('.quotelink', node),
backlinks: $$('.backlink', node)
};
post.id = post.el.id;
return post;
},
node: function(nodes, notify) {
var callback, node, _i, _j, _len, _len2, _ref;

View File

@ -3240,19 +3240,17 @@ Main =
preParse: (node) ->
klass = node.className
post =
root: node
el: if klass is 'op' then node else node.firstChild.firstChild.lastChild
class: klass
threadId: g.THREAD_ID or $.x('ancestor::div[contains(@class,"thread")]', node).firstChild.id
isOP: klass is 'op'
isInlined: /\binline\b/.test klass
filesize: $ '.filesize', node
img: $ 'img[md5]', node
quotes: $$ '.quotelink', node
backlinks: $$ '.backlink', node
post.id = post.el.id
post
root: node
el: if klass is 'op' then node else node.firstChild.firstChild.lastChild
class: klass
id: $('input', node).name
threadId: g.THREAD_ID or $.x('ancestor::div[contains(@class,"thread")]', node).firstChild.id
isOP: klass is 'op'
isInlined: /\binline\b/.test klass
filesize: $ '.filesize', node
img: $ 'img[md5]', node
quotes: $$ '.quotelink', node
backlinks: $$ '.backlink', node
node: (nodes, notify) ->
for callback in g.callbacks
try