Release 4chan X v1.10.4.3.
This commit is contained in:
parent
a3dc18ce82
commit
70125f2387
@ -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
|
||||||
|
|
||||||
|
**v1.10.4.3** *(2015-03-10)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.3/builds/4chan-X-noupdate.crx "Chromium version")]
|
||||||
|
- Fix false-positive deleted posts again.
|
||||||
|
|
||||||
**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")]
|
**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).
|
- Fix bugs when posts are previewed before they appear in the index (by links to future posts).
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X beta
|
// @name 4chan X beta
|
||||||
// @version 1.10.4.2
|
// @version 1.10.4.3
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X beta
|
// @name 4chan X beta
|
||||||
// @version 1.10.4.2
|
// @version 1.10.4.3
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -395,7 +395,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.10.4.2',
|
VERSION: '1.10.4.3',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
NAME: '4chan X',
|
NAME: '4chan X',
|
||||||
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
||||||
@ -1419,6 +1419,35 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Post.prototype.resurrect = function() {
|
||||||
|
var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
|
||||||
|
delete this.isDead;
|
||||||
|
$.rmClass(this.nodes.root, 'deleted-post');
|
||||||
|
strong = $('strong.warning', this.nodes.info);
|
||||||
|
if (this.file && this.file.isDead) {
|
||||||
|
strong.textContent = '[File deleted]';
|
||||||
|
} else {
|
||||||
|
$.rm(strong);
|
||||||
|
}
|
||||||
|
if (this.isClone) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ref = this.clones;
|
||||||
|
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||||
|
clone = ref[k];
|
||||||
|
clone.resurrect();
|
||||||
|
}
|
||||||
|
ref1 = Get.allQuotelinksLinkingTo(this);
|
||||||
|
for (q = 0, len2 = ref1.length; q < len2; q++) {
|
||||||
|
quotelink = ref1[q];
|
||||||
|
if (!($.hasClass(quotelink, 'deadlink'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
|
||||||
|
$.rmClass(quotelink, 'deadlink');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Post.prototype.collect = function() {
|
Post.prototype.collect = function() {
|
||||||
this.kill();
|
this.kill();
|
||||||
g.posts.rm(this.fullID);
|
g.posts.rm(this.fullID);
|
||||||
@ -11894,6 +11923,9 @@
|
|||||||
var fileCount, postCount;
|
var fileCount, postCount;
|
||||||
postCount = 0;
|
postCount = 0;
|
||||||
fileCount = 0;
|
fileCount = 0;
|
||||||
|
if (this.board.ID === 'f') {
|
||||||
|
fileCount++;
|
||||||
|
}
|
||||||
this.posts.forEach(function(post) {
|
this.posts.forEach(function(post) {
|
||||||
postCount++;
|
postCount++;
|
||||||
if (post.file) {
|
if (post.file) {
|
||||||
@ -12056,13 +12088,15 @@
|
|||||||
node: function() {
|
node: function() {
|
||||||
ThreadUpdater.thread = this;
|
ThreadUpdater.thread = this;
|
||||||
ThreadUpdater.root = this.OP.nodes.root.parentNode;
|
ThreadUpdater.root = this.OP.nodes.root.parentNode;
|
||||||
ThreadUpdater.lastPost = +this.posts.keys[this.posts.keys.length - 1];
|
|
||||||
ThreadUpdater.outdateCount = 0;
|
ThreadUpdater.outdateCount = 0;
|
||||||
ThreadUpdater.postIDs = [];
|
ThreadUpdater.postIDs = [];
|
||||||
ThreadUpdater.fileIDs = [];
|
ThreadUpdater.fileIDs = [];
|
||||||
|
if (this.board.ID === 'f') {
|
||||||
|
ThreadUpdater.fileIDs.push(this.ID);
|
||||||
|
}
|
||||||
this.posts.forEach(function(post) {
|
this.posts.forEach(function(post) {
|
||||||
ThreadUpdater.postIDs.push(post.ID);
|
ThreadUpdater.postIDs.push(post.ID);
|
||||||
if (post.file && !post.file.isDead) {
|
if (post.file) {
|
||||||
return ThreadUpdater.fileIDs.push(post.ID);
|
return ThreadUpdater.fileIDs.push(post.ID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -12283,18 +12317,17 @@
|
|||||||
return new Notice('info', "The thread is " + change + ".", 30);
|
return new Notice('info', "The thread is " + change + ".", 30);
|
||||||
},
|
},
|
||||||
parse: function(req) {
|
parse: function(req) {
|
||||||
var ID, OP, board, count, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastModified, len1, len2, len3, len4, node, num, post, postObject, postObjects, posts, q, ref, ref1, ref2, scroll, thread, u, w;
|
var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, scroll, thread, u, w;
|
||||||
lastModified = new Date(req.getResponseHeader('Last-Modified'));
|
|
||||||
if (ThreadUpdater.lastModified && lastModified < ThreadUpdater.lastModified) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ThreadUpdater.lastModified = lastModified;
|
|
||||||
postObjects = req.response.posts;
|
postObjects = req.response.posts;
|
||||||
OP = postObjects[0];
|
OP = postObjects[0];
|
||||||
thread = ThreadUpdater.thread;
|
thread = ThreadUpdater.thread;
|
||||||
board = thread.board;
|
board = thread.board;
|
||||||
|
ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
|
||||||
|
if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Build.spoilerRange[board] = OP.custom_spoiler;
|
Build.spoilerRange[board] = OP.custom_spoiler;
|
||||||
thread.setStatus('Archived', !!+OP.archived);
|
thread.setStatus('Archived', !!OP.archived);
|
||||||
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
|
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
|
||||||
ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
|
ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
|
||||||
thread.postLimit = !!OP.bumplimit;
|
thread.postLimit = !!OP.bumplimit;
|
||||||
@ -12305,28 +12338,32 @@
|
|||||||
posts = [];
|
posts = [];
|
||||||
index = [];
|
index = [];
|
||||||
files = [];
|
files = [];
|
||||||
count = 0;
|
newPosts = [];
|
||||||
for (k = 0, len1 = postObjects.length; k < len1; k++) {
|
for (k = 0, len1 = postObjects.length; k < len1; k++) {
|
||||||
postObject = postObjects[k];
|
postObject = postObjects[k];
|
||||||
num = postObject.no;
|
ID = postObject.no;
|
||||||
index.push(num);
|
index.push(ID);
|
||||||
if (postObject.fsize) {
|
if (postObject.fsize) {
|
||||||
files.push(num);
|
files.push(ID);
|
||||||
}
|
}
|
||||||
if (num <= ThreadUpdater.lastPost) {
|
if (ID <= lastPost) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newPosts.push(board + "." + ID);
|
||||||
|
if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
|
||||||
|
post.resurrect();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
count++;
|
|
||||||
node = Build.postFromObject(postObject, board.ID);
|
node = Build.postFromObject(postObject, board.ID);
|
||||||
posts.push(new Post(node, thread, board));
|
posts.push(new Post(node, thread, board));
|
||||||
if (ThreadUpdater.postID === num) {
|
if (ThreadUpdater.postID === ID) {
|
||||||
delete ThreadUpdater.postID;
|
delete ThreadUpdater.postID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deletedPosts = [];
|
deletedPosts = [];
|
||||||
ref = ThreadUpdater.postIDs;
|
ref1 = ThreadUpdater.postIDs;
|
||||||
for (q = 0, len2 = ref.length; q < len2; q++) {
|
for (q = 0, len2 = ref1.length; q < len2; q++) {
|
||||||
ID = ref[q];
|
ID = ref1[q];
|
||||||
if (!(indexOf.call(index, ID) < 0)) {
|
if (!(indexOf.call(index, ID) < 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -12335,20 +12372,20 @@
|
|||||||
}
|
}
|
||||||
ThreadUpdater.postIDs = index;
|
ThreadUpdater.postIDs = index;
|
||||||
deletedFiles = [];
|
deletedFiles = [];
|
||||||
ref1 = ThreadUpdater.fileIDs;
|
ref2 = ThreadUpdater.fileIDs;
|
||||||
for (u = 0, len3 = ref1.length; u < len3; u++) {
|
for (u = 0, len3 = ref2.length; u < len3; u++) {
|
||||||
ID = ref1[u];
|
ID = ref2[u];
|
||||||
if (!(!(indexOf.call(files, ID) >= 0 || (ref2 = board + "." + ID, indexOf.call(deletedPosts, ref2) >= 0)))) {
|
if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
thread.posts[ID].kill(true);
|
thread.posts[ID].kill(true);
|
||||||
deletedFiles.push(board + "." + ID);
|
deletedFiles.push(board + "." + ID);
|
||||||
}
|
}
|
||||||
ThreadUpdater.fileIDs = files;
|
ThreadUpdater.fileIDs = files;
|
||||||
if (!count) {
|
if (!posts.length) {
|
||||||
ThreadUpdater.set('status', '');
|
ThreadUpdater.set('status', '');
|
||||||
} else {
|
} else {
|
||||||
ThreadUpdater.set('status', "+" + count, 'new');
|
ThreadUpdater.set('status', "+" + posts.length, 'new');
|
||||||
ThreadUpdater.outdateCount = 0;
|
ThreadUpdater.outdateCount = 0;
|
||||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.size) {
|
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.size) {
|
||||||
if (!ThreadUpdater.audio) {
|
if (!ThreadUpdater.audio) {
|
||||||
@ -12358,7 +12395,6 @@
|
|||||||
}
|
}
|
||||||
ThreadUpdater.audio.play();
|
ThreadUpdater.audio.play();
|
||||||
}
|
}
|
||||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
|
||||||
Main.callbackNodes(Post, posts);
|
Main.callbackNodes(Post, posts);
|
||||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||||
firstPost = null;
|
firstPost = null;
|
||||||
@ -12388,19 +12424,11 @@
|
|||||||
return $.event('ThreadUpdate', {
|
return $.event('ThreadUpdate', {
|
||||||
404: false,
|
404: false,
|
||||||
threadID: thread.fullID,
|
threadID: thread.fullID,
|
||||||
newPosts: (function() {
|
newPosts: newPosts,
|
||||||
var len5, results, y;
|
|
||||||
results = [];
|
|
||||||
for (y = 0, len5 = posts.length; y < len5; y++) {
|
|
||||||
post = posts[y];
|
|
||||||
results.push(post.fullID);
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
})(),
|
|
||||||
deletedPosts: deletedPosts,
|
deletedPosts: deletedPosts,
|
||||||
deletedFiles: deletedFiles,
|
deletedFiles: deletedFiles,
|
||||||
postCount: OP.replies + 1,
|
postCount: OP.replies + 1,
|
||||||
fileCount: OP.images + (!!thread.OP.file && !thread.OP.file.isDead),
|
fileCount: OP.images + !!OP.fsize,
|
||||||
ipCount: OP.unique_ips
|
ipCount: OP.unique_ips
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.10.4.2
|
// @version 1.10.4.3
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -394,7 +394,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.10.4.2',
|
VERSION: '1.10.4.3',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
NAME: '4chan X',
|
NAME: '4chan X',
|
||||||
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
||||||
@ -1418,6 +1418,35 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Post.prototype.resurrect = function() {
|
||||||
|
var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
|
||||||
|
delete this.isDead;
|
||||||
|
$.rmClass(this.nodes.root, 'deleted-post');
|
||||||
|
strong = $('strong.warning', this.nodes.info);
|
||||||
|
if (this.file && this.file.isDead) {
|
||||||
|
strong.textContent = '[File deleted]';
|
||||||
|
} else {
|
||||||
|
$.rm(strong);
|
||||||
|
}
|
||||||
|
if (this.isClone) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ref = this.clones;
|
||||||
|
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||||
|
clone = ref[k];
|
||||||
|
clone.resurrect();
|
||||||
|
}
|
||||||
|
ref1 = Get.allQuotelinksLinkingTo(this);
|
||||||
|
for (q = 0, len2 = ref1.length; q < len2; q++) {
|
||||||
|
quotelink = ref1[q];
|
||||||
|
if (!($.hasClass(quotelink, 'deadlink'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
|
||||||
|
$.rmClass(quotelink, 'deadlink');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Post.prototype.collect = function() {
|
Post.prototype.collect = function() {
|
||||||
this.kill();
|
this.kill();
|
||||||
g.posts.rm(this.fullID);
|
g.posts.rm(this.fullID);
|
||||||
@ -11893,6 +11922,9 @@
|
|||||||
var fileCount, postCount;
|
var fileCount, postCount;
|
||||||
postCount = 0;
|
postCount = 0;
|
||||||
fileCount = 0;
|
fileCount = 0;
|
||||||
|
if (this.board.ID === 'f') {
|
||||||
|
fileCount++;
|
||||||
|
}
|
||||||
this.posts.forEach(function(post) {
|
this.posts.forEach(function(post) {
|
||||||
postCount++;
|
postCount++;
|
||||||
if (post.file) {
|
if (post.file) {
|
||||||
@ -12055,13 +12087,15 @@
|
|||||||
node: function() {
|
node: function() {
|
||||||
ThreadUpdater.thread = this;
|
ThreadUpdater.thread = this;
|
||||||
ThreadUpdater.root = this.OP.nodes.root.parentNode;
|
ThreadUpdater.root = this.OP.nodes.root.parentNode;
|
||||||
ThreadUpdater.lastPost = +this.posts.keys[this.posts.keys.length - 1];
|
|
||||||
ThreadUpdater.outdateCount = 0;
|
ThreadUpdater.outdateCount = 0;
|
||||||
ThreadUpdater.postIDs = [];
|
ThreadUpdater.postIDs = [];
|
||||||
ThreadUpdater.fileIDs = [];
|
ThreadUpdater.fileIDs = [];
|
||||||
|
if (this.board.ID === 'f') {
|
||||||
|
ThreadUpdater.fileIDs.push(this.ID);
|
||||||
|
}
|
||||||
this.posts.forEach(function(post) {
|
this.posts.forEach(function(post) {
|
||||||
ThreadUpdater.postIDs.push(post.ID);
|
ThreadUpdater.postIDs.push(post.ID);
|
||||||
if (post.file && !post.file.isDead) {
|
if (post.file) {
|
||||||
return ThreadUpdater.fileIDs.push(post.ID);
|
return ThreadUpdater.fileIDs.push(post.ID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -12282,18 +12316,17 @@
|
|||||||
return new Notice('info', "The thread is " + change + ".", 30);
|
return new Notice('info', "The thread is " + change + ".", 30);
|
||||||
},
|
},
|
||||||
parse: function(req) {
|
parse: function(req) {
|
||||||
var ID, OP, board, count, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastModified, len1, len2, len3, len4, node, num, post, postObject, postObjects, posts, q, ref, ref1, ref2, scroll, thread, u, w;
|
var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, scroll, thread, u, w;
|
||||||
lastModified = new Date(req.getResponseHeader('Last-Modified'));
|
|
||||||
if (ThreadUpdater.lastModified && lastModified < ThreadUpdater.lastModified) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ThreadUpdater.lastModified = lastModified;
|
|
||||||
postObjects = req.response.posts;
|
postObjects = req.response.posts;
|
||||||
OP = postObjects[0];
|
OP = postObjects[0];
|
||||||
thread = ThreadUpdater.thread;
|
thread = ThreadUpdater.thread;
|
||||||
board = thread.board;
|
board = thread.board;
|
||||||
|
ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
|
||||||
|
if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Build.spoilerRange[board] = OP.custom_spoiler;
|
Build.spoilerRange[board] = OP.custom_spoiler;
|
||||||
thread.setStatus('Archived', !!+OP.archived);
|
thread.setStatus('Archived', !!OP.archived);
|
||||||
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
|
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
|
||||||
ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
|
ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
|
||||||
thread.postLimit = !!OP.bumplimit;
|
thread.postLimit = !!OP.bumplimit;
|
||||||
@ -12304,28 +12337,32 @@
|
|||||||
posts = [];
|
posts = [];
|
||||||
index = [];
|
index = [];
|
||||||
files = [];
|
files = [];
|
||||||
count = 0;
|
newPosts = [];
|
||||||
for (k = 0, len1 = postObjects.length; k < len1; k++) {
|
for (k = 0, len1 = postObjects.length; k < len1; k++) {
|
||||||
postObject = postObjects[k];
|
postObject = postObjects[k];
|
||||||
num = postObject.no;
|
ID = postObject.no;
|
||||||
index.push(num);
|
index.push(ID);
|
||||||
if (postObject.fsize) {
|
if (postObject.fsize) {
|
||||||
files.push(num);
|
files.push(ID);
|
||||||
}
|
}
|
||||||
if (num <= ThreadUpdater.lastPost) {
|
if (ID <= lastPost) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newPosts.push(board + "." + ID);
|
||||||
|
if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
|
||||||
|
post.resurrect();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
count++;
|
|
||||||
node = Build.postFromObject(postObject, board.ID);
|
node = Build.postFromObject(postObject, board.ID);
|
||||||
posts.push(new Post(node, thread, board));
|
posts.push(new Post(node, thread, board));
|
||||||
if (ThreadUpdater.postID === num) {
|
if (ThreadUpdater.postID === ID) {
|
||||||
delete ThreadUpdater.postID;
|
delete ThreadUpdater.postID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deletedPosts = [];
|
deletedPosts = [];
|
||||||
ref = ThreadUpdater.postIDs;
|
ref1 = ThreadUpdater.postIDs;
|
||||||
for (q = 0, len2 = ref.length; q < len2; q++) {
|
for (q = 0, len2 = ref1.length; q < len2; q++) {
|
||||||
ID = ref[q];
|
ID = ref1[q];
|
||||||
if (!(indexOf.call(index, ID) < 0)) {
|
if (!(indexOf.call(index, ID) < 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -12334,20 +12371,20 @@
|
|||||||
}
|
}
|
||||||
ThreadUpdater.postIDs = index;
|
ThreadUpdater.postIDs = index;
|
||||||
deletedFiles = [];
|
deletedFiles = [];
|
||||||
ref1 = ThreadUpdater.fileIDs;
|
ref2 = ThreadUpdater.fileIDs;
|
||||||
for (u = 0, len3 = ref1.length; u < len3; u++) {
|
for (u = 0, len3 = ref2.length; u < len3; u++) {
|
||||||
ID = ref1[u];
|
ID = ref2[u];
|
||||||
if (!(!(indexOf.call(files, ID) >= 0 || (ref2 = board + "." + ID, indexOf.call(deletedPosts, ref2) >= 0)))) {
|
if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
thread.posts[ID].kill(true);
|
thread.posts[ID].kill(true);
|
||||||
deletedFiles.push(board + "." + ID);
|
deletedFiles.push(board + "." + ID);
|
||||||
}
|
}
|
||||||
ThreadUpdater.fileIDs = files;
|
ThreadUpdater.fileIDs = files;
|
||||||
if (!count) {
|
if (!posts.length) {
|
||||||
ThreadUpdater.set('status', '');
|
ThreadUpdater.set('status', '');
|
||||||
} else {
|
} else {
|
||||||
ThreadUpdater.set('status', "+" + count, 'new');
|
ThreadUpdater.set('status', "+" + posts.length, 'new');
|
||||||
ThreadUpdater.outdateCount = 0;
|
ThreadUpdater.outdateCount = 0;
|
||||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.size) {
|
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.size) {
|
||||||
if (!ThreadUpdater.audio) {
|
if (!ThreadUpdater.audio) {
|
||||||
@ -12357,7 +12394,6 @@
|
|||||||
}
|
}
|
||||||
ThreadUpdater.audio.play();
|
ThreadUpdater.audio.play();
|
||||||
}
|
}
|
||||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
|
||||||
Main.callbackNodes(Post, posts);
|
Main.callbackNodes(Post, posts);
|
||||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||||
firstPost = null;
|
firstPost = null;
|
||||||
@ -12387,19 +12423,11 @@
|
|||||||
return $.event('ThreadUpdate', {
|
return $.event('ThreadUpdate', {
|
||||||
404: false,
|
404: false,
|
||||||
threadID: thread.fullID,
|
threadID: thread.fullID,
|
||||||
newPosts: (function() {
|
newPosts: newPosts,
|
||||||
var len5, results, y;
|
|
||||||
results = [];
|
|
||||||
for (y = 0, len5 = posts.length; y < len5; y++) {
|
|
||||||
post = posts[y];
|
|
||||||
results.push(post.fullID);
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
})(),
|
|
||||||
deletedPosts: deletedPosts,
|
deletedPosts: deletedPosts,
|
||||||
deletedFiles: deletedFiles,
|
deletedFiles: deletedFiles,
|
||||||
postCount: OP.replies + 1,
|
postCount: OP.replies + 1,
|
||||||
fileCount: OP.images + (!!thread.OP.file && !thread.OP.file.isDead),
|
fileCount: OP.images + !!OP.fsize,
|
||||||
ipCount: OP.unique_ips
|
ipCount: OP.unique_ips
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.10.4.2
|
// @version 1.10.4.3
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.10.4.2
|
// @version 1.10.4.3
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -395,7 +395,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.10.4.2',
|
VERSION: '1.10.4.3',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
NAME: '4chan X',
|
NAME: '4chan X',
|
||||||
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
||||||
@ -1419,6 +1419,35 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Post.prototype.resurrect = function() {
|
||||||
|
var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
|
||||||
|
delete this.isDead;
|
||||||
|
$.rmClass(this.nodes.root, 'deleted-post');
|
||||||
|
strong = $('strong.warning', this.nodes.info);
|
||||||
|
if (this.file && this.file.isDead) {
|
||||||
|
strong.textContent = '[File deleted]';
|
||||||
|
} else {
|
||||||
|
$.rm(strong);
|
||||||
|
}
|
||||||
|
if (this.isClone) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ref = this.clones;
|
||||||
|
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||||
|
clone = ref[k];
|
||||||
|
clone.resurrect();
|
||||||
|
}
|
||||||
|
ref1 = Get.allQuotelinksLinkingTo(this);
|
||||||
|
for (q = 0, len2 = ref1.length; q < len2; q++) {
|
||||||
|
quotelink = ref1[q];
|
||||||
|
if (!($.hasClass(quotelink, 'deadlink'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
|
||||||
|
$.rmClass(quotelink, 'deadlink');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Post.prototype.collect = function() {
|
Post.prototype.collect = function() {
|
||||||
this.kill();
|
this.kill();
|
||||||
g.posts.rm(this.fullID);
|
g.posts.rm(this.fullID);
|
||||||
@ -11894,6 +11923,9 @@
|
|||||||
var fileCount, postCount;
|
var fileCount, postCount;
|
||||||
postCount = 0;
|
postCount = 0;
|
||||||
fileCount = 0;
|
fileCount = 0;
|
||||||
|
if (this.board.ID === 'f') {
|
||||||
|
fileCount++;
|
||||||
|
}
|
||||||
this.posts.forEach(function(post) {
|
this.posts.forEach(function(post) {
|
||||||
postCount++;
|
postCount++;
|
||||||
if (post.file) {
|
if (post.file) {
|
||||||
@ -12056,13 +12088,15 @@
|
|||||||
node: function() {
|
node: function() {
|
||||||
ThreadUpdater.thread = this;
|
ThreadUpdater.thread = this;
|
||||||
ThreadUpdater.root = this.OP.nodes.root.parentNode;
|
ThreadUpdater.root = this.OP.nodes.root.parentNode;
|
||||||
ThreadUpdater.lastPost = +this.posts.keys[this.posts.keys.length - 1];
|
|
||||||
ThreadUpdater.outdateCount = 0;
|
ThreadUpdater.outdateCount = 0;
|
||||||
ThreadUpdater.postIDs = [];
|
ThreadUpdater.postIDs = [];
|
||||||
ThreadUpdater.fileIDs = [];
|
ThreadUpdater.fileIDs = [];
|
||||||
|
if (this.board.ID === 'f') {
|
||||||
|
ThreadUpdater.fileIDs.push(this.ID);
|
||||||
|
}
|
||||||
this.posts.forEach(function(post) {
|
this.posts.forEach(function(post) {
|
||||||
ThreadUpdater.postIDs.push(post.ID);
|
ThreadUpdater.postIDs.push(post.ID);
|
||||||
if (post.file && !post.file.isDead) {
|
if (post.file) {
|
||||||
return ThreadUpdater.fileIDs.push(post.ID);
|
return ThreadUpdater.fileIDs.push(post.ID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -12283,18 +12317,17 @@
|
|||||||
return new Notice('info', "The thread is " + change + ".", 30);
|
return new Notice('info', "The thread is " + change + ".", 30);
|
||||||
},
|
},
|
||||||
parse: function(req) {
|
parse: function(req) {
|
||||||
var ID, OP, board, count, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastModified, len1, len2, len3, len4, node, num, post, postObject, postObjects, posts, q, ref, ref1, ref2, scroll, thread, u, w;
|
var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, scroll, thread, u, w;
|
||||||
lastModified = new Date(req.getResponseHeader('Last-Modified'));
|
|
||||||
if (ThreadUpdater.lastModified && lastModified < ThreadUpdater.lastModified) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ThreadUpdater.lastModified = lastModified;
|
|
||||||
postObjects = req.response.posts;
|
postObjects = req.response.posts;
|
||||||
OP = postObjects[0];
|
OP = postObjects[0];
|
||||||
thread = ThreadUpdater.thread;
|
thread = ThreadUpdater.thread;
|
||||||
board = thread.board;
|
board = thread.board;
|
||||||
|
ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
|
||||||
|
if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Build.spoilerRange[board] = OP.custom_spoiler;
|
Build.spoilerRange[board] = OP.custom_spoiler;
|
||||||
thread.setStatus('Archived', !!+OP.archived);
|
thread.setStatus('Archived', !!OP.archived);
|
||||||
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
|
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
|
||||||
ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
|
ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
|
||||||
thread.postLimit = !!OP.bumplimit;
|
thread.postLimit = !!OP.bumplimit;
|
||||||
@ -12305,28 +12338,32 @@
|
|||||||
posts = [];
|
posts = [];
|
||||||
index = [];
|
index = [];
|
||||||
files = [];
|
files = [];
|
||||||
count = 0;
|
newPosts = [];
|
||||||
for (k = 0, len1 = postObjects.length; k < len1; k++) {
|
for (k = 0, len1 = postObjects.length; k < len1; k++) {
|
||||||
postObject = postObjects[k];
|
postObject = postObjects[k];
|
||||||
num = postObject.no;
|
ID = postObject.no;
|
||||||
index.push(num);
|
index.push(ID);
|
||||||
if (postObject.fsize) {
|
if (postObject.fsize) {
|
||||||
files.push(num);
|
files.push(ID);
|
||||||
}
|
}
|
||||||
if (num <= ThreadUpdater.lastPost) {
|
if (ID <= lastPost) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newPosts.push(board + "." + ID);
|
||||||
|
if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
|
||||||
|
post.resurrect();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
count++;
|
|
||||||
node = Build.postFromObject(postObject, board.ID);
|
node = Build.postFromObject(postObject, board.ID);
|
||||||
posts.push(new Post(node, thread, board));
|
posts.push(new Post(node, thread, board));
|
||||||
if (ThreadUpdater.postID === num) {
|
if (ThreadUpdater.postID === ID) {
|
||||||
delete ThreadUpdater.postID;
|
delete ThreadUpdater.postID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deletedPosts = [];
|
deletedPosts = [];
|
||||||
ref = ThreadUpdater.postIDs;
|
ref1 = ThreadUpdater.postIDs;
|
||||||
for (q = 0, len2 = ref.length; q < len2; q++) {
|
for (q = 0, len2 = ref1.length; q < len2; q++) {
|
||||||
ID = ref[q];
|
ID = ref1[q];
|
||||||
if (!(indexOf.call(index, ID) < 0)) {
|
if (!(indexOf.call(index, ID) < 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -12335,20 +12372,20 @@
|
|||||||
}
|
}
|
||||||
ThreadUpdater.postIDs = index;
|
ThreadUpdater.postIDs = index;
|
||||||
deletedFiles = [];
|
deletedFiles = [];
|
||||||
ref1 = ThreadUpdater.fileIDs;
|
ref2 = ThreadUpdater.fileIDs;
|
||||||
for (u = 0, len3 = ref1.length; u < len3; u++) {
|
for (u = 0, len3 = ref2.length; u < len3; u++) {
|
||||||
ID = ref1[u];
|
ID = ref2[u];
|
||||||
if (!(!(indexOf.call(files, ID) >= 0 || (ref2 = board + "." + ID, indexOf.call(deletedPosts, ref2) >= 0)))) {
|
if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
thread.posts[ID].kill(true);
|
thread.posts[ID].kill(true);
|
||||||
deletedFiles.push(board + "." + ID);
|
deletedFiles.push(board + "." + ID);
|
||||||
}
|
}
|
||||||
ThreadUpdater.fileIDs = files;
|
ThreadUpdater.fileIDs = files;
|
||||||
if (!count) {
|
if (!posts.length) {
|
||||||
ThreadUpdater.set('status', '');
|
ThreadUpdater.set('status', '');
|
||||||
} else {
|
} else {
|
||||||
ThreadUpdater.set('status', "+" + count, 'new');
|
ThreadUpdater.set('status', "+" + posts.length, 'new');
|
||||||
ThreadUpdater.outdateCount = 0;
|
ThreadUpdater.outdateCount = 0;
|
||||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.size) {
|
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.size) {
|
||||||
if (!ThreadUpdater.audio) {
|
if (!ThreadUpdater.audio) {
|
||||||
@ -12358,7 +12395,6 @@
|
|||||||
}
|
}
|
||||||
ThreadUpdater.audio.play();
|
ThreadUpdater.audio.play();
|
||||||
}
|
}
|
||||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
|
||||||
Main.callbackNodes(Post, posts);
|
Main.callbackNodes(Post, posts);
|
||||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||||
firstPost = null;
|
firstPost = null;
|
||||||
@ -12388,19 +12424,11 @@
|
|||||||
return $.event('ThreadUpdate', {
|
return $.event('ThreadUpdate', {
|
||||||
404: false,
|
404: false,
|
||||||
threadID: thread.fullID,
|
threadID: thread.fullID,
|
||||||
newPosts: (function() {
|
newPosts: newPosts,
|
||||||
var len5, results, y;
|
|
||||||
results = [];
|
|
||||||
for (y = 0, len5 = posts.length; y < len5; y++) {
|
|
||||||
post = posts[y];
|
|
||||||
results.push(post.fullID);
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
})(),
|
|
||||||
deletedPosts: deletedPosts,
|
deletedPosts: deletedPosts,
|
||||||
deletedFiles: deletedFiles,
|
deletedFiles: deletedFiles,
|
||||||
postCount: OP.replies + 1,
|
postCount: OP.replies + 1,
|
||||||
fileCount: OP.images + (!!thread.OP.file && !thread.OP.file.isDead),
|
fileCount: OP.images + !!OP.fsize,
|
||||||
ipCount: OP.unique_ips
|
ipCount: OP.unique_ips
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.4.2' />
|
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.4.3' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.4.2' />
|
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.4.3' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||||
"meta": {
|
"meta": {
|
||||||
"name": "4chan X",
|
"name": "4chan X",
|
||||||
"version": "1.10.4.2",
|
"version": "1.10.4.3",
|
||||||
"date": "2015-03-10T03:18:00.112Z",
|
"date": "2015-03-11T06:53:35.481Z",
|
||||||
"repo": "https://github.com/ccd0/4chan-x/",
|
"repo": "https://github.com/ccd0/4chan-x/",
|
||||||
"page": "https://github.com/ccd0/4chan-x",
|
"page": "https://github.com/ccd0/4chan-x",
|
||||||
"downloads": "https://ccd0.github.io/4chan-x/builds/",
|
"downloads": "https://ccd0.github.io/4chan-x/builds/",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user