less indenting
This commit is contained in:
parent
2295c19ade
commit
27d221cee4
55
4chan_x.js
55
4chan_x.js
@ -1693,40 +1693,39 @@
|
|||||||
return g.callbacks.push(quoteBacklink.node);
|
return g.callbacks.push(quoteBacklink.node);
|
||||||
},
|
},
|
||||||
node: function(root) {
|
node: function(root) {
|
||||||
var backlink, el, good, id, link, quote, _i, _len, _ref, _results;
|
var backlink, el, good, id, link, quote, _i, _j, _len, _len2, _ref, _ref2, _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));
|
el = d.getElementById(quote.textContent.slice(2));
|
||||||
_results.push((function() {
|
if (!el || el.className === 'op') {
|
||||||
var _j, _len2, _ref2;
|
continue;
|
||||||
if (el && el.className !== 'op') {
|
}
|
||||||
good = 1;
|
good = 1;
|
||||||
id = quote.parentNode.parentNode.parentNode.id;
|
id = quote.parentNode.parentNode.parentNode.id;
|
||||||
_ref2 = $$('a.backlink', el);
|
_ref2 = $$('a.backlink', el);
|
||||||
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
|
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
|
||||||
backlink = _ref2[_j];
|
backlink = _ref2[_j];
|
||||||
if (backlink.textContent === '>>' + id) {
|
if (backlink.textContent === '>>' + id) {
|
||||||
good = 0;
|
good = 0;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
if (good) {
|
|
||||||
link = $.el('a', {
|
|
||||||
href: '#' + id,
|
|
||||||
className: 'backlink',
|
|
||||||
textContent: '>>' + id
|
|
||||||
});
|
|
||||||
if ($.config('Quote Preview')) {
|
|
||||||
$.bind(link, 'mouseover', quotePreview.mouseover);
|
|
||||||
$.bind(link, 'mousemove', ui.hover);
|
|
||||||
$.bind(link, 'mouseout', ui.hoverend);
|
|
||||||
}
|
|
||||||
return $.before($('br, blockquote', el), link);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})());
|
}
|
||||||
|
if (!good) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
link = $.el('a', {
|
||||||
|
href: '#' + id,
|
||||||
|
className: 'backlink',
|
||||||
|
textContent: '>>' + id
|
||||||
|
});
|
||||||
|
if ($.config('Quote Preview')) {
|
||||||
|
$.bind(link, 'mouseover', quotePreview.mouseover);
|
||||||
|
$.bind(link, 'mousemove', ui.hover);
|
||||||
|
$.bind(link, 'mouseout', ui.hoverend);
|
||||||
|
}
|
||||||
|
_results.push($.before($('br, blockquote', el), link));
|
||||||
}
|
}
|
||||||
return _results;
|
return _results;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1353,23 +1353,23 @@ quoteBacklink =
|
|||||||
node: (root) ->
|
node: (root) ->
|
||||||
for quote in $$ 'a.quotelink', root
|
for quote in $$ 'a.quotelink', root
|
||||||
el = d.getElementById(quote.textContent[2..])
|
el = d.getElementById(quote.textContent[2..])
|
||||||
if el and el.className isnt 'op'
|
continue if not el or el.className is 'op'
|
||||||
good = 1
|
good = 1
|
||||||
id = quote.parentNode.parentNode.parentNode.id
|
id = quote.parentNode.parentNode.parentNode.id
|
||||||
for backlink in $$ 'a.backlink', el
|
for backlink in $$ 'a.backlink', el
|
||||||
if backlink.textContent is '>>'+id
|
if backlink.textContent is '>>'+id
|
||||||
good = 0
|
good = 0
|
||||||
break
|
break
|
||||||
if good
|
continue if not good
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
href: '#'+id
|
href: '#'+id
|
||||||
className: 'backlink'
|
className: 'backlink'
|
||||||
textContent: '>>'+id
|
textContent: '>>'+id
|
||||||
if $.config 'Quote Preview'
|
if $.config 'Quote Preview'
|
||||||
$.bind link, 'mouseover', quotePreview.mouseover
|
$.bind link, 'mouseover', quotePreview.mouseover
|
||||||
$.bind link, 'mousemove', ui.hover
|
$.bind link, 'mousemove', ui.hover
|
||||||
$.bind link, 'mouseout', ui.hoverend
|
$.bind link, 'mouseout', ui.hoverend
|
||||||
$.before $('br, blockquote', el), link
|
$.before $('br, blockquote', el), link
|
||||||
|
|
||||||
quotePreview =
|
quotePreview =
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user