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);
$.add(d.body, qp);
if (board === g.BOARD) {
el = $.id("p" + postID);
}
Get.post(board, threadID, postID, qp, function() {
var bq, img, post;
bq = $('blockquote', qp);
@ -3559,25 +3562,26 @@
return Quotify.node(post);
}
});
if (board === g.BOARD && (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]', this).id.match(/\d+$/)[0];
_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);
$.on(this, 'mouseout click', QuotePreview.mouseout);
if (!el) {
return;
}
if (Conf['Quote Highlighting']) {
if (/\bop\b/.test(el.className)) {
$.addClass(el.parentNode, 'qphl');
} else {
$.addClass(el, 'qphl');
}
}
quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0];
_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) {
var el;

View File

@ -2750,6 +2750,7 @@ QuotePreview =
className: 'reply dialog'
UI.hover e
$.add d.body, qp
el = $.id "p#{postID}" if board is g.BOARD
Get.post board, threadID, postID, qp, ->
bq = $ 'blockquote', qp
Main.prettify bq
@ -2771,18 +2772,20 @@ QuotePreview =
if Conf['Resurrect Quotes']
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 @, '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) ->
UI.hoverend()
if el = $.id @hash[1..]