Go deeper

This commit is contained in:
Nicolas Stepien 2011-05-09 18:46:47 +02:00
parent 19bfaa923d
commit 9927dc85f8
2 changed files with 39 additions and 40 deletions

View File

@ -1681,38 +1681,37 @@
return g.callbacks.push(quoteBacklink.node); return g.callbacks.push(quoteBacklink.node);
}, },
node: function(root) { node: function(root) {
var backlink, el, id, link, nogood, quote, _i, _len, _ref, _results; var backlink, el, good, id, link, quote, _i, _len, _ref, _results;
_ref = $$('a.quotelink', root); _ref = $$('a.quotelink', root);
_results = []; _results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i]; quote = _ref[_i];
el = d.getElementById(quote.textContent.slice(2));
_results.push((function() { _results.push((function() {
var _j, _len2, _ref2; var _j, _len2, _ref2;
if (el = d.getElementById(quote.textContent.slice(2))) { if (el && el.className !== 'op') {
good = 1;
id = quote.parentNode.parentNode.parentNode.id; id = quote.parentNode.parentNode.parentNode.id;
if (el.className !== 'op') { _ref2 = $$('a.backlink', el);
nogood = 0; for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
_ref2 = $$('a.backlink', el); backlink = _ref2[_j];
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { if (backlink.textContent === '>>' + id) {
backlink = _ref2[_j]; good = 0;
if (backlink.textContent === '>>' + id) { break;
nogood = 1;
break;
}
} }
if (!nogood) { }
link = $.el('a', { if (good) {
href: '#' + id, link = $.el('a', {
className: 'backlink', href: '#' + id,
textContent: '>>' + id className: 'backlink',
}); textContent: '>>' + id
if ($.config('Quote Preview')) { });
$.bind(link, 'mouseover', quotePreview.mouseover); if ($.config('Quote Preview')) {
$.bind(link, 'mousemove', ui.hover); $.bind(link, 'mouseover', quotePreview.mouseover);
$.bind(link, 'mouseout', ui.hoverend); $.bind(link, 'mousemove', ui.hover);
} $.bind(link, 'mouseout', ui.hoverend);
return $.before($('br, blockquote', el), link);
} }
return $.before($('br, blockquote', el), link);
} }
} }
})()); })());

View File

@ -1346,24 +1346,24 @@ quoteBacklink =
g.callbacks.push quoteBacklink.node g.callbacks.push quoteBacklink.node
node: (root) -> node: (root) ->
for quote in $$ 'a.quotelink', root for quote in $$ 'a.quotelink', root
if el = d.getElementById quote.textContent[2..] el = d.getElementById(quote.textContent[2..])
if el and el.className isnt 'op'
good = 1
id = quote.parentNode.parentNode.parentNode.id id = quote.parentNode.parentNode.parentNode.id
unless el.className is 'op' for backlink in $$ 'a.backlink', el
nogood = 0 if backlink.textContent is '>>'+id
for backlink in $$ 'a.backlink', el good = 0
if backlink.textContent is '>>'+id break
nogood = 1 if good
break link = $.el 'a',
unless nogood href: '#'+id
link = $.el 'a' className: 'backlink'
href: '#'+id textContent: '>>'+id
className: 'backlink' if $.config 'Quote Preview'
textContent: '>>'+id $.bind link, 'mouseover', quotePreview.mouseover
if $.config 'Quote Preview' $.bind link, 'mousemove', ui.hover
$.bind link, 'mouseover', quotePreview.mouseover $.bind link, 'mouseout', ui.hoverend
$.bind link, 'mousemove', ui.hover $.before $('br, blockquote', el), link
$.bind link, 'mouseout', ui.hoverend
$.before $('br, blockquote', el), link
quotePreview = quotePreview =
init: -> init: ->