Create the link only when needed

This commit is contained in:
Nicolas Stepien 2011-05-09 18:28:53 +02:00
parent 703c737bc5
commit 5cfb8726d1
2 changed files with 9 additions and 9 deletions

View File

@ -1690,11 +1690,6 @@
var _j, _len2, _ref2;
if (el = d.getElementById(quote.textContent.slice(2))) {
id = quote.parentNode.parentNode.parentNode.id;
link = $.el('a', {
href: '#' + id,
className: 'backlink',
textContent: '>>' + id
});
if (el.className !== 'op') {
nogood = 0;
_ref2 = $$('a.backlink', el);
@ -1706,6 +1701,11 @@
}
}
if (!nogood) {
link = $.el('a', {
href: '#' + id,
className: 'backlink',
textContent: '>>' + id
});
return $.before($('br, blockquote', el), link);
}
}

View File

@ -1348,10 +1348,6 @@ quoteBacklink =
for quote in $$ 'a.quotelink', root
if el = d.getElementById quote.textContent[2..]
id = quote.parentNode.parentNode.parentNode.id
link = $.el 'a'
href: '#'+id
className: 'backlink'
textContent: '>>'+id
unless el.className is 'op'
nogood = 0
for backlink in $$ 'a.backlink', el
@ -1359,6 +1355,10 @@ quoteBacklink =
nogood = 1
break
unless nogood
link = $.el 'a'
href: '#'+id
className: 'backlink'
textContent: '>>'+id
$.before $('br, blockquote', el), link
quotePreview =