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

View File

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