slight refactor for quoteBacklink
This commit is contained in:
parent
0b3fee0822
commit
9aef4c09ef
@ -1829,27 +1829,16 @@
|
||||
};
|
||||
quoteBacklink = {
|
||||
init: function() {
|
||||
var span, _i, _len, _ref;
|
||||
_ref = $$('span[id^=no]');
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
span = _ref[_i];
|
||||
$.after(span, $.el('span', {
|
||||
className: 'container'
|
||||
}));
|
||||
}
|
||||
return g.callbacks.push(quoteBacklink.node);
|
||||
},
|
||||
node: function(root) {
|
||||
var container, el, id, link, opbl, qid, quote, quotes, _i, _len, _ref, _results;
|
||||
var el, id, link, opbl, qid, quote, quotes, _i, _len, _ref, _results;
|
||||
if (/inline/.test(root.className)) {
|
||||
return;
|
||||
}
|
||||
if (!$('.container', root)) {
|
||||
container = $.el('span', {
|
||||
className: 'container'
|
||||
});
|
||||
$.after($('span[id^=no]', root), container);
|
||||
}
|
||||
$.after($('span[id^=no]', root), $.el('span', {
|
||||
className: 'container'
|
||||
}));
|
||||
id = root.id || $('td[id]', root).id;
|
||||
quotes = {};
|
||||
opbl = $.config('OP Backlinks');
|
||||
|
||||
@ -1440,19 +1440,17 @@ titlePost =
|
||||
|
||||
quoteBacklink =
|
||||
init: ->
|
||||
for span in $$('span[id^=no]')
|
||||
$.after span, $.el 'span', className: 'container'
|
||||
g.callbacks.push quoteBacklink.node
|
||||
|
||||
node: (root) ->
|
||||
return if /inline/.test root.className
|
||||
unless $ '.container', root
|
||||
container = $.el 'span',
|
||||
className: 'container'
|
||||
$.after $('span[id^=no]', root), container
|
||||
$.after $('span[id^=no]', root), $.el 'span', className: 'container'
|
||||
# op or reply
|
||||
id = root.id or $('td[id]', root).id
|
||||
quotes = {}
|
||||
opbl = $.config 'OP Backlinks'
|
||||
for quote in $$ 'a.quotelink', root
|
||||
#don't process >>>/b/
|
||||
continue unless qid = quote.hash[1..]
|
||||
#duplicate quotes get overwritten
|
||||
quotes[qid] = quote
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user