Preview the OP too.

This commit is contained in:
Nicolas Stepien 2011-05-08 02:33:47 +02:00
parent 987b77bb60
commit 8947d62dec
2 changed files with 31 additions and 30 deletions

View File

@ -1240,18 +1240,20 @@
} }
$.append(op, node); $.append(op, node);
op.id = $('input[name]', op).name; op.id = $('input[name]', op).name;
node = op; if (!g.REPLY) {
div = $.el('div', { node = op;
className: 'thread' div = $.el('div', {
}); className: 'thread'
$.before(node, div); });
while (node.nodeName !== 'HR') { $.before(node, div);
$.append(div, node); while (node.nodeName !== 'HR') {
node = div.nextSibling; $.append(div, node);
} node = div.nextSibling;
node = node.nextElementSibling; }
if (!(node.align || node.nodeName === 'CENTER')) { node = node.nextElementSibling;
return threading.thread(node); if (!(node.align || node.nodeName === 'CENTER')) {
return threading.thread(node);
}
} }
}, },
stopPropagation: function(e) { stopPropagation: function(e) {
@ -1707,8 +1709,7 @@
var clientX, clientY, id, preview, target; var clientX, clientY, id, preview, target;
target = e.target, clientX = e.clientX, clientY = e.clientY; target = e.target, clientX = e.clientX, clientY = e.clientY;
preview = $('#qp'); preview = $('#qp');
id = target.textContent; id = target.textContent.replace(">>", '');
id = id.replace(">>", '');
preview.innerHTML = d.getElementById(id).innerHTML; preview.innerHTML = d.getElementById(id).innerHTML;
$.show(preview); $.show(preview);
$.bind(target, 'mousemove', quotePreview.mousemove); $.bind(target, 'mousemove', quotePreview.mousemove);
@ -2238,6 +2239,7 @@
if ($.config('Keybinds')) { if ($.config('Keybinds')) {
keybinds.init(); keybinds.init();
} }
threading.init();
if (g.REPLY) { if (g.REPLY) {
if ($.config('Thread Updater')) { if ($.config('Thread Updater')) {
updater.init(); updater.init();
@ -2258,7 +2260,6 @@
watcher.watch(null, g.THREAD_ID); watcher.watch(null, g.THREAD_ID);
} }
} else { } else {
threading.init();
if ($.config('Thread Hiding')) { if ($.config('Thread Hiding')) {
threadHiding.init(); threadHiding.init();
} }

View File

@ -966,20 +966,21 @@ threading =
$.append op, node #add the blockquote $.append op, node #add the blockquote
op.id = $('input[name]', op).name op.id = $('input[name]', op).name
node = op unless g.REPLY
node = op
div = $.el 'div', div = $.el 'div',
className: 'thread' className: 'thread'
$.before node, div $.before node, div
while node.nodeName isnt 'HR' while node.nodeName isnt 'HR'
$.append div, node $.append div, node
node = div.nextSibling node = div.nextSibling
node = node.nextElementSibling #skip text node node = node.nextElementSibling #skip text node
#{N,}SFW #{N,}SFW
unless node.align or node.nodeName is 'CENTER' unless node.align or node.nodeName is 'CENTER'
threading.thread node threading.thread node
stopPropagation: (e) -> stopPropagation: (e) ->
e.stopPropagation() e.stopPropagation()
@ -1329,8 +1330,7 @@ quotePreview =
mouseover: (e) -> mouseover: (e) ->
{target, clientX, clientY} = e {target, clientX, clientY} = e
preview = $ '#qp' preview = $ '#qp'
id = target.textContent id = target.textContent.replace ">>", ''
id = id.replace ">>", ''
preview.innerHTML = d.getElementById(id).innerHTML preview.innerHTML = d.getElementById(id).innerHTML
$.show preview $.show preview
$.bind target, 'mousemove', quotePreview.mousemove $.bind target, 'mousemove', quotePreview.mousemove
@ -1724,6 +1724,8 @@ main =
if $.config 'Keybinds' if $.config 'Keybinds'
keybinds.init() keybinds.init()
threading.init()
if g.REPLY if g.REPLY
if $.config 'Thread Updater' if $.config 'Thread Updater'
updater.init() updater.init()
@ -1745,8 +1747,6 @@ main =
watcher.watch null, g.THREAD_ID watcher.watch null, g.THREAD_ID
else #not reply else #not reply
threading.init()
if $.config 'Thread Hiding' if $.config 'Thread Hiding'
threadHiding.init() threadHiding.init()