diff --git a/CHANGELOG.md b/CHANGELOG.md
index be643960f..1f200d24f 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@ The links to individual versions below are to copies of the script with the upda
### v1.10.4
+**v1.10.4.2** *(2015-03-09)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.2/builds/4chan-X-noupdate.crx "Chromium version")]
+- Fix bugs when posts are previewed before they appear in the index (by links to future posts).
+
**v1.10.4.1** *(2015-03-09)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.1/builds/4chan-X-noupdate.crx "Chromium version")]
- Fix updater beeping on posts to not completely read thread.
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index 01628eebd..23a1440ed 100644
Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ
diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js
index 0cb716482..a377b6de8 100644
--- a/builds/4chan-X-beta.meta.js
+++ b/builds/4chan-X-beta.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.10.4.1
+// @version 1.10.4.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js
index 430b2a65b..5b095428b 100644
--- a/builds/4chan-X-beta.user.js
+++ b/builds/4chan-X-beta.user.js
@@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X beta
-// @version 1.10.4.1
+// @version 1.10.4.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -395,7 +395,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.4.1',
+ VERSION: '1.10.4.2',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -3672,7 +3672,7 @@
threads.push(thread);
}
Index.nodes.push(threadRoot);
- if (!(thread.ID in thread.posts)) {
+ if (!(thread.OP && !thread.OP.isFetchedQuote)) {
posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
}
thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
@@ -3709,7 +3709,7 @@
nodes = [];
for (q = 0, len2 = lastReplies.length; q < len2; q++) {
data = lastReplies[q];
- if (post = thread.posts[data.no]) {
+ if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
nodes.push(post.nodes.root);
continue;
}
@@ -4234,7 +4234,12 @@
thread: function(board, data, full) {
var OP, root;
Build.spoilerRange[board] = data.custom_spoiler;
- if ((OP = board.posts[data.no]) && (root = OP.nodes.root.parentNode)) {
+ if (OP = board.posts[data.no]) {
+ if (OP.isFetchedQuote) {
+ OP = null;
+ }
+ }
+ if (OP && (root = OP.nodes.root.parentNode)) {
$.rmAll(root);
} else {
root = $.el('div', {
@@ -5686,7 +5691,7 @@
return this.catalogWatch();
}
this.catalogSet(g.BOARD);
- return Thread.callbacks.push({
+ return Post.callbacks.push({
name: 'Thread Hiding',
cb: this.node
});
@@ -5738,16 +5743,19 @@
},
node: function() {
var data;
+ if (this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
})) {
- ThreadHiding.hide(this, data.makeStub);
+ ThreadHiding.hide(this.thread, data.makeStub);
}
if (!Conf['Thread Hiding Buttons']) {
return;
}
- return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide'));
+ return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
},
onIndexBuild: function(nodes) {
var k, len1, root, thread;
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index ecfb09b94..38f9e7650 100644
Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ
diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js
index 4290b0f88..42cdcea47 100644
--- a/builds/4chan-X-noupdate.user.js
+++ b/builds/4chan-X-noupdate.user.js
@@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
-// @version 1.10.4.1
+// @version 1.10.4.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -394,7 +394,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.4.1',
+ VERSION: '1.10.4.2',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -3671,7 +3671,7 @@
threads.push(thread);
}
Index.nodes.push(threadRoot);
- if (!(thread.ID in thread.posts)) {
+ if (!(thread.OP && !thread.OP.isFetchedQuote)) {
posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
}
thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
@@ -3708,7 +3708,7 @@
nodes = [];
for (q = 0, len2 = lastReplies.length; q < len2; q++) {
data = lastReplies[q];
- if (post = thread.posts[data.no]) {
+ if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
nodes.push(post.nodes.root);
continue;
}
@@ -4233,7 +4233,12 @@
thread: function(board, data, full) {
var OP, root;
Build.spoilerRange[board] = data.custom_spoiler;
- if ((OP = board.posts[data.no]) && (root = OP.nodes.root.parentNode)) {
+ if (OP = board.posts[data.no]) {
+ if (OP.isFetchedQuote) {
+ OP = null;
+ }
+ }
+ if (OP && (root = OP.nodes.root.parentNode)) {
$.rmAll(root);
} else {
root = $.el('div', {
@@ -5685,7 +5690,7 @@
return this.catalogWatch();
}
this.catalogSet(g.BOARD);
- return Thread.callbacks.push({
+ return Post.callbacks.push({
name: 'Thread Hiding',
cb: this.node
});
@@ -5737,16 +5742,19 @@
},
node: function() {
var data;
+ if (this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
})) {
- ThreadHiding.hide(this, data.makeStub);
+ ThreadHiding.hide(this.thread, data.makeStub);
}
if (!Conf['Thread Hiding Buttons']) {
return;
}
- return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide'));
+ return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
},
onIndexBuild: function(nodes) {
var k, len1, root, thread;
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 060b3594b..fa5c6c64d 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index 0db3a5c7f..db0936797 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.10.4.1
+// @version 1.10.4.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 73a17cee1..2c3f942f8 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
-// @version 1.10.4.1
+// @version 1.10.4.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -395,7 +395,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.4.1',
+ VERSION: '1.10.4.2',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -3672,7 +3672,7 @@
threads.push(thread);
}
Index.nodes.push(threadRoot);
- if (!(thread.ID in thread.posts)) {
+ if (!(thread.OP && !thread.OP.isFetchedQuote)) {
posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
}
thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
@@ -3709,7 +3709,7 @@
nodes = [];
for (q = 0, len2 = lastReplies.length; q < len2; q++) {
data = lastReplies[q];
- if (post = thread.posts[data.no]) {
+ if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
nodes.push(post.nodes.root);
continue;
}
@@ -4234,7 +4234,12 @@
thread: function(board, data, full) {
var OP, root;
Build.spoilerRange[board] = data.custom_spoiler;
- if ((OP = board.posts[data.no]) && (root = OP.nodes.root.parentNode)) {
+ if (OP = board.posts[data.no]) {
+ if (OP.isFetchedQuote) {
+ OP = null;
+ }
+ }
+ if (OP && (root = OP.nodes.root.parentNode)) {
$.rmAll(root);
} else {
root = $.el('div', {
@@ -5686,7 +5691,7 @@
return this.catalogWatch();
}
this.catalogSet(g.BOARD);
- return Thread.callbacks.push({
+ return Post.callbacks.push({
name: 'Thread Hiding',
cb: this.node
});
@@ -5738,16 +5743,19 @@
},
node: function() {
var data;
+ if (this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
})) {
- ThreadHiding.hide(this, data.makeStub);
+ ThreadHiding.hide(this.thread, data.makeStub);
}
if (!Conf['Thread Hiding Buttons']) {
return;
}
- return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide'));
+ return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
},
onIndexBuild: function(nodes) {
var k, len1, root, thread;
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index 85bbb7992..ce37006b7 100644
Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ
diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml
index 4a4e328ea..e35b1bafc 100644
--- a/builds/updates-beta.xml
+++ b/builds/updates-beta.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/builds/updates.xml b/builds/updates.xml
index 2502f0ffd..b64b8db4e 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/package.json b/package.json
index 4f3d3b9e7..3c575f1c9 100755
--- a/package.json
+++ b/package.json
@@ -3,8 +3,8 @@
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",
- "version": "1.10.4.1",
- "date": "2015-03-09T12:22:32.151Z",
+ "version": "1.10.4.2",
+ "date": "2015-03-10T03:18:00.112Z",
"repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/",