Add the forwardlink class to backlinks too.

This commit is contained in:
Nicolas Stepien 2012-03-26 04:37:05 +02:00
parent d03d6e9db6
commit cd8326a9c5
2 changed files with 22 additions and 17 deletions

View File

@ -3231,7 +3231,7 @@
} }
}, },
mouseover: function(e) { mouseover: function(e) {
var el, id, qp, quote, replyID, threadID, _i, _len, _ref; var el, id, node, qp, quote, replyID, threadID, _i, _len, _ref;
if (/\binlined\b/.test(this.className)) return; if (/\binlined\b/.test(this.className)) return;
qp = UI.el = $.el('div', { qp = UI.el = $.el('div', {
id: 'qp', id: 'qp',
@ -3242,14 +3242,13 @@
if (el = $.id(id)) { if (el = $.id(id)) {
qp.innerHTML = el.innerHTML; qp.innerHTML = el.innerHTML;
if (Conf['Quote Highlighting']) $.addClass(el, 'qphl'); if (Conf['Quote Highlighting']) $.addClass(el, 'qphl');
if (/\bbacklink\b/.test(this.className)) { node = /\bbacklink\b/.test(this.className) ? this.parentNode : $.x('ancestor::blockquote', this);
replyID = $.x('preceding-sibling::input', this.parentNode).name; replyID = $.x('preceding-sibling::input', node).name;
_ref = $$('.quotelink', qp); _ref = $$('.quotelink, .backlink', qp);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i]; quote = _ref[_i];
if (quote.hash.slice(1) === replyID) $.addClass(quote, 'forwardlink'); if (quote.hash.slice(1) === replyID) $.addClass(quote, 'forwardlink');
} }
}
} else { } else {
qp.textContent = "Loading " + id + "..."; qp.textContent = "Loading " + id + "...";
threadID = this.pathname.split('/').pop() || $.x('ancestor::div[@class="thread"]', this).firstChild.id; threadID = this.pathname.split('/').pop() || $.x('ancestor::div[@class="thread"]', this).firstChild.id;
@ -4427,8 +4426,9 @@ input ~ a > img[md5] {\
.filtered {\ .filtered {\
text-decoration: line-through;\ text-decoration: line-through;\
}\ }\
.quotelink.forwardlink {\ .quotelink.forwardlink,\
color: #2C2C63;\ .backlink.forwardlink {\
color: #4C4CA9;\
}\ }\
' '
}; };

View File

@ -2690,9 +2690,13 @@ QuotePreview =
if el = $.id id if el = $.id id
qp.innerHTML = el.innerHTML qp.innerHTML = el.innerHTML
$.addClass el, 'qphl' if Conf['Quote Highlighting'] $.addClass el, 'qphl' if Conf['Quote Highlighting']
node =
if /\bbacklink\b/.test @className if /\bbacklink\b/.test @className
replyID = $.x('preceding-sibling::input', @parentNode).name @parentNode
for quote in $$ '.quotelink', qp else
$.x 'ancestor::blockquote', @
replyID = $.x('preceding-sibling::input', node).name
for quote in $$ '.quotelink, .backlink', qp
if quote.hash[1..] is replyID if quote.hash[1..] is replyID
$.addClass quote, 'forwardlink' $.addClass quote, 'forwardlink'
else else
@ -3767,8 +3771,9 @@ input ~ a > img[md5] {
.filtered { .filtered {
text-decoration: line-through; text-decoration: line-through;
} }
.quotelink.forwardlink { .quotelink.forwardlink,
color: #2C2C63; .backlink.forwardlink {
color: #4C4CA9;
} }
' '