Fix Quote Highlighing getting inside the Quote Preview.

This commit is contained in:
Nicolas Stepien 2012-06-17 00:10:36 +02:00
parent 5ccd7e731e
commit d1d949cd7d
2 changed files with 34 additions and 27 deletions

View File

@ -3530,6 +3530,9 @@
}); });
UI.hover(e); UI.hover(e);
$.add(d.body, qp); $.add(d.body, qp);
if (board === g.BOARD) {
el = $.id("p" + postID);
}
Get.post(board, threadID, postID, qp, function() { Get.post(board, threadID, postID, qp, function() {
var bq, img, post; var bq, img, post;
bq = $('blockquote', qp); bq = $('blockquote', qp);
@ -3559,25 +3562,26 @@
return Quotify.node(post); return Quotify.node(post);
} }
}); });
if (board === g.BOARD && (el = $.id("p" + postID))) { $.on(this, 'mousemove', UI.hover);
if (Conf['Quote Highlighting']) { $.on(this, 'mouseout click', QuotePreview.mouseout);
if (/\bop\b/.test(el.className)) { if (!el) {
$.addClass(el.parentNode, 'qphl'); return;
} else { }
$.addClass(el, 'qphl'); if (Conf['Quote Highlighting']) {
} if (/\bop\b/.test(el.className)) {
} $.addClass(el.parentNode, 'qphl');
quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; } else {
_ref = $$('.quotelink, .backlink', qp); $.addClass(el, 'qphl');
for (_i = 0, _len = _ref.length; _i < _len; _i++) { }
quote = _ref[_i]; }
if (quote.hash.slice(2) === quoterID) { quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0];
$.addClass(quote, 'forwardlink'); _ref = $$('.quotelink, .backlink', qp);
} for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.hash.slice(2) === quoterID) {
$.addClass(quote, 'forwardlink');
} }
} }
$.on(this, 'mousemove', UI.hover);
return $.on(this, 'mouseout click', QuotePreview.mouseout);
}, },
mouseout: function(e) { mouseout: function(e) {
var el; var el;

View File

@ -2750,6 +2750,7 @@ QuotePreview =
className: 'reply dialog' className: 'reply dialog'
UI.hover e UI.hover e
$.add d.body, qp $.add d.body, qp
el = $.id "p#{postID}" if board is g.BOARD
Get.post board, threadID, postID, qp, -> Get.post board, threadID, postID, qp, ->
bq = $ 'blockquote', qp bq = $ 'blockquote', qp
Main.prettify bq Main.prettify bq
@ -2771,18 +2772,20 @@ QuotePreview =
if Conf['Resurrect Quotes'] if Conf['Resurrect Quotes']
Quotify.node post Quotify.node post
if board is g.BOARD and el = $.id "p#{postID}"
if Conf['Quote Highlighting']
if /\bop\b/.test el.className
$.addClass el.parentNode, 'qphl'
else
$.addClass el, 'qphl'
quoterID = $.x('ancestor::*[@id][1]', @).id.match(/\d+$/)[0]
for quote in $$ '.quotelink, .backlink', qp
if quote.hash[2..] is quoterID
$.addClass quote, 'forwardlink'
$.on @, 'mousemove', UI.hover $.on @, 'mousemove', UI.hover
$.on @, 'mouseout click', QuotePreview.mouseout $.on @, 'mouseout click', QuotePreview.mouseout
return unless el
if Conf['Quote Highlighting']
if /\bop\b/.test el.className
$.addClass el.parentNode, 'qphl'
else
$.addClass el, 'qphl'
quoterID = $.x('ancestor::*[@id][1]', @).id.match(/\d+$/)[0]
for quote in $$ '.quotelink, .backlink', qp
if quote.hash[2..] is quoterID
$.addClass quote, 'forwardlink'
return
mouseout: (e) -> mouseout: (e) ->
UI.hoverend() UI.hoverend()
if el = $.id @hash[1..] if el = $.id @hash[1..]