From 72517e1d83f7ea5497474725d8fb64e7b9eede79 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Fri, 7 Mar 2014 17:17:20 -0700 Subject: [PATCH] Fix an issue causing the thread updater to fail to reset its interval --- LICENSE | 2 +- builds/4chan-X.user.js | 9 ++++----- builds/crx/script.js | 9 ++++----- src/Monitoring/ThreadUpdater.coffee | 6 ++---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index b104271c6..435306a3e 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.4.1 - 2014-03-06 +* 4chan X - Version 1.4.1 - 2014-03-07 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0f3f2232d..40b15b26d 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.4.1 - 2014-03-06 +* 4chan X - Version 1.4.1 - 2014-03-07 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -9738,7 +9738,7 @@ return new Notice('info', "The thread is " + change + ".", 30); }, parse: function(postObjects) { - var OP, count, deletedFiles, deletedPosts, files, index, node, num, post, postObject, posts, root, scroll, sendEvent, _i, _j, _len, _len1; + var OP, count, deletedFiles, deletedPosts, files, index, node, num, post, postObject, posts, root, sendEvent, _i, _j, _len, _len1; OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); @@ -9810,7 +9810,6 @@ } ThreadUpdater.lastPost = posts[count - 1].ID; Main.callbackNodes(Post, posts); - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && Header.getBottomOf(ThreadUpdater.root) > -25; for (_j = 0, _len1 = posts.length; _j < _len1; _j++) { post = posts[_j]; root = post.nodes.root; @@ -9823,11 +9822,11 @@ } } sendEvent(); - if (scroll) { + if (Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && Header.getBottomOf(ThreadUpdater.root) > -25) { if (Conf['Bottom Scroll']) { return window.scrollTo(0, d.body.clientHeight); } else { - return Header.scrollTo(nodes[0]); + return Header.scrollTo(posts.nodes[0]); } } } diff --git a/builds/crx/script.js b/builds/crx/script.js index f2c456e3a..0934e6236 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.4.1 - 2014-03-06 +* 4chan X - Version 1.4.1 - 2014-03-07 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -9753,7 +9753,7 @@ return new Notice('info', "The thread is " + change + ".", 30); }, parse: function(postObjects) { - var OP, count, deletedFiles, deletedPosts, files, index, node, num, post, postObject, posts, root, scroll, sendEvent, _i, _j, _len, _len1; + var OP, count, deletedFiles, deletedPosts, files, index, node, num, post, postObject, posts, root, sendEvent, _i, _j, _len, _len1; OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); @@ -9825,7 +9825,6 @@ } ThreadUpdater.lastPost = posts[count - 1].ID; Main.callbackNodes(Post, posts); - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && Header.getBottomOf(ThreadUpdater.root) > -25; for (_j = 0, _len1 = posts.length; _j < _len1; _j++) { post = posts[_j]; root = post.nodes.root; @@ -9838,11 +9837,11 @@ } } sendEvent(); - if (scroll) { + if (Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && Header.getBottomOf(ThreadUpdater.root) > -25) { if (Conf['Bottom Scroll']) { return window.scrollTo(0, d.body.clientHeight); } else { - return Header.scrollTo(nodes[0]); + return Header.scrollTo(posts.nodes[0]); } } } diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index 69853e52e..d3cecd691 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -334,8 +334,6 @@ ThreadUpdater = ThreadUpdater.lastPost = posts[count - 1].ID Main.callbackNodes Post, posts - scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and Header.getBottomOf(ThreadUpdater.root) > -25 - for post in posts {root} = post.nodes if post.cb @@ -345,8 +343,8 @@ ThreadUpdater = $.add ThreadUpdater.root, root sendEvent() - if scroll + if Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and Header.getBottomOf(ThreadUpdater.root) > -25 if Conf['Bottom Scroll'] window.scrollTo 0, d.body.clientHeight else - Header.scrollTo nodes[0] + Header.scrollTo posts.nodes[0]