tweak
This commit is contained in:
parent
c37af9d284
commit
18f3685702
@ -562,14 +562,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggle: function(thread) {
|
toggle: function(thread) {
|
||||||
var a, backlink, num, pathname, prev, table, threadID, _i, _len, _ref, _results;
|
var a, backlink, num, pathname, prev, table, threadID, _i, _len, _ref, _ref2, _results;
|
||||||
threadID = thread.firstChild.id;
|
threadID = thread.firstChild.id;
|
||||||
pathname = "/" + g.BOARD + "/res/" + threadID;
|
pathname = "/" + g.BOARD + "/res/" + threadID;
|
||||||
a = $('a.omittedposts', thread);
|
a = $('a.omittedposts', thread);
|
||||||
switch (a.textContent[0]) {
|
switch (a.textContent[0]) {
|
||||||
case '+':
|
case '+':
|
||||||
if ($.config('OP Backlinks')) {
|
if ((_ref = $('.op .container', thread)) != null) {
|
||||||
$('.op .container', thread).innerHTML = '';
|
_ref.innerHTML = '';
|
||||||
}
|
}
|
||||||
a.textContent = a.textContent.replace('+', 'X Loading...');
|
a.textContent = a.textContent.replace('+', 'X Loading...');
|
||||||
return $.cache(pathname, (function() {
|
return $.cache(pathname, (function() {
|
||||||
@ -585,15 +585,13 @@
|
|||||||
while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) {
|
while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) {
|
||||||
$.rm(prev);
|
$.rm(prev);
|
||||||
}
|
}
|
||||||
if ($.config('OP Backlinks')) {
|
_ref2 = $$('.op a.backlink');
|
||||||
_ref = $$('.op a.backlink');
|
_results = [];
|
||||||
_results = [];
|
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
backlink = _ref2[_i];
|
||||||
backlink = _ref[_i];
|
_results.push(!d.getElementById(backlink.hash.slice(1)) ? $.rm(backlink) : void 0);
|
||||||
_results.push(!d.getElementById(backlink.hash.slice(1)) ? $.rm(backlink) : void 0);
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
}
|
}
|
||||||
|
return _results;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
parse: function(req, pathname, thread, a) {
|
parse: function(req, pathname, thread, a) {
|
||||||
|
|||||||
@ -386,7 +386,7 @@ expandThread =
|
|||||||
|
|
||||||
switch a.textContent[0]
|
switch a.textContent[0]
|
||||||
when '+'
|
when '+'
|
||||||
$('.op .container', thread).innerHTML = '' if $.config 'OP Backlinks'
|
$('.op .container', thread)?.innerHTML = ''
|
||||||
a.textContent = a.textContent.replace '+', 'X Loading...'
|
a.textContent = a.textContent.replace '+', 'X Loading...'
|
||||||
$.cache pathname, (-> expandThread.parse @, pathname, thread, a)
|
$.cache pathname, (-> expandThread.parse @, pathname, thread, a)
|
||||||
|
|
||||||
@ -402,9 +402,8 @@ expandThread =
|
|||||||
table = $.x "following::br[@clear][1]/preceding::table[#{num}]", a
|
table = $.x "following::br[@clear][1]/preceding::table[#{num}]", a
|
||||||
while (prev = table.previousSibling) and (prev.nodeName is 'TABLE')
|
while (prev = table.previousSibling) and (prev.nodeName is 'TABLE')
|
||||||
$.rm prev
|
$.rm prev
|
||||||
if $.config 'OP Backlinks'
|
for backlink in $$ '.op a.backlink'
|
||||||
for backlink in $$ '.op a.backlink'
|
$.rm backlink if !d.getElementById backlink.hash[1..]
|
||||||
$.rm backlink if !d.getElementById backlink.hash[1..]
|
|
||||||
|
|
||||||
|
|
||||||
parse: (req, pathname, thread, a) ->
|
parse: (req, pathname, thread, a) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user