From 7f59f652022bfc916d24e008bbd95652f7975c53 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 18 Apr 2013 02:35:29 -0700 Subject: [PATCH] Well, I was stupid. Oh well. --- builds/4chan-X.js | 16 ++++++---------- builds/4chan-X.user.js | 16 ++++++---------- builds/crx/script.js | 16 ++++++---------- src/code/quoting/quotethreading.coffee | 10 ++++------ 4 files changed, 22 insertions(+), 36 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 1d4bc3ff0..dbeae9a09 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -8274,7 +8274,7 @@ }); }, setup: function() { - var ID, err, post, posts; + var ID, post, posts; $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; @@ -8283,19 +8283,14 @@ for (ID in posts) { post = posts[ID]; if (post.cb) { - try { - post.cb.call(post); - } catch (_error) { - err = _error; - console.log(err); - } + post.cb.call(post); } } return; return QuoteThreading.hasRun = true; }, node: function() { - var ID, keys, post, posts, qid, quote, quotes, uniq, _i, _j, _len, _len1; + var ID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _j, _len, _len1; if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; @@ -8325,14 +8320,15 @@ } } } else { + len = ("" + g.BOARD).length + 1; for (_j = 0, _len1 = quotes.length; _j < _len1; _j++) { quote = quotes[_j]; qid = quote; - if (!(qid.slice(2) < ID)) { + if (!(qid.slice(len) < ID)) { continue; } if (qid in posts) { - uniq[qid.slice(2)] = true; + uniq[qid.slice(len)] = true; } } } diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index ac767372b..b15f54528 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -8291,7 +8291,7 @@ }); }, setup: function() { - var ID, err, post, posts; + var ID, post, posts; $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; @@ -8300,19 +8300,14 @@ for (ID in posts) { post = posts[ID]; if (post.cb) { - try { - post.cb.call(post); - } catch (_error) { - err = _error; - console.log(err); - } + post.cb.call(post); } } return; return QuoteThreading.hasRun = true; }, node: function() { - var ID, keys, post, posts, qid, quote, quotes, uniq, _i, _j, _len, _len1; + var ID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _j, _len, _len1; if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; @@ -8342,14 +8337,15 @@ } } } else { + len = ("" + g.BOARD).length + 1; for (_j = 0, _len1 = quotes.length; _j < _len1; _j++) { quote = quotes[_j]; qid = quote; - if (!(qid.slice(2) < ID)) { + if (!(qid.slice(len) < ID)) { continue; } if (qid in posts) { - uniq[qid.slice(2)] = true; + uniq[qid.slice(len)] = true; } } } diff --git a/builds/crx/script.js b/builds/crx/script.js index dc07fa8ab..25592f74d 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8193,7 +8193,7 @@ }); }, setup: function() { - var ID, err, post, posts; + var ID, post, posts; $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; @@ -8202,19 +8202,14 @@ for (ID in posts) { post = posts[ID]; if (post.cb) { - try { - post.cb.call(post); - } catch (_error) { - err = _error; - console.log(err); - } + post.cb.call(post); } } return; return QuoteThreading.hasRun = true; }, node: function() { - var ID, keys, post, posts, qid, quote, quotes, uniq, _i, _j, _len, _len1; + var ID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _j, _len, _len1; if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; @@ -8244,14 +8239,15 @@ } } } else { + len = ("" + g.BOARD).length + 1; for (_j = 0, _len1 = quotes.length; _j < _len1; _j++) { quote = quotes[_j]; qid = quote; - if (!(qid.slice(2) < ID)) { + if (!(qid.slice(len) < ID)) { continue; } if (qid in posts) { - uniq[qid.slice(2)] = true; + uniq[qid.slice(len)] = true; } } } diff --git a/src/code/quoting/quotethreading.coffee b/src/code/quoting/quotethreading.coffee index 88f073532..6b706dc7e 100644 --- a/src/code/quoting/quotethreading.coffee +++ b/src/code/quoting/quotethreading.coffee @@ -33,10 +33,7 @@ QuoteThreading = for ID, post of posts if post.cb - try - post.cb.call post - catch err - console.log err + post.cb.call post return QuoteThreading.hasRun = true @@ -68,11 +65,12 @@ QuoteThreading = if qid of posts uniq[qid] = true else + len = "#{g.BOARD}".length + 1 for quote in quotes qid = quote - continue unless qid[2..] < ID + continue unless qid[len..] < ID if qid of posts - uniq[qid[2..]] = true + uniq[qid[len..]] = true keys = Object.keys uniq return unless keys.length is 1