Merge branch 'v3' of git://github.com/MayhemYDG/4chan-x into v3

Conflicts:
	src/Miscellaneous/ExpandThread.coffee
This commit is contained in:
Zixaphir 2013-08-06 12:01:16 -07:00
commit fe20262e5e
4 changed files with 237 additions and 174 deletions

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.2.25 - 2013-08-05 * 4chan X - Version 1.2.25 - 2013-08-06
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -19,7 +19,7 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.2.25 - 2013-08-05 * 4chan X - Version 1.2.25 - 2013-08-06
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -8612,34 +8612,42 @@
}); });
}, },
node: function() { node: function() {
var a, span; var a, files, posts, span, _ref;
if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) {
return; return;
} }
_ref = span.textContent.match(/\d+/g), posts = _ref[0], files = _ref[1];
a = $.el('a', { a = $.el('a', {
textContent: "+ " + span.textContent, textContent: ExpandThread.text('+', posts, files),
className: 'summary', className: 'summary',
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(a, 'click', ExpandThread.cbToggle); $.on(a, 'click', ExpandThread.cbToggle);
return $.replace(span, a); return $.replace(span, a);
}, },
cbToggle: function() { text: function(status, posts, files) {
var op; var text;
op = Get.postFromRoot(this.previousElementSibling); text = [status];
return ExpandThread.toggle(op.thread); text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
if (+files) {
text.push("and " + files + " image repl" + (files > 1 ? 'ies' : 'y'));
}
text.push(status === '-' ? 'shown' : 'omitted');
return text.join(' ') + '.';
},
cbToggle: function() {
return ExpandThread.toggle(Get.threadFromRoot(this.parentNode));
}, },
toggle: function(thread) { toggle: function(thread) {
var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; var a, files, filesCount, inlined, num, post, posts, postsCount, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4;
threadRoot = thread.OP.nodes.root.parentNode; threadRoot = thread.OP.nodes.root.parentNode;
a = $('.summary', threadRoot); a = $('.summary', threadRoot);
switch (thread.isExpanded) { switch (thread.isExpanded) {
case false: case false:
case void 0: case void 0:
thread.isExpanded = 'loading';
_ref = $$('.thread > .postContainer', threadRoot); _ref = $$('.thread > .postContainer', threadRoot);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
post = _ref[_i]; post = _ref[_i];
@ -8650,7 +8658,8 @@
return; return;
} }
thread.isExpanded = 'loading'; thread.isExpanded = 'loading';
a.textContent = a.textContent.replace('+', '...'); _ref1 = a.textContent.match(/\d+/g), posts = _ref1[0], files = _ref1[1];
a.textContent = ExpandThread.text('...', posts, files);
$.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() {
return ExpandThread.parse(this, thread, a); return ExpandThread.parse(this, thread, a);
}); });
@ -8660,84 +8669,99 @@
if (!a) { if (!a) {
return; return;
} }
a.textContent = a.textContent.replace('...', '+'); _ref2 = a.textContent.match(/\d+/g), posts = _ref2[0], files = _ref2[1];
a.textContent = ExpandThread.text('+', posts, files);
break; break;
case true: case true:
thread.isExpanded = false; thread.isExpanded = false;
if (a) { num = (function() {
a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted'); if (thread.isSticky) {
num = (function() { return 1;
if (thread.isSticky) { } else {
return 1; switch (g.BOARD.ID) {
} else { case 'b':
switch (g.BOARD.ID) { case 'vg':
case 'b': case 'q':
case 'vg': return 3;
case 'q': case 't':
return 3; return 1;
case 't': default:
return 1; return 5;
default:
return 5;
}
} }
})();
replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num);
for (_j = 0, _len1 = replies.length; _j < _len1; _j++) {
reply = replies[_j];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
}
}
$.rm(reply);
} }
} })();
_ref1 = $$('.thread > .postContainer', threadRoot); posts = $$(".thread > .replyContainer", threadRoot);
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { _ref3 = [thread.OP.nodes.root].concat(posts.slice(-num));
post = _ref1[_k]; for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
post = _ref3[_j];
ExpandComment.contract(Get.postFromRoot(post)); ExpandComment.contract(Get.postFromRoot(post));
} }
if (!a) {
return;
}
postsCount = 0;
filesCount = 0;
_ref4 = posts.slice(0, -num);
for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
reply = _ref4[_k];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
}
}
postsCount++;
if ('file' in Get.postFromRoot(reply)) {
filesCount++;
}
$.rm(reply);
}
a.textContent = ExpandThread.text('+', postsCount, filesCount);
} }
}, },
parse: function(req, thread, a) { parse: function(req, thread, a) {
var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len;
if (a.textContent[0] === '+') { if (a.textContent[0] === '+') {
return; return;
} }
status = req.status; if (![200, 304].contains(req.status)) {
if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + req.status + ")";
a.textContent = "Error " + req.statusText + " (" + status + ")"; $.off(a, 'click', ExpandThread.cbToggle);
$.off(a, 'click', ExpandThread.cb.toggle);
return; return;
} }
thread.isExpanded = true; thread.isExpanded = true;
a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded');
posts = JSON.parse(req.response).posts; posts = JSON.parse(req.response).posts;
if (spoilerRange = posts[0].custom_spoiler) { if (spoilerRange = posts.shift().custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange; Build.spoilerRange[thread.board] = spoilerRange;
} }
replies = posts.slice(1); postsObj = [];
posts = []; postsRoot = [];
nodes = []; filesCount = 0;
for (_i = 0, _len = replies.length; _i < _len; _i++) { for (_i = 0, _len = posts.length; _i < _len; _i++) {
reply = replies[_i]; reply = posts[_i];
if (post = thread.posts[reply.no]) { if (post = thread.posts[reply.no]) {
nodes.push(post.nodes.root); if ('file' in post) {
filesCount++;
}
postsRoot.push(post.nodes.root);
continue; continue;
} }
node = Build.postFromObject(reply, thread.board.ID); root = Build.postFromObject(reply, thread.board.ID);
post = new Post(node, thread, thread.board); post = new Post(root, thread, thread.board);
link = $('a[title="Highlight this post"]', node); link = $('a[title="Highlight this post"]', root);
link.href = "res/" + thread + "#p" + post; link.href = "res/" + thread + "#p" + post;
link.nextSibling.href = "res/" + thread + "#q" + post; link.nextSibling.href = "res/" + thread + "#q" + post;
posts.push(post); if ('file' in post) {
nodes.push(node); filesCount++;
}
postsObj.push(post);
postsRoot.push(root);
} }
Main.callbackNodes(Post, posts); Main.callbackNodes(Post, postsObj);
$.after(a, nodes); $.after(a, postsRoot);
return Fourchan.parseThread(thread.ID, 1, nodes.length); postsCount = postsRoot.length;
a.textContent = ExpandThread.text('-', postsCount, filesCount);
return Fourchan.parseThread(thread.ID, 1, postsCount);
} }
}; };

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript // Generated by CoffeeScript
/* /*
* 4chan X - Version 1.2.25 - 2013-08-05 * 4chan X - Version 1.2.25 - 2013-08-06
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -8597,34 +8597,42 @@
}); });
}, },
node: function() { node: function() {
var a, span; var a, files, posts, span, _ref;
if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) {
return; return;
} }
_ref = span.textContent.match(/\d+/g), posts = _ref[0], files = _ref[1];
a = $.el('a', { a = $.el('a', {
textContent: "+ " + span.textContent, textContent: ExpandThread.text('+', posts, files),
className: 'summary', className: 'summary',
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(a, 'click', ExpandThread.cbToggle); $.on(a, 'click', ExpandThread.cbToggle);
return $.replace(span, a); return $.replace(span, a);
}, },
cbToggle: function() { text: function(status, posts, files) {
var op; var text;
op = Get.postFromRoot(this.previousElementSibling); text = [status];
return ExpandThread.toggle(op.thread); text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
if (+files) {
text.push("and " + files + " image repl" + (files > 1 ? 'ies' : 'y'));
}
text.push(status === '-' ? 'shown' : 'omitted');
return text.join(' ') + '.';
},
cbToggle: function() {
return ExpandThread.toggle(Get.threadFromRoot(this.parentNode));
}, },
toggle: function(thread) { toggle: function(thread) {
var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; var a, files, filesCount, inlined, num, post, posts, postsCount, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4;
threadRoot = thread.OP.nodes.root.parentNode; threadRoot = thread.OP.nodes.root.parentNode;
a = $('.summary', threadRoot); a = $('.summary', threadRoot);
switch (thread.isExpanded) { switch (thread.isExpanded) {
case false: case false:
case void 0: case void 0:
thread.isExpanded = 'loading';
_ref = $$('.thread > .postContainer', threadRoot); _ref = $$('.thread > .postContainer', threadRoot);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
post = _ref[_i]; post = _ref[_i];
@ -8635,7 +8643,8 @@
return; return;
} }
thread.isExpanded = 'loading'; thread.isExpanded = 'loading';
a.textContent = a.textContent.replace('+', '...'); _ref1 = a.textContent.match(/\d+/g), posts = _ref1[0], files = _ref1[1];
a.textContent = ExpandThread.text('...', posts, files);
$.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() {
return ExpandThread.parse(this, thread, a); return ExpandThread.parse(this, thread, a);
}); });
@ -8645,84 +8654,99 @@
if (!a) { if (!a) {
return; return;
} }
a.textContent = a.textContent.replace('...', '+'); _ref2 = a.textContent.match(/\d+/g), posts = _ref2[0], files = _ref2[1];
a.textContent = ExpandThread.text('+', posts, files);
break; break;
case true: case true:
thread.isExpanded = false; thread.isExpanded = false;
if (a) { num = (function() {
a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted'); if (thread.isSticky) {
num = (function() { return 1;
if (thread.isSticky) { } else {
return 1; switch (g.BOARD.ID) {
} else { case 'b':
switch (g.BOARD.ID) { case 'vg':
case 'b': case 'q':
case 'vg': return 3;
case 'q': case 't':
return 3; return 1;
case 't': default:
return 1; return 5;
default:
return 5;
}
} }
})();
replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num);
for (_j = 0, _len1 = replies.length; _j < _len1; _j++) {
reply = replies[_j];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
}
}
$.rm(reply);
} }
} })();
_ref1 = $$('.thread > .postContainer', threadRoot); posts = $$(".thread > .replyContainer", threadRoot);
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { _ref3 = [thread.OP.nodes.root].concat(posts.slice(-num));
post = _ref1[_k]; for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
post = _ref3[_j];
ExpandComment.contract(Get.postFromRoot(post)); ExpandComment.contract(Get.postFromRoot(post));
} }
if (!a) {
return;
}
postsCount = 0;
filesCount = 0;
_ref4 = posts.slice(0, -num);
for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
reply = _ref4[_k];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
}
}
postsCount++;
if ('file' in Get.postFromRoot(reply)) {
filesCount++;
}
$.rm(reply);
}
a.textContent = ExpandThread.text('+', postsCount, filesCount);
} }
}, },
parse: function(req, thread, a) { parse: function(req, thread, a) {
var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len;
if (a.textContent[0] === '+') { if (a.textContent[0] === '+') {
return; return;
} }
status = req.status; if (![200, 304].contains(req.status)) {
if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + req.status + ")";
a.textContent = "Error " + req.statusText + " (" + status + ")"; $.off(a, 'click', ExpandThread.cbToggle);
$.off(a, 'click', ExpandThread.cb.toggle);
return; return;
} }
thread.isExpanded = true; thread.isExpanded = true;
a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded');
posts = JSON.parse(req.response).posts; posts = JSON.parse(req.response).posts;
if (spoilerRange = posts[0].custom_spoiler) { if (spoilerRange = posts.shift().custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange; Build.spoilerRange[thread.board] = spoilerRange;
} }
replies = posts.slice(1); postsObj = [];
posts = []; postsRoot = [];
nodes = []; filesCount = 0;
for (_i = 0, _len = replies.length; _i < _len; _i++) { for (_i = 0, _len = posts.length; _i < _len; _i++) {
reply = replies[_i]; reply = posts[_i];
if (post = thread.posts[reply.no]) { if (post = thread.posts[reply.no]) {
nodes.push(post.nodes.root); if ('file' in post) {
filesCount++;
}
postsRoot.push(post.nodes.root);
continue; continue;
} }
node = Build.postFromObject(reply, thread.board.ID); root = Build.postFromObject(reply, thread.board.ID);
post = new Post(node, thread, thread.board); post = new Post(root, thread, thread.board);
link = $('a[title="Highlight this post"]', node); link = $('a[title="Highlight this post"]', root);
link.href = "res/" + thread + "#p" + post; link.href = "res/" + thread + "#p" + post;
link.nextSibling.href = "res/" + thread + "#q" + post; link.nextSibling.href = "res/" + thread + "#q" + post;
posts.push(post); if ('file' in post) {
nodes.push(node); filesCount++;
}
postsObj.push(post);
postsRoot.push(root);
} }
Main.callbackNodes(Post, posts); Main.callbackNodes(Post, postsObj);
$.after(a, nodes); $.after(a, postsRoot);
return Fourchan.parseThread(thread.ID, 1, nodes.length); postsCount = postsRoot.length;
a.textContent = ExpandThread.text('-', postsCount, filesCount);
return Fourchan.parseThread(thread.ID, 1, postsCount);
} }
}; };

View File

@ -6,17 +6,24 @@ ExpandThread =
name: 'Thread Expansion' name: 'Thread Expansion'
cb: @node cb: @node
node: -> node: ->
return unless span = $ '.summary', @OP.nodes.root.parentNode return unless span = $.x 'following-sibling::span[contains(@class,"summary")][1]', @OP.nodes.root
[posts, files] = span.textContent.match /\d+/g
a = $.el 'a', a = $.el 'a',
textContent: "+ #{span.textContent}" textContent: ExpandThread.text '+', posts, files
className: 'summary' className: 'summary'
href: 'javascript:;' href: 'javascript:;'
$.on a, 'click', ExpandThread.cbToggle $.on a, 'click', ExpandThread.cbToggle
$.replace span, a $.replace span, a
text: (status, posts, files) ->
text = [status]
text.push "#{posts} post#{if posts > 1 then 's' else ''}"
text.push "and #{files} image repl#{if files > 1 then 'ies' else 'y'}" if +files
text.push if status is '-' then 'shown' else 'omitted'
text.join(' ') + '.'
cbToggle: -> cbToggle: ->
op = Get.postFromRoot @previousElementSibling ExpandThread.toggle Get.threadFromRoot @parentNode
ExpandThread.toggle op.thread
toggle: (thread) -> toggle: (thread) ->
threadRoot = thread.OP.nodes.root.parentNode threadRoot = thread.OP.nodes.root.parentNode
@ -24,74 +31,82 @@ ExpandThread =
switch thread.isExpanded switch thread.isExpanded
when false, undefined when false, undefined
thread.isExpanded = 'loading'
for post in $$ '.thread > .postContainer', threadRoot for post in $$ '.thread > .postContainer', threadRoot
ExpandComment.expand Get.postFromRoot post ExpandComment.expand Get.postFromRoot post
unless a unless a
thread.isExpanded = true thread.isExpanded = true
return return
thread.isExpanded = 'loading' thread.isExpanded = 'loading'
a.textContent = a.textContent.replace '+', '...' [posts, files] = a.textContent.match /\d+/g
a.textContent = ExpandThread.text '...', posts, files
$.cache "//api.4chan.org/#{thread.board}/res/#{thread}.json", -> $.cache "//api.4chan.org/#{thread.board}/res/#{thread}.json", ->
ExpandThread.parse @, thread, a ExpandThread.parse @, thread, a
when 'loading' when 'loading'
thread.isExpanded = false thread.isExpanded = false
return unless a return unless a
a.textContent = a.textContent.replace '...', '+' [posts, files] = a.textContent.match /\d+/g
a.textContent = ExpandThread.text '+', posts, files
when true when true
thread.isExpanded = false thread.isExpanded = false
if a #goddamit moot
a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted') num = if thread.isSticky
#goddamit moot 1
num = if thread.isSticky else switch g.BOARD.ID
1 # XXX boards config
else switch g.BOARD.ID when 'b', 'vg', 'q' then 3
# XXX boards config when 't' then 1
when 'b', 'vg', 'q' then 3 else 5
when 't' then 1 posts = $$ ".thread > .replyContainer", threadRoot
else 5 for post in [thread.OP.nodes.root].concat posts[-num..]
replies = $$('.thread > .replyContainer', threadRoot)[...-num]
for reply in replies
if Conf['Quote Inlining']
# rm clones
inlined.click() while inlined = $ '.inlined', reply
$.rm reply
for post in $$ '.thread > .postContainer', threadRoot
ExpandComment.contract Get.postFromRoot post ExpandComment.contract Get.postFromRoot post
return unless a
postsCount = 0
filesCount = 0
for reply in posts[...-num]
if Conf['Quote Inlining']
# rm clones
inlined.click() while inlined = $ '.inlined', reply
postsCount++
filesCount++ if 'file' of Get.postFromRoot reply
$.rm reply
a.textContent = ExpandThread.text '+', postsCount, filesCount
return return
parse: (req, thread, a) -> parse: (req, thread, a) ->
return if a.textContent[0] is '+' return if a.textContent[0] is '+'
{status} = req unless [200, 304].contains req.status
unless [200, 304].contains status a.textContent = "Error #{req.statusText} (#{req.status})"
a.textContent = "Error #{req.statusText} (#{status})" $.off a, 'click', ExpandThread.cbToggle
$.off a, 'click', ExpandThread.cb.toggle
return return
thread.isExpanded = true thread.isExpanded = true
a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded')
posts = JSON.parse(req.response).posts {posts} = JSON.parse req.response
if spoilerRange = posts[0].custom_spoiler if spoilerRange = posts.shift().custom_spoiler
Build.spoilerRange[g.BOARD] = spoilerRange Build.spoilerRange[thread.board] = spoilerRange
replies = posts[1..] postsObj = []
posts = [] postsRoot = []
nodes = [] filesCount = 0
for reply in replies for reply in posts
if post = thread.posts[reply.no] if post = thread.posts[reply.no]
nodes.push post.nodes.root filesCount++ if 'file' of post
postsRoot.push post.nodes.root
continue continue
node = Build.postFromObject reply, thread.board.ID root = Build.postFromObject reply, thread.board.ID
post = new Post node, thread, thread.board post = new Post root, thread, thread.board
link = $ 'a[title="Highlight this post"]', node link = $ 'a[title="Highlight this post"]', root
link.href = "res/#{thread}#p#{post}" link.href = "res/#{thread}#p#{post}"
link.nextSibling.href = "res/#{thread}#q#{post}" link.nextSibling.href = "res/#{thread}#q#{post}"
posts.push post filesCount++ if 'file' of post
nodes.push node postsObj.push post
Main.callbackNodes Post, posts postsRoot.push root
$.after a, nodes Main.callbackNodes Post, postsObj
$.after a, postsRoot
Fourchan.parseThread thread.ID, 1, nodes.length postsCount = postsRoot.length
a.textContent = ExpandThread.text '-', postsCount, filesCount
Fourchan.parseThread thread.ID, 1, postsCount