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

View File

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