Create the link only when needed
This commit is contained in:
parent
703c737bc5
commit
5cfb8726d1
10
4chan_x.js
10
4chan_x.js
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user