diff --git a/builds/4chan-X.js b/builds/4chan-X.js index fb24fb02b..e30ade4a1 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -20,7 +20,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== -/* 4chan X - Version 3.1.4 - 2013-04-18 +/* 4chan X - Version 3.1.4 - 2013-04-19 * https://4chan-x.just-believe.in/ * * Copyright (c) 2009-2011 James Campos @@ -6124,7 +6124,9 @@ continue; } if (post.cb) { - post.cb.call(post); + if (!post.cb.call(post)) { + $.add(ThreadUpdater.root, post.nodes.root); + } } else { $.add(ThreadUpdater.root, post.nodes.root); } @@ -8235,13 +8237,8 @@ qpost = posts[this.threaded]; delete this.threaded; delete this.cb; - if (this.thread.OP === qpost) { - return; - } - if (QuoteThreading.hasRun) { - if (!Unread.posts.contains(qpost)) { - return; - } + if (this.thread.OP === qpost || (QuoteThreading.hasRun && !Unread.posts.contains(qpost))) { + return false; } qroot = qpost.nodes.root; threadContainer = qroot.nextSibling; @@ -8251,7 +8248,8 @@ }); $.after(qroot, threadContainer); } - return $.add(threadContainer, this.nodes.root); + $.add(threadContainer, this.nodes.root); + return true; }, toggle: function() { var container, containers, node, nodes, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _results; @@ -8296,6 +8294,12 @@ } return Unread.update(true); } + }, + kb: function() { + var control; + + control = $.id('threadingControl'); + return control.click(); } }; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 2e9205fd6..2a5950ff9 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -20,7 +20,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== -/* 4chan X - Version 3.1.4 - 2013-04-18 +/* 4chan X - Version 3.1.4 - 2013-04-19 * https://4chan-x.just-believe.in/ * * Copyright (c) 2009-2011 James Campos @@ -6116,7 +6116,9 @@ continue; } if (post.cb) { - post.cb.call(post); + if (!post.cb.call(post)) { + $.add(ThreadUpdater.root, post.nodes.root); + } } else { $.add(ThreadUpdater.root, post.nodes.root); } @@ -8252,13 +8254,8 @@ qpost = posts[this.threaded]; delete this.threaded; delete this.cb; - if (this.thread.OP === qpost) { - return; - } - if (QuoteThreading.hasRun) { - if (!Unread.posts.contains(qpost)) { - return; - } + if (this.thread.OP === qpost || (QuoteThreading.hasRun && !Unread.posts.contains(qpost))) { + return false; } qroot = qpost.nodes.root; threadContainer = qroot.nextSibling; @@ -8268,7 +8265,8 @@ }); $.after(qroot, threadContainer); } - return $.add(threadContainer, this.nodes.root); + $.add(threadContainer, this.nodes.root); + return true; }, toggle: function() { var container, containers, node, nodes, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _results; @@ -8313,6 +8311,12 @@ } return Unread.update(true); } + }, + kb: function() { + var control; + + control = $.id('threadingControl'); + return control.click(); } }; diff --git a/builds/crx.crx b/builds/crx.crx index 208dac507..ade054aa3 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/script.js b/builds/crx/script.js index 0995830c7..826a44af7 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6037,7 +6037,9 @@ continue; } if (post.cb) { - post.cb.call(post); + if (!post.cb.call(post)) { + $.add(ThreadUpdater.root, post.nodes.root); + } } else { $.add(ThreadUpdater.root, post.nodes.root); } @@ -8154,13 +8156,8 @@ qpost = posts[this.threaded]; delete this.threaded; delete this.cb; - if (this.thread.OP === qpost) { - return; - } - if (QuoteThreading.hasRun) { - if (!Unread.posts.contains(qpost)) { - return; - } + if (this.thread.OP === qpost || (QuoteThreading.hasRun && !Unread.posts.contains(qpost))) { + return false; } qroot = qpost.nodes.root; threadContainer = qroot.nextSibling; @@ -8170,7 +8167,8 @@ }); $.after(qroot, threadContainer); } - return $.add(threadContainer, this.nodes.root); + $.add(threadContainer, this.nodes.root); + return true; }, toggle: function() { var container, containers, node, nodes, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _results; @@ -8215,6 +8213,12 @@ } return Unread.update(true); } + }, + kb: function() { + var control; + + control = $.id('threadingControl'); + return control.click(); } }; diff --git a/src/code/monitoring/threadupdater.coffee b/src/code/monitoring/threadupdater.coffee index ac04e2107..119296a73 100644 --- a/src/code/monitoring/threadupdater.coffee +++ b/src/code/monitoring/threadupdater.coffee @@ -274,7 +274,8 @@ ThreadUpdater = for key, post of posts continue unless posts.hasOwnProperty key if post.cb - post.cb.call post + unless post.cb.call post + $.add ThreadUpdater.root, post.nodes.root else $.add ThreadUpdater.root, post.nodes.root diff --git a/src/code/quoting/quotethreading.coffee b/src/code/quoting/quotethreading.coffee index 76b94d5b2..185e70ed8 100644 --- a/src/code/quoting/quotethreading.coffee +++ b/src/code/quoting/quotethreading.coffee @@ -62,10 +62,7 @@ QuoteThreading = delete @threaded delete @cb - return if @thread.OP is qpost - - if QuoteThreading.hasRun - return unless Unread.posts.contains qpost + return false if @thread.OP is qpost or (QuoteThreading.hasRun and !Unread.posts.contains qpost) qroot = qpost.nodes.root threadContainer = qroot.nextSibling @@ -75,6 +72,7 @@ QuoteThreading = $.after qroot, threadContainer $.add threadContainer, @nodes.root + return true toggle: -> thread = $ '.thread' @@ -94,9 +92,6 @@ QuoteThreading = $.rm container for container in containers Unread.update true -# Keybind comes later. -# public: -# toggle: -> -# control = $.id 'threadingControl' -# control.checked = not control.checked -# QuoteThreading.toggle.call control \ No newline at end of file + kb: -> + control = $.id 'threadingControl' + control.click() \ No newline at end of file