From 226ea6c27ca3f7c85bbbff94bf5a07c99646fef2 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 9 Jan 2014 23:41:58 -0700 Subject: [PATCH] Holy shit, it's working. --- builds/4chan-X.user.js | 13 ++++++------- builds/crx/script.js | 13 ++++++------- src/General/Build.coffee | 3 +-- src/General/Navigate.coffee | 10 ++++------ 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 4a63bfbc5..783c0f2e3 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2994,7 +2994,7 @@ return nodes; }, fullThread: function(board, data) { - return [Build.postFromObject(data, board.ID)]; + return Build.postFromObject(data, board.ID); } }; @@ -12066,11 +12066,10 @@ } }, parse: function(data) { - var OP, board, errors, makePost, nodes, obj, post, posts, thread, threadRoot, _i, _len; + var OP, board, errors, makePost, obj, post, posts, thread, threadRoot, _i, _len; board = g.BOARD; - threadRoot = Build.thread(board, OP = data.shift(), true); + Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true); thread = new Thread(OP.no, board); - nodes = [threadRoot]; posts = []; errors = null; makePost = function(postNode) { @@ -12091,13 +12090,13 @@ makePost($('.opContainer', threadRoot)); for (_i = 0, _len = data.length; _i < _len; _i++) { obj = data[_i]; - nodes.push(post = Build.postFromObject(obj, board)); + post = Build.postFromObject(obj, board); makePost(post); + $.add(threadRoot, post); } if (errors) { Main.handleErrors(errors); } - $.nodes(Navigate.nodes = nodes); Main.callbackNodes(Thread, [thread]); Main.callbackNodes(Post, posts); Navigate.ready(); @@ -12108,7 +12107,7 @@ var board; board = $('.board'); $.rmAll(board); - return $.add(board, Navigate.nodes); + return $.add(board, Navigate.threadRoot); }, popstate: function() { var a; diff --git a/builds/crx/script.js b/builds/crx/script.js index 56dc3a293..2242102ff 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -3004,7 +3004,7 @@ return nodes; }, fullThread: function(board, data) { - return [Build.postFromObject(data, board.ID)]; + return Build.postFromObject(data, board.ID); } }; @@ -12055,11 +12055,10 @@ } }, parse: function(data) { - var OP, board, errors, makePost, nodes, obj, post, posts, thread, threadRoot, _i, _len; + var OP, board, errors, makePost, obj, post, posts, thread, threadRoot, _i, _len; board = g.BOARD; - threadRoot = Build.thread(board, OP = data.shift(), true); + Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true); thread = new Thread(OP.no, board); - nodes = [threadRoot]; posts = []; errors = null; makePost = function(postNode) { @@ -12080,13 +12079,13 @@ makePost($('.opContainer', threadRoot)); for (_i = 0, _len = data.length; _i < _len; _i++) { obj = data[_i]; - nodes.push(post = Build.postFromObject(obj, board)); + post = Build.postFromObject(obj, board); makePost(post); + $.add(threadRoot, post); } if (errors) { Main.handleErrors(errors); } - $.nodes(Navigate.nodes = nodes); Main.callbackNodes(Thread, [thread]); Main.callbackNodes(Post, posts); Navigate.ready(); @@ -12097,7 +12096,7 @@ var board; board = $('.board'); $.rmAll(board); - return $.add(board, Navigate.nodes); + return $.add(board, Navigate.threadRoot); }, popstate: function() { return Navigate.popstate = function() { diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 653293680..726c4b1e7 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -233,5 +233,4 @@ Build = nodes.push Build.summary board.ID, data.no, posts, files nodes - fullThread: (board, data) -> - [Build.postFromObject data, board.ID] \ No newline at end of file + fullThread: (board, data) -> Build.postFromObject data, board.ID \ No newline at end of file diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 4a7d4c3e2..7f4161867 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -217,10 +217,9 @@ Navigate = parse: (data) -> board = g.BOARD - threadRoot = Build.thread board, OP = data.shift(), true + Navigate.threadRoot = threadRoot = Build.thread board, OP = data.shift(), true thread = new Thread OP.no, board - nodes = [threadRoot] posts = [] errors = null @@ -237,13 +236,12 @@ Navigate = makePost $('.opContainer', threadRoot) for obj in data - nodes.push post = Build.postFromObject obj, board + post = Build.postFromObject obj, board makePost post + $.add threadRoot, post Main.handleErrors errors if errors - # Add the thread to a container to make sure all features work. - $.nodes Navigate.nodes = nodes Main.callbackNodes Thread, [thread] Main.callbackNodes Post, posts @@ -255,7 +253,7 @@ Navigate = buildThread: -> board = $ '.board' $.rmAll board - $.add board, Navigate.nodes + $.add board, Navigate.threadRoot popstate: -> <% if (type === 'crx') { %> Navigate.popstate = -> <% } %> # blink/webkit throw a popstate on page load. Not what we want. a = $.el 'a',