Undo Mayhem's updater changes to avoid issues, close #104
This commit is contained in:
parent
f5a3c3abd0
commit
7b466831d9
@ -7394,7 +7394,7 @@
|
||||
return $.after(root, [$.tn(' '), icon]);
|
||||
},
|
||||
parse: function(postObjects) {
|
||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, length, node, num, post, postObject, posts, scroll, sendEvent, threadID, _i, _len, _ref;
|
||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref;
|
||||
|
||||
OP = postObjects[0];
|
||||
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
||||
@ -7435,53 +7435,67 @@
|
||||
post.kill(true);
|
||||
deletedFiles.push(post);
|
||||
}
|
||||
if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
|
||||
ThreadUpdater.foundPost = true;
|
||||
}
|
||||
}
|
||||
sendEvent = function() {
|
||||
return $.event('ThreadUpdate', {
|
||||
404: false,
|
||||
thread: ThreadUpdater.thread,
|
||||
newPosts: posts,
|
||||
deletedPosts: deletedPosts,
|
||||
deletedFiles: deletedFiles,
|
||||
postCount: OP.replies + 1,
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead)
|
||||
});
|
||||
};
|
||||
if (!count) {
|
||||
ThreadUpdater.set('status', null, null);
|
||||
ThreadUpdater.outdateCount++;
|
||||
sendEvent();
|
||||
return;
|
||||
}
|
||||
ThreadUpdater.set('status', "+" + count, 'new');
|
||||
ThreadUpdater.outdateCount = 0;
|
||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) {
|
||||
if (!ThreadUpdater.audio) {
|
||||
ThreadUpdater.audio = $.el('audio', {
|
||||
src: ThreadUpdater.beep
|
||||
});
|
||||
}
|
||||
ThreadUpdater.audio.play();
|
||||
}
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
||||
Main.callbackNodes(Post, posts);
|
||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||
$.add(ThreadUpdater.root, nodes);
|
||||
sendEvent();
|
||||
if (scroll) {
|
||||
if (Conf['Bottom Scroll']) {
|
||||
doc.scrollTop = d.body.clientHeight;
|
||||
} else {
|
||||
Header.scrollToPost(nodes[0]);
|
||||
}
|
||||
}
|
||||
threadID = ThreadUpdater.thread.ID;
|
||||
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
|
||||
if (Conf['Enable 4chan\'s Extension']) {
|
||||
return $.globalEval("Parser.parseThread(" + threadID + ", " + (-count) + ")");
|
||||
} else {
|
||||
return Fourchan.parseThread(threadID, length - count, length);
|
||||
ThreadUpdater.set('status', "+" + count, 'new');
|
||||
ThreadUpdater.outdateCount = 0;
|
||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) {
|
||||
if (!ThreadUpdater.audio) {
|
||||
ThreadUpdater.audio = $.el('audio', {
|
||||
src: ThreadUpdater.beep
|
||||
});
|
||||
}
|
||||
ThreadUpdater.audio.play();
|
||||
}
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
||||
Main.callbackNodes(Post, posts);
|
||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||
for (key in posts) {
|
||||
post = posts[key];
|
||||
if (!posts.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
root = post.nodes.root;
|
||||
if (post.cb) {
|
||||
if (!post.cb.call(post)) {
|
||||
$.add(ThreadUpdater.root, root);
|
||||
}
|
||||
} else {
|
||||
$.add(ThreadUpdater.root, root);
|
||||
}
|
||||
}
|
||||
if (scroll) {
|
||||
if (Conf['Bottom Scroll']) {
|
||||
doc.scrollTop = d.body.clientHeight;
|
||||
} else {
|
||||
if (root) {
|
||||
Header.scrollToPost(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
$.queueTask(function() {
|
||||
var length, threadID;
|
||||
|
||||
threadID = ThreadUpdater.thread.ID;
|
||||
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
|
||||
return Fourchan.parseThread(threadID, length - count, length);
|
||||
});
|
||||
}
|
||||
return $.event('ThreadUpdate', {
|
||||
404: false,
|
||||
thread: ThreadUpdater.thread,
|
||||
newPosts: posts,
|
||||
deletedPosts: deletedPosts,
|
||||
deletedFiles: deletedFiles,
|
||||
postCount: OP.replies + 1,
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -7388,7 +7388,7 @@
|
||||
return $.after(root, [$.tn(' '), icon]);
|
||||
},
|
||||
parse: function(postObjects) {
|
||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, length, node, num, post, postObject, posts, scroll, sendEvent, threadID, _i, _len, _ref;
|
||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref;
|
||||
|
||||
OP = postObjects[0];
|
||||
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
||||
@ -7429,53 +7429,67 @@
|
||||
post.kill(true);
|
||||
deletedFiles.push(post);
|
||||
}
|
||||
if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
|
||||
ThreadUpdater.foundPost = true;
|
||||
}
|
||||
}
|
||||
sendEvent = function() {
|
||||
return $.event('ThreadUpdate', {
|
||||
404: false,
|
||||
thread: ThreadUpdater.thread,
|
||||
newPosts: posts,
|
||||
deletedPosts: deletedPosts,
|
||||
deletedFiles: deletedFiles,
|
||||
postCount: OP.replies + 1,
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead)
|
||||
});
|
||||
};
|
||||
if (!count) {
|
||||
ThreadUpdater.set('status', null, null);
|
||||
ThreadUpdater.outdateCount++;
|
||||
sendEvent();
|
||||
return;
|
||||
}
|
||||
ThreadUpdater.set('status', "+" + count, 'new');
|
||||
ThreadUpdater.outdateCount = 0;
|
||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) {
|
||||
if (!ThreadUpdater.audio) {
|
||||
ThreadUpdater.audio = $.el('audio', {
|
||||
src: ThreadUpdater.beep
|
||||
});
|
||||
}
|
||||
ThreadUpdater.audio.play();
|
||||
}
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
||||
Main.callbackNodes(Post, posts);
|
||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||
$.add(ThreadUpdater.root, nodes);
|
||||
sendEvent();
|
||||
if (scroll) {
|
||||
if (Conf['Bottom Scroll']) {
|
||||
doc.scrollTop = d.body.clientHeight;
|
||||
} else {
|
||||
Header.scrollToPost(nodes[0]);
|
||||
}
|
||||
}
|
||||
threadID = ThreadUpdater.thread.ID;
|
||||
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
|
||||
if (Conf['Enable 4chan\'s Extension']) {
|
||||
return $.globalEval("Parser.parseThread(" + threadID + ", " + (-count) + ")");
|
||||
} else {
|
||||
return Fourchan.parseThread(threadID, length - count, length);
|
||||
ThreadUpdater.set('status', "+" + count, 'new');
|
||||
ThreadUpdater.outdateCount = 0;
|
||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) {
|
||||
if (!ThreadUpdater.audio) {
|
||||
ThreadUpdater.audio = $.el('audio', {
|
||||
src: ThreadUpdater.beep
|
||||
});
|
||||
}
|
||||
ThreadUpdater.audio.play();
|
||||
}
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
||||
Main.callbackNodes(Post, posts);
|
||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||
for (key in posts) {
|
||||
post = posts[key];
|
||||
if (!posts.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
root = post.nodes.root;
|
||||
if (post.cb) {
|
||||
if (!post.cb.call(post)) {
|
||||
$.add(ThreadUpdater.root, root);
|
||||
}
|
||||
} else {
|
||||
$.add(ThreadUpdater.root, root);
|
||||
}
|
||||
}
|
||||
if (scroll) {
|
||||
if (Conf['Bottom Scroll']) {
|
||||
doc.scrollTop = d.body.clientHeight;
|
||||
} else {
|
||||
if (root) {
|
||||
Header.scrollToPost(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
$.queueTask(function() {
|
||||
var length, threadID;
|
||||
|
||||
threadID = ThreadUpdater.thread.ID;
|
||||
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
|
||||
return Fourchan.parseThread(threadID, length - count, length);
|
||||
});
|
||||
}
|
||||
return $.event('ThreadUpdate', {
|
||||
404: false,
|
||||
thread: ThreadUpdater.thread,
|
||||
newPosts: posts,
|
||||
deletedPosts: deletedPosts,
|
||||
deletedFiles: deletedFiles,
|
||||
postCount: OP.replies + 1,
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -7370,7 +7370,7 @@
|
||||
return $.after(root, [$.tn(' '), icon]);
|
||||
},
|
||||
parse: function(postObjects) {
|
||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, length, node, num, post, postObject, posts, scroll, sendEvent, threadID, _i, _len, _ref;
|
||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref;
|
||||
|
||||
OP = postObjects[0];
|
||||
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
||||
@ -7411,53 +7411,67 @@
|
||||
post.kill(true);
|
||||
deletedFiles.push(post);
|
||||
}
|
||||
if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
|
||||
ThreadUpdater.foundPost = true;
|
||||
}
|
||||
}
|
||||
sendEvent = function() {
|
||||
return $.event('ThreadUpdate', {
|
||||
404: false,
|
||||
thread: ThreadUpdater.thread,
|
||||
newPosts: posts,
|
||||
deletedPosts: deletedPosts,
|
||||
deletedFiles: deletedFiles,
|
||||
postCount: OP.replies + 1,
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead)
|
||||
});
|
||||
};
|
||||
if (!count) {
|
||||
ThreadUpdater.set('status', null, null);
|
||||
ThreadUpdater.outdateCount++;
|
||||
sendEvent();
|
||||
return;
|
||||
}
|
||||
ThreadUpdater.set('status', "+" + count, 'new');
|
||||
ThreadUpdater.outdateCount = 0;
|
||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) {
|
||||
if (!ThreadUpdater.audio) {
|
||||
ThreadUpdater.audio = $.el('audio', {
|
||||
src: ThreadUpdater.beep
|
||||
});
|
||||
}
|
||||
ThreadUpdater.audio.play();
|
||||
}
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
||||
Main.callbackNodes(Post, posts);
|
||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||
$.add(ThreadUpdater.root, nodes);
|
||||
sendEvent();
|
||||
if (scroll) {
|
||||
if (Conf['Bottom Scroll']) {
|
||||
d.body.scrollTop = d.body.clientHeight;
|
||||
} else {
|
||||
Header.scrollToPost(nodes[0]);
|
||||
}
|
||||
}
|
||||
threadID = ThreadUpdater.thread.ID;
|
||||
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
|
||||
if (Conf['Enable 4chan\'s Extension']) {
|
||||
return $.globalEval("Parser.parseThread(" + threadID + ", " + (-count) + ")");
|
||||
} else {
|
||||
return Fourchan.parseThread(threadID, length - count, length);
|
||||
ThreadUpdater.set('status', "+" + count, 'new');
|
||||
ThreadUpdater.outdateCount = 0;
|
||||
if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) {
|
||||
if (!ThreadUpdater.audio) {
|
||||
ThreadUpdater.audio = $.el('audio', {
|
||||
src: ThreadUpdater.beep
|
||||
});
|
||||
}
|
||||
ThreadUpdater.audio.play();
|
||||
}
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID;
|
||||
Main.callbackNodes(Post, posts);
|
||||
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
|
||||
for (key in posts) {
|
||||
post = posts[key];
|
||||
if (!posts.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
root = post.nodes.root;
|
||||
if (post.cb) {
|
||||
if (!post.cb.call(post)) {
|
||||
$.add(ThreadUpdater.root, root);
|
||||
}
|
||||
} else {
|
||||
$.add(ThreadUpdater.root, root);
|
||||
}
|
||||
}
|
||||
if (scroll) {
|
||||
if (Conf['Bottom Scroll']) {
|
||||
d.body.scrollTop = d.body.clientHeight;
|
||||
} else {
|
||||
if (root) {
|
||||
Header.scrollToPost(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
$.queueTask(function() {
|
||||
var length, threadID;
|
||||
|
||||
threadID = ThreadUpdater.thread.ID;
|
||||
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
|
||||
return Fourchan.parseThread(threadID, length - count, length);
|
||||
});
|
||||
}
|
||||
return $.event('ThreadUpdate', {
|
||||
404: false,
|
||||
thread: ThreadUpdater.thread,
|
||||
newPosts: posts,
|
||||
deletedPosts: deletedPosts,
|
||||
deletedFiles: deletedFiles,
|
||||
postCount: OP.replies + 1,
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -288,46 +288,53 @@ ThreadUpdater =
|
||||
post.kill true
|
||||
deletedFiles.push post
|
||||
|
||||
sendEvent = ->
|
||||
$.event 'ThreadUpdate',
|
||||
404: false
|
||||
thread: ThreadUpdater.thread
|
||||
newPosts: posts
|
||||
deletedPosts: deletedPosts
|
||||
deletedFiles: deletedFiles
|
||||
postCount: OP.replies + 1
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file and !ThreadUpdater.thread.OP.file.isDead)
|
||||
if ThreadUpdater.postID and ThreadUpdater.postID is ID
|
||||
ThreadUpdater.foundPost = true
|
||||
|
||||
unless count
|
||||
ThreadUpdater.set 'status', null, null
|
||||
ThreadUpdater.outdateCount++
|
||||
sendEvent()
|
||||
return
|
||||
|
||||
ThreadUpdater.set 'status', "+#{count}", 'new'
|
||||
ThreadUpdater.outdateCount = 0
|
||||
if Conf['Beep'] and d.hidden and Unread.posts and !Unread.posts.length
|
||||
unless ThreadUpdater.audio
|
||||
ThreadUpdater.audio = $.el 'audio', src: ThreadUpdater.beep
|
||||
ThreadUpdater.audio.play()
|
||||
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID
|
||||
Main.callbackNodes Post, posts
|
||||
|
||||
scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and
|
||||
ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25
|
||||
$.add ThreadUpdater.root, nodes
|
||||
sendEvent()
|
||||
if scroll
|
||||
if Conf['Bottom Scroll']
|
||||
<% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>.scrollTop = d.body.clientHeight
|
||||
else
|
||||
Header.scrollToPost nodes[0]
|
||||
|
||||
# Enable 4chan features.
|
||||
threadID = ThreadUpdater.thread.ID
|
||||
{length} = $$ '.thread > .postContainer', ThreadUpdater.root
|
||||
if Conf['Enable 4chan\'s Extension']
|
||||
$.globalEval "Parser.parseThread(#{threadID}, #{-count})"
|
||||
else
|
||||
Fourchan.parseThread threadID, length - count, length
|
||||
ThreadUpdater.set 'status', "+#{count}", 'new'
|
||||
ThreadUpdater.outdateCount = 0
|
||||
if Conf['Beep'] and d.hidden and Unread.posts and !Unread.posts.length
|
||||
unless ThreadUpdater.audio
|
||||
ThreadUpdater.audio = $.el 'audio', src: ThreadUpdater.beep
|
||||
ThreadUpdater.audio.play()
|
||||
|
||||
ThreadUpdater.lastPost = posts[count - 1].ID
|
||||
Main.callbackNodes Post, posts
|
||||
|
||||
scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and
|
||||
ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25
|
||||
|
||||
for key, post of posts
|
||||
continue unless posts.hasOwnProperty key
|
||||
root = post.nodes.root
|
||||
if post.cb
|
||||
unless post.cb.call post
|
||||
$.add ThreadUpdater.root, root
|
||||
else
|
||||
$.add ThreadUpdater.root, root
|
||||
|
||||
if scroll
|
||||
if Conf['Bottom Scroll']
|
||||
<% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>.scrollTop = d.body.clientHeight
|
||||
else
|
||||
Header.scrollToPost root if root
|
||||
|
||||
$.queueTask ->
|
||||
# Enable 4chan features.
|
||||
threadID = ThreadUpdater.thread.ID
|
||||
{length} = $$ '.thread > .postContainer', ThreadUpdater.root
|
||||
Fourchan.parseThread threadID, length - count, length
|
||||
|
||||
$.event 'ThreadUpdate',
|
||||
404: false
|
||||
thread: ThreadUpdater.thread
|
||||
newPosts: posts
|
||||
deletedPosts: deletedPosts
|
||||
deletedFiles: deletedFiles
|
||||
postCount: OP.replies + 1
|
||||
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file and !ThreadUpdater.thread.OP.file.isDead)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user