Forward links.

This commit is contained in:
Nicolas Stepien 2011-05-25 21:35:34 +02:00
parent 9cd4248491
commit cdbc79c8c9
2 changed files with 8 additions and 8 deletions

View File

@ -1868,19 +1868,19 @@
return $.removeClass(el, 'qphl'); return $.removeClass(el, 'qphl');
}, },
mouseover: function(e) { mouseover: function(e) {
var el, id, qp, quote, replyID, threadID, url, _i, _len, _ref; var el, id, qp, quote, replyID, threadID, url, _i, _len, _ref, _ref2;
id = this.hash.slice(1); id = this.hash.slice(1);
qp = $('#qp'); qp = $('#qp');
if (el = d.getElementById(id)) { if (el = d.getElementById(id)) {
qp.innerHTML = el.innerHTML; qp.innerHTML = el.innerHTML;
$.addClass(el, 'qphl'); $.addClass(el, 'qphl');
if (this.className === 'backlink') { if (this.className === 'backlink') {
replyID = this.parentNode.id; replyID = (_ref = $.x('ancestor::*[@id][1]', this)) != null ? _ref.id.match(/\d+/)[0] : void 0;
_ref = $$('a.quotelink', qp); _ref2 = $$('a.quotelink', qp);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
quote = _ref[_i]; quote = _ref2[_i];
if (quote.hash.slice(1) === replyID) { if (quote.hash.slice(1) === replyID) {
quote.className = 'backlink'; quote.className = 'forwardlink';
} }
} }
} }

View File

@ -1485,10 +1485,10 @@ quotePreview =
qp.innerHTML = el.innerHTML qp.innerHTML = el.innerHTML
$.addClass el, 'qphl' $.addClass el, 'qphl'
if @className is 'backlink' if @className is 'backlink'
replyID = @parentNode.id replyID = $.x('ancestor::*[@id][1]', @)?.id.match(/\d+/)[0]
for quote in $$ 'a.quotelink', qp for quote in $$ 'a.quotelink', qp
if quote.hash[1..] is replyID if quote.hash[1..] is replyID
quote.className = 'backlink' quote.className = 'forwardlink'
else else
qp.innerHTML = "Loading #{id}..." qp.innerHTML = "Loading #{id}..."
threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', @).id threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', @).id