Ugh. Fix OP Quote Highlighting.

This commit is contained in:
Nicolas Stepien 2012-05-13 16:21:16 +02:00
parent 070816de06
commit 1d517d6bec
2 changed files with 40 additions and 6 deletions

View File

@ -3123,7 +3123,11 @@
var clonePost, el, i, inline, pathname, root;
root = $.x('ancestor::*[parent::blockquote]', q);
if (el = $.id("p" + id)) {
$.removeClass(el, 'qphl');
if (/\bop\b/.test(el.className)) {
$.removeClass(el.parentNode, 'qphl');
} else {
$.removeClass(el, 'qphl');
}
clonePost = QuoteInline.clone(id, el);
if (/\bbacklink\b/.test(q.className)) {
$.after(q.parentNode, clonePost);
@ -3250,7 +3254,11 @@
if (el = $.id("p" + id)) {
qp.innerHTML = el.innerHTML;
if (Conf['Quote Highlighting']) {
$.addClass(el, 'qphl');
if (/\bop\b/.test(el.className)) {
$.addClass(el.parentNode, 'qphl');
} else {
$.addClass(el, 'qphl');
}
}
replyID = $.x('ancestor::div[contains(@class,"postContainer")]', this).id.slice(2);
_ref = $$('.quotelink, .backlink', qp);
@ -3274,7 +3282,11 @@
var el;
UI.hoverend();
if (el = $.id(this.hash.slice(1))) {
$.removeClass(el, 'qphl');
if (/\bop\b/.test(el.className)) {
$.removeClass(el.parentNode, 'qphl');
} else {
$.removeClass(el, 'qphl');
}
}
$.off(this, 'mousemove', UI.hover);
return $.off(this, 'mouseout click', QuotePreview.mouseout);
@ -4538,6 +4550,12 @@ textarea.field {\
.qphl {\
outline: 2px solid rgba(216, 94, 49, .7);\
}\
.qphl.opContainer {\
outline-offset: -2px;\
}\
div.opContainer {\
display: block !important;\
}\
.inlined {\
opacity: .5;\
}\

View File

@ -2406,7 +2406,10 @@ QuoteInline =
add: (q, id) ->
root = $.x 'ancestor::*[parent::blockquote]', q
if el = $.id "p#{id}"
$.removeClass el, 'qphl'
if /\bop\b/.test el.className
$.removeClass el.parentNode, 'qphl'
else
$.removeClass el, 'qphl'
clonePost = QuoteInline.clone id, el
if /\bbacklink\b/.test q.className
$.after q.parentNode, clonePost
@ -2492,7 +2495,11 @@ QuotePreview =
id = @hash[2..]
if el = $.id "p#{id}"
qp.innerHTML = el.innerHTML
$.addClass el, 'qphl' if Conf['Quote Highlighting']
if Conf['Quote Highlighting']
if /\bop\b/.test el.className
$.addClass el.parentNode, 'qphl'
else
$.addClass el, 'qphl'
replyID = $.x('ancestor::div[contains(@class,"postContainer")]', @).id[2..]
for quote in $$ '.quotelink, .backlink', qp
if quote.hash[2..] is replyID
@ -2506,7 +2513,10 @@ QuotePreview =
mouseout: ->
UI.hoverend()
if el = $.id @hash[1..]
$.removeClass el, 'qphl'
if /\bop\b/.test el.className
$.removeClass el.parentNode, 'qphl'
else
$.removeClass el, 'qphl'
$.off @, 'mousemove', UI.hover
$.off @, 'mouseout click', QuotePreview.mouseout
parse: (req, id) ->
@ -3555,6 +3565,12 @@ textarea.field {
.qphl {
outline: 2px solid rgba(216, 94, 49, .7);
}
.qphl.opContainer {
outline-offset: -2px;
}
div.opContainer {
display: block !important;
}
.inlined {
opacity: .5;
}