Holy shit, it's working.

This commit is contained in:
Zixaphir 2014-01-09 23:41:58 -07:00
parent 890277f296
commit 226ea6c27c
4 changed files with 17 additions and 22 deletions

View File

@ -2994,7 +2994,7 @@
return nodes; return nodes;
}, },
fullThread: function(board, data) { fullThread: function(board, data) {
return [Build.postFromObject(data, board.ID)]; return Build.postFromObject(data, board.ID);
} }
}; };
@ -12066,11 +12066,10 @@
} }
}, },
parse: function(data) { 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; 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); thread = new Thread(OP.no, board);
nodes = [threadRoot];
posts = []; posts = [];
errors = null; errors = null;
makePost = function(postNode) { makePost = function(postNode) {
@ -12091,13 +12090,13 @@
makePost($('.opContainer', threadRoot)); makePost($('.opContainer', threadRoot));
for (_i = 0, _len = data.length; _i < _len; _i++) { for (_i = 0, _len = data.length; _i < _len; _i++) {
obj = data[_i]; obj = data[_i];
nodes.push(post = Build.postFromObject(obj, board)); post = Build.postFromObject(obj, board);
makePost(post); makePost(post);
$.add(threadRoot, post);
} }
if (errors) { if (errors) {
Main.handleErrors(errors); Main.handleErrors(errors);
} }
$.nodes(Navigate.nodes = nodes);
Main.callbackNodes(Thread, [thread]); Main.callbackNodes(Thread, [thread]);
Main.callbackNodes(Post, posts); Main.callbackNodes(Post, posts);
Navigate.ready(); Navigate.ready();
@ -12108,7 +12107,7 @@
var board; var board;
board = $('.board'); board = $('.board');
$.rmAll(board); $.rmAll(board);
return $.add(board, Navigate.nodes); return $.add(board, Navigate.threadRoot);
}, },
popstate: function() { popstate: function() {
var a; var a;

View File

@ -3004,7 +3004,7 @@
return nodes; return nodes;
}, },
fullThread: function(board, data) { fullThread: function(board, data) {
return [Build.postFromObject(data, board.ID)]; return Build.postFromObject(data, board.ID);
} }
}; };
@ -12055,11 +12055,10 @@
} }
}, },
parse: function(data) { 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; 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); thread = new Thread(OP.no, board);
nodes = [threadRoot];
posts = []; posts = [];
errors = null; errors = null;
makePost = function(postNode) { makePost = function(postNode) {
@ -12080,13 +12079,13 @@
makePost($('.opContainer', threadRoot)); makePost($('.opContainer', threadRoot));
for (_i = 0, _len = data.length; _i < _len; _i++) { for (_i = 0, _len = data.length; _i < _len; _i++) {
obj = data[_i]; obj = data[_i];
nodes.push(post = Build.postFromObject(obj, board)); post = Build.postFromObject(obj, board);
makePost(post); makePost(post);
$.add(threadRoot, post);
} }
if (errors) { if (errors) {
Main.handleErrors(errors); Main.handleErrors(errors);
} }
$.nodes(Navigate.nodes = nodes);
Main.callbackNodes(Thread, [thread]); Main.callbackNodes(Thread, [thread]);
Main.callbackNodes(Post, posts); Main.callbackNodes(Post, posts);
Navigate.ready(); Navigate.ready();
@ -12097,7 +12096,7 @@
var board; var board;
board = $('.board'); board = $('.board');
$.rmAll(board); $.rmAll(board);
return $.add(board, Navigate.nodes); return $.add(board, Navigate.threadRoot);
}, },
popstate: function() { popstate: function() {
return Navigate.popstate = function() { return Navigate.popstate = function() {

View File

@ -233,5 +233,4 @@ Build =
nodes.push Build.summary board.ID, data.no, posts, files nodes.push Build.summary board.ID, data.no, posts, files
nodes nodes
fullThread: (board, data) -> fullThread: (board, data) -> Build.postFromObject data, board.ID
[Build.postFromObject data, board.ID]

View File

@ -217,10 +217,9 @@ Navigate =
parse: (data) -> parse: (data) ->
board = g.BOARD 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 thread = new Thread OP.no, board
nodes = [threadRoot]
posts = [] posts = []
errors = null errors = null
@ -237,13 +236,12 @@ Navigate =
makePost $('.opContainer', threadRoot) makePost $('.opContainer', threadRoot)
for obj in data for obj in data
nodes.push post = Build.postFromObject obj, board post = Build.postFromObject obj, board
makePost post makePost post
$.add threadRoot, post
Main.handleErrors errors if errors 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 Thread, [thread]
Main.callbackNodes Post, posts Main.callbackNodes Post, posts
@ -255,7 +253,7 @@ Navigate =
buildThread: -> buildThread: ->
board = $ '.board' board = $ '.board'
$.rmAll 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. popstate: -> <% if (type === 'crx') { %> Navigate.popstate = -> <% } %> # blink/webkit throw a popstate on page load. Not what we want.
a = $.el 'a', a = $.el 'a',