That... should fix those errors.

This commit is contained in:
Zixaphir 2014-01-09 19:25:47 -07:00
parent 0d29b42a02
commit b87825e558
5 changed files with 23 additions and 20 deletions

View File

@ -865,7 +865,7 @@
errors = []; errors = [];
} }
errors.push({ errors.push({
message: ['"', name, '" crashed on node ', this.type, ' No.', node, ' (', node.board, ').'].join(''), message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
error: err error: err
}); });
} }
@ -911,7 +911,7 @@
this.isClosed = false; this.isClosed = false;
this.postLimit = false; this.postLimit = false;
this.fileLimit = false; this.fileLimit = false;
g.threads[this.fullID] = board.threads[this.ID] = this; g.threads[this.fullID] = board.threads[this] = this;
} }
Thread.prototype.setPage = function(pageNum) { Thread.prototype.setPage = function(pageNum) {
@ -11962,16 +11962,17 @@
return Header.scrollToIfNeeded($('.board')); return Header.scrollToIfNeeded($('.board'));
}, },
parse: function(data) { parse: function(data) {
var errors, makePost, nodes, obj, post, posts, thread, threadRoot, _i, _len; var OP, board, errors, makePost, nodes, obj, post, posts, thread, threadRoot, _i, _len;
threadRoot = Build.thread(g.BOARD, data.shift(), true); board = g.BOARD;
thread = new Thread(threadRoot, g.BOARD); threadRoot = Build.thread(board, OP = data.shift(), true);
thread = new Thread(OP.no, board);
nodes = [threadRoot]; nodes = [threadRoot];
posts = []; posts = [];
errors = null; errors = null;
makePost = function(postNode) { makePost = function(postNode) {
var err; var err;
try { try {
return posts.push(new Post(postNode, thread, g.BOARD)); return posts.push(new Post(postNode, thread, board));
} catch (_error) { } catch (_error) {
err = _error; err = _error;
if (!errors) { if (!errors) {
@ -11986,7 +11987,7 @@
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];
posts.push(post = Build.postFromObject(obj)); nodes.push(post = Build.postFromObject(obj, board));
makePost(post); makePost(post);
} }
if (errors) { if (errors) {

View File

@ -870,7 +870,7 @@
errors = []; errors = [];
} }
errors.push({ errors.push({
message: ['"', name, '" crashed on node ', this.type, ' No.', node, ' (', node.board, ').'].join(''), message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
error: err error: err
}); });
} }
@ -916,7 +916,7 @@
this.isClosed = false; this.isClosed = false;
this.postLimit = false; this.postLimit = false;
this.fileLimit = false; this.fileLimit = false;
g.threads[this.fullID] = board.threads[this.ID] = this; g.threads[this.fullID] = board.threads[this] = this;
} }
Thread.prototype.setPage = function(pageNum) { Thread.prototype.setPage = function(pageNum) {
@ -11951,16 +11951,17 @@
return Header.scrollToIfNeeded($('.board')); return Header.scrollToIfNeeded($('.board'));
}, },
parse: function(data) { parse: function(data) {
var errors, makePost, nodes, obj, post, posts, thread, threadRoot, _i, _len; var OP, board, errors, makePost, nodes, obj, post, posts, thread, threadRoot, _i, _len;
threadRoot = Build.thread(g.BOARD, data.shift(), true); board = g.BOARD;
thread = new Thread(threadRoot, g.BOARD); threadRoot = Build.thread(board, OP = data.shift(), true);
thread = new Thread(OP.no, board);
nodes = [threadRoot]; nodes = [threadRoot];
posts = []; posts = [];
errors = null; errors = null;
makePost = function(postNode) { makePost = function(postNode) {
var err; var err;
try { try {
return posts.push(new Post(postNode, thread, g.BOARD)); return posts.push(new Post(postNode, thread, board));
} catch (_error) { } catch (_error) {
err = _error; err = _error;
if (!errors) { if (!errors) {
@ -11975,7 +11976,7 @@
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];
posts.push(post = Build.postFromObject(obj)); nodes.push(post = Build.postFromObject(obj, board));
makePost(post); makePost(post);
} }
if (errors) { if (errors) {

View File

@ -129,8 +129,9 @@ Navigate =
Header.scrollToIfNeeded $ '.board' Header.scrollToIfNeeded $ '.board'
parse: (data) -> parse: (data) ->
threadRoot = Build.thread g.BOARD, data.shift(), true board = g.BOARD
thread = new Thread threadRoot, g.BOARD threadRoot = Build.thread board, OP = data.shift(), true
thread = new Thread OP.no, board
nodes = [threadRoot] nodes = [threadRoot]
posts = [] posts = []
@ -138,7 +139,7 @@ Navigate =
makePost = (postNode) -> makePost = (postNode) ->
try try
posts.push new Post postNode, thread, g.BOARD posts.push new Post postNode, thread, board
catch err catch err
# Skip posts that we failed to parse. # Skip posts that we failed to parse.
errors = [] unless errors errors = [] unless errors
@ -149,7 +150,7 @@ Navigate =
makePost $('.opContainer', threadRoot) makePost $('.opContainer', threadRoot)
for obj in data for obj in data
posts.push post = Build.postFromObject obj nodes.push post = Build.postFromObject obj, board
makePost post makePost post
Main.handleErrors errors if errors Main.handleErrors errors if errors

View File

@ -21,7 +21,7 @@ class Callbacks
catch err catch err
errors = [] unless errors errors = [] unless errors
errors.push errors.push
message: ['"', name, '" crashed on node ', @type, ' No.', node, ' (', node.board, ').'].join('') message: ['"', name, '" crashed on node ', @type, ' No.', node.ID, ' (', node.board, ').'].join('')
error: err error: err
Main.handleErrors errors if errors Main.handleErrors errors if errors

View File

@ -10,7 +10,7 @@ class Thread
@postLimit = false @postLimit = false
@fileLimit = false @fileLimit = false
g.threads[@fullID] = board.threads[@ID] = @ g.threads[@fullID] = board.threads[@] = @
setPage: (pageNum) -> setPage: (pageNum) ->
icon = $ '.page-num', @OP.nodes.post icon = $ '.page-num', @OP.nodes.post