Merge branch 'v3' into Av2
Conflicts: builds/4chan-X.js
This commit is contained in:
commit
1c7ffc4fcf
@ -9058,7 +9058,7 @@
|
|||||||
value: Conf['Interval']
|
value: Conf['Interval']
|
||||||
}));
|
}));
|
||||||
$.on(window, 'online offline', ThreadUpdater.cb.online);
|
$.on(window, 'online offline', ThreadUpdater.cb.online);
|
||||||
$.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post);
|
$.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
|
||||||
$.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
|
$.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
|
||||||
ThreadUpdater.cb.online();
|
ThreadUpdater.cb.online();
|
||||||
return Rice.nodes(ThreadUpdater.dialog);
|
return Rice.nodes(ThreadUpdater.dialog);
|
||||||
@ -9092,8 +9092,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkpost: function() {
|
checkpost: function() {
|
||||||
if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) {
|
if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 5)) {
|
||||||
return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500);
|
return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
|
||||||
}
|
}
|
||||||
ThreadUpdater.checkPostCount = 0;
|
ThreadUpdater.checkPostCount = 0;
|
||||||
delete ThreadUpdater.foundPost;
|
delete ThreadUpdater.foundPost;
|
||||||
@ -9171,7 +9171,7 @@
|
|||||||
ThreadUpdater.set('status', text, klass);
|
ThreadUpdater.set('status', text, klass);
|
||||||
}
|
}
|
||||||
if (ThreadUpdater.postID) {
|
if (ThreadUpdater.postID) {
|
||||||
ThreadUpdater.cb.checkpost(this.status);
|
ThreadUpdater.cb.checkpost();
|
||||||
}
|
}
|
||||||
return delete ThreadUpdater.req;
|
return delete ThreadUpdater.req;
|
||||||
}
|
}
|
||||||
@ -9272,7 +9272,7 @@
|
|||||||
return $.after(root, [$.tn(' '), icon]);
|
return $.after(root, [$.tn(' '), icon]);
|
||||||
},
|
},
|
||||||
parse: function(postObjects) {
|
parse: function(postObjects) {
|
||||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _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];
|
OP = postObjects[0];
|
||||||
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
||||||
@ -9313,10 +9313,8 @@
|
|||||||
post.kill(true);
|
post.kill(true);
|
||||||
deletedFiles.push(post);
|
deletedFiles.push(post);
|
||||||
}
|
}
|
||||||
if (ThreadUpdater.postID) {
|
if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
|
||||||
if (ID === ThreadUpdater.postID) {
|
ThreadUpdater.foundPost = true;
|
||||||
ThreadUpdater.foundPost = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!count) {
|
if (!count) {
|
||||||
@ -9341,19 +9339,22 @@
|
|||||||
if (!posts.hasOwnProperty(key)) {
|
if (!posts.hasOwnProperty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
root = post.nodes.root;
|
||||||
if (post.cb) {
|
if (post.cb) {
|
||||||
if (!post.cb.call(post)) {
|
if (!post.cb.call(post)) {
|
||||||
$.add(ThreadUpdater.root, post.nodes.root);
|
$.add(ThreadUpdater.root, root);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$.add(ThreadUpdater.root, post.nodes.root);
|
$.add(ThreadUpdater.root, root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scroll) {
|
if (scroll) {
|
||||||
if (Conf['Bottom Scroll']) {
|
if (Conf['Bottom Scroll']) {
|
||||||
doc.scrollTop = d.body.clientHeight;
|
doc.scrollTop = d.body.clientHeight;
|
||||||
} else {
|
} else {
|
||||||
Header.scrollToPost(nodes[0]);
|
if (root) {
|
||||||
|
Header.scrollToPost(root);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.queueTask(function() {
|
$.queueTask(function() {
|
||||||
|
|||||||
@ -9079,7 +9079,7 @@
|
|||||||
value: Conf['Interval']
|
value: Conf['Interval']
|
||||||
}));
|
}));
|
||||||
$.on(window, 'online offline', ThreadUpdater.cb.online);
|
$.on(window, 'online offline', ThreadUpdater.cb.online);
|
||||||
$.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post);
|
$.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
|
||||||
$.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
|
$.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
|
||||||
ThreadUpdater.cb.online();
|
ThreadUpdater.cb.online();
|
||||||
return Rice.nodes(ThreadUpdater.dialog);
|
return Rice.nodes(ThreadUpdater.dialog);
|
||||||
@ -9113,8 +9113,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkpost: function() {
|
checkpost: function() {
|
||||||
if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) {
|
if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 5)) {
|
||||||
return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500);
|
return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
|
||||||
}
|
}
|
||||||
ThreadUpdater.checkPostCount = 0;
|
ThreadUpdater.checkPostCount = 0;
|
||||||
delete ThreadUpdater.foundPost;
|
delete ThreadUpdater.foundPost;
|
||||||
@ -9192,7 +9192,7 @@
|
|||||||
ThreadUpdater.set('status', text, klass);
|
ThreadUpdater.set('status', text, klass);
|
||||||
}
|
}
|
||||||
if (ThreadUpdater.postID) {
|
if (ThreadUpdater.postID) {
|
||||||
ThreadUpdater.cb.checkpost(this.status);
|
ThreadUpdater.cb.checkpost();
|
||||||
}
|
}
|
||||||
return delete ThreadUpdater.req;
|
return delete ThreadUpdater.req;
|
||||||
}
|
}
|
||||||
@ -9293,7 +9293,7 @@
|
|||||||
return $.after(root, [$.tn(' '), icon]);
|
return $.after(root, [$.tn(' '), icon]);
|
||||||
},
|
},
|
||||||
parse: function(postObjects) {
|
parse: function(postObjects) {
|
||||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _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];
|
OP = postObjects[0];
|
||||||
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
||||||
@ -9334,10 +9334,8 @@
|
|||||||
post.kill(true);
|
post.kill(true);
|
||||||
deletedFiles.push(post);
|
deletedFiles.push(post);
|
||||||
}
|
}
|
||||||
if (ThreadUpdater.postID) {
|
if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
|
||||||
if (ID === ThreadUpdater.postID) {
|
ThreadUpdater.foundPost = true;
|
||||||
ThreadUpdater.foundPost = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!count) {
|
if (!count) {
|
||||||
@ -9362,19 +9360,22 @@
|
|||||||
if (!posts.hasOwnProperty(key)) {
|
if (!posts.hasOwnProperty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
root = post.nodes.root;
|
||||||
if (post.cb) {
|
if (post.cb) {
|
||||||
if (!post.cb.call(post)) {
|
if (!post.cb.call(post)) {
|
||||||
$.add(ThreadUpdater.root, post.nodes.root);
|
$.add(ThreadUpdater.root, root);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$.add(ThreadUpdater.root, post.nodes.root);
|
$.add(ThreadUpdater.root, root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scroll) {
|
if (scroll) {
|
||||||
if (Conf['Bottom Scroll']) {
|
if (Conf['Bottom Scroll']) {
|
||||||
doc.scrollTop = d.body.clientHeight;
|
doc.scrollTop = d.body.clientHeight;
|
||||||
} else {
|
} else {
|
||||||
Header.scrollToPost(nodes[0]);
|
if (root) {
|
||||||
|
Header.scrollToPost(root);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.queueTask(function() {
|
$.queueTask(function() {
|
||||||
|
|||||||
@ -9056,7 +9056,7 @@
|
|||||||
value: Conf['Interval']
|
value: Conf['Interval']
|
||||||
}));
|
}));
|
||||||
$.on(window, 'online offline', ThreadUpdater.cb.online);
|
$.on(window, 'online offline', ThreadUpdater.cb.online);
|
||||||
$.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post);
|
$.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
|
||||||
$.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
|
$.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
|
||||||
ThreadUpdater.cb.online();
|
ThreadUpdater.cb.online();
|
||||||
return Rice.nodes(ThreadUpdater.dialog);
|
return Rice.nodes(ThreadUpdater.dialog);
|
||||||
@ -9090,8 +9090,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkpost: function() {
|
checkpost: function() {
|
||||||
if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) {
|
if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 5)) {
|
||||||
return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500);
|
return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
|
||||||
}
|
}
|
||||||
ThreadUpdater.checkPostCount = 0;
|
ThreadUpdater.checkPostCount = 0;
|
||||||
delete ThreadUpdater.foundPost;
|
delete ThreadUpdater.foundPost;
|
||||||
@ -9169,7 +9169,7 @@
|
|||||||
ThreadUpdater.set('status', text, klass);
|
ThreadUpdater.set('status', text, klass);
|
||||||
}
|
}
|
||||||
if (ThreadUpdater.postID) {
|
if (ThreadUpdater.postID) {
|
||||||
ThreadUpdater.cb.checkpost(this.status);
|
ThreadUpdater.cb.checkpost();
|
||||||
}
|
}
|
||||||
return delete ThreadUpdater.req;
|
return delete ThreadUpdater.req;
|
||||||
}
|
}
|
||||||
@ -9270,7 +9270,7 @@
|
|||||||
return $.after(root, [$.tn(' '), icon]);
|
return $.after(root, [$.tn(' '), icon]);
|
||||||
},
|
},
|
||||||
parse: function(postObjects) {
|
parse: function(postObjects) {
|
||||||
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _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];
|
OP = postObjects[0];
|
||||||
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
|
||||||
@ -9311,10 +9311,8 @@
|
|||||||
post.kill(true);
|
post.kill(true);
|
||||||
deletedFiles.push(post);
|
deletedFiles.push(post);
|
||||||
}
|
}
|
||||||
if (ThreadUpdater.postID) {
|
if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
|
||||||
if (ID === ThreadUpdater.postID) {
|
ThreadUpdater.foundPost = true;
|
||||||
ThreadUpdater.foundPost = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!count) {
|
if (!count) {
|
||||||
@ -9339,19 +9337,22 @@
|
|||||||
if (!posts.hasOwnProperty(key)) {
|
if (!posts.hasOwnProperty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
root = post.nodes.root;
|
||||||
if (post.cb) {
|
if (post.cb) {
|
||||||
if (!post.cb.call(post)) {
|
if (!post.cb.call(post)) {
|
||||||
$.add(ThreadUpdater.root, post.nodes.root);
|
$.add(ThreadUpdater.root, root);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$.add(ThreadUpdater.root, post.nodes.root);
|
$.add(ThreadUpdater.root, root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scroll) {
|
if (scroll) {
|
||||||
if (Conf['Bottom Scroll']) {
|
if (Conf['Bottom Scroll']) {
|
||||||
d.body.scrollTop = d.body.clientHeight;
|
d.body.scrollTop = d.body.clientHeight;
|
||||||
} else {
|
} else {
|
||||||
Header.scrollToPost(nodes[0]);
|
if (root) {
|
||||||
|
Header.scrollToPost(root);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.queueTask(function() {
|
$.queueTask(function() {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ ThreadUpdater =
|
|||||||
ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval']
|
ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval']
|
||||||
|
|
||||||
$.on window, 'online offline', ThreadUpdater.cb.online
|
$.on window, 'online offline', ThreadUpdater.cb.online
|
||||||
$.on d, 'QRPostSuccessful', ThreadUpdater.cb.post
|
$.on d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost
|
||||||
$.on d, 'visibilitychange', ThreadUpdater.cb.visibility
|
$.on d, 'visibilitychange', ThreadUpdater.cb.visibility
|
||||||
|
|
||||||
ThreadUpdater.cb.online()
|
ThreadUpdater.cb.online()
|
||||||
@ -85,7 +85,7 @@ ThreadUpdater =
|
|||||||
if ThreadUpdater.online = navigator.onLine
|
if ThreadUpdater.online = navigator.onLine
|
||||||
ThreadUpdater.outdateCount = 0
|
ThreadUpdater.outdateCount = 0
|
||||||
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
||||||
|
|
||||||
ThreadUpdater.update()
|
ThreadUpdater.update()
|
||||||
|
|
||||||
ThreadUpdater.set 'status', null, null
|
ThreadUpdater.set 'status', null, null
|
||||||
@ -98,8 +98,8 @@ ThreadUpdater =
|
|||||||
ThreadUpdater.outdateCount = 0
|
ThreadUpdater.outdateCount = 0
|
||||||
setTimeout ThreadUpdater.update, 1000 if ThreadUpdater.seconds > 2
|
setTimeout ThreadUpdater.update, 1000 if ThreadUpdater.seconds > 2
|
||||||
checkpost: ->
|
checkpost: ->
|
||||||
unless g.DEAD or ThreadUpdater.foundPost or ThreadUpdater.checkPostCount >= 10
|
unless g.DEAD or ThreadUpdater.foundPost or ThreadUpdater.checkPostCount >= 5
|
||||||
return setTimeout ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500
|
return setTimeout ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND
|
||||||
ThreadUpdater.checkPostCount = 0
|
ThreadUpdater.checkPostCount = 0
|
||||||
delete ThreadUpdater.foundPost
|
delete ThreadUpdater.foundPost
|
||||||
delete ThreadUpdater.postID
|
delete ThreadUpdater.postID
|
||||||
@ -159,7 +159,7 @@ ThreadUpdater =
|
|||||||
ThreadUpdater.set 'status', text, klass
|
ThreadUpdater.set 'status', text, klass
|
||||||
|
|
||||||
if ThreadUpdater.postID
|
if ThreadUpdater.postID
|
||||||
ThreadUpdater.cb.checkpost @status
|
ThreadUpdater.cb.checkpost()
|
||||||
|
|
||||||
delete ThreadUpdater.req
|
delete ThreadUpdater.req
|
||||||
|
|
||||||
@ -281,9 +281,9 @@ ThreadUpdater =
|
|||||||
else if post.file and !post.file.isDead and not files.contains ID
|
else if post.file and !post.file.isDead and not files.contains ID
|
||||||
post.kill true
|
post.kill true
|
||||||
deletedFiles.push post
|
deletedFiles.push post
|
||||||
if ThreadUpdater.postID
|
|
||||||
if ID is ThreadUpdater.postID
|
if ThreadUpdater.postID and ThreadUpdater.postID is ID
|
||||||
ThreadUpdater.foundPost = true
|
ThreadUpdater.foundPost = true
|
||||||
|
|
||||||
unless count
|
unless count
|
||||||
ThreadUpdater.set 'status', null, null
|
ThreadUpdater.set 'status', null, null
|
||||||
@ -305,17 +305,18 @@ ThreadUpdater =
|
|||||||
|
|
||||||
for key, post of posts
|
for key, post of posts
|
||||||
continue unless posts.hasOwnProperty key
|
continue unless posts.hasOwnProperty key
|
||||||
|
root = post.nodes.root
|
||||||
if post.cb
|
if post.cb
|
||||||
unless post.cb.call post
|
unless post.cb.call post
|
||||||
$.add ThreadUpdater.root, post.nodes.root
|
$.add ThreadUpdater.root, root
|
||||||
else
|
else
|
||||||
$.add ThreadUpdater.root, post.nodes.root
|
$.add ThreadUpdater.root, root
|
||||||
|
|
||||||
if scroll
|
if scroll
|
||||||
if Conf['Bottom Scroll']
|
if Conf['Bottom Scroll']
|
||||||
<% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>.scrollTop = d.body.clientHeight
|
<% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>.scrollTop = d.body.clientHeight
|
||||||
else
|
else
|
||||||
Header.scrollToPost nodes[0]
|
Header.scrollToPost root if root
|
||||||
|
|
||||||
$.queueTask ->
|
$.queueTask ->
|
||||||
# Enable 4chan features.
|
# Enable 4chan features.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user