From 8d0949a7af1049827735265522c70cc474aa6126 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 9 Mar 2014 15:30:15 -0700 Subject: [PATCH 1/4] Fix ThreadUpdater Autoscroll --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/Monitoring/ThreadUpdater.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 62790a0fc..5185c50bc 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -9832,7 +9832,7 @@ if (Conf['Bottom Scroll']) { return window.scrollTo(0, d.body.clientHeight); } else { - return Header.scrollTo(posts.nodes[0]); + return Header.scrollTo(posts[0].nodes.root); } } } diff --git a/builds/crx/script.js b/builds/crx/script.js index 380b34cc3..9b2268cea 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9847,7 +9847,7 @@ if (Conf['Bottom Scroll']) { return window.scrollTo(0, d.body.clientHeight); } else { - return Header.scrollTo(posts.nodes[0]); + return Header.scrollTo(posts[0].nodes.root); } } } diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index d3cecd691..e8d77e420 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -347,4 +347,4 @@ ThreadUpdater = if Conf['Bottom Scroll'] window.scrollTo 0, d.body.clientHeight else - Header.scrollTo posts.nodes[0] + Header.scrollTo posts[0].nodes.root From 698ef0fa05e9fe3c7df86070d3e102d46c0e4a22 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 9 Mar 2014 15:32:11 -0700 Subject: [PATCH 2/4] Fix post hiding menu entries --- builds/4chan-X.user.js | 3 +-- builds/crx/script.js | 3 +-- src/General/Config.coffee | 8 ++------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5185c50bc..21d7a8714 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -186,8 +186,7 @@ 'Menu': { 'Menu': [true, 'Add a drop-down menu to posts.'], 'Report Link': [true, 'Add a report link to the menu.'], - 'Thread Hiding Link': [true, 'Add a link to hide entire threads.'], - 'Reply Hiding Link': [true, 'Add a link to hide single replies.'], + 'Post Hiding Link': [true, 'Add a link to hide posts.'], 'Delete Link': [true, 'Add post and image deletion links to the menu.'], 'Archive Link': [true, 'Add an archive link to the menu.'] }, diff --git a/builds/crx/script.js b/builds/crx/script.js index 9b2268cea..ff4b673bd 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -162,8 +162,7 @@ 'Menu': { 'Menu': [true, 'Add a drop-down menu to posts.'], 'Report Link': [true, 'Add a report link to the menu.'], - 'Thread Hiding Link': [true, 'Add a link to hide entire threads.'], - 'Reply Hiding Link': [true, 'Add a link to hide single replies.'], + 'Post Hiding Link': [true, 'Add a link to hide posts.'], 'Delete Link': [true, 'Add post and image deletion links to the menu.'], 'Download Link': [true, 'Add a download with original filename link to the menu. Chrome-only currently.'], 'Archive Link': [true, 'Add an archive link to the menu.'] diff --git a/src/General/Config.coffee b/src/General/Config.coffee index faf5b5c84..27d44c4b5 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -197,13 +197,9 @@ Config = true 'Add a report link to the menu.' ] - 'Thread Hiding Link': [ + 'Post Hiding Link': [ true - 'Add a link to hide entire threads.' - ] - 'Reply Hiding Link': [ - true - 'Add a link to hide single replies.' + 'Add a link to hide posts.' ] 'Delete Link': [ true From f96e046af4ad6ff467d34aeb5d5366c1f0f840c7 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 9 Mar 2014 15:43:30 -0700 Subject: [PATCH 3/4] Change the index mod keybinds. These ones are probably even more dumb, though. --- builds/4chan-X.user.js | 11 +++++++---- builds/crx/script.js | 11 +++++++---- src/General/Config.coffee | 8 ++++---- src/Miscellaneous/Keybinds.coffee | 1 + 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 21d7a8714..fbfd3bd49 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -329,10 +329,10 @@ 'Next page': ['Shift+Right', 'Jump to the next page.'], 'Previous page': ['Shift+Left', 'Jump to the previous page.'], 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], - 'Paged mode': ['Ctrl+1', 'Sets the index mode to paged.'], - 'All pages mode': ['Ctrl+2', 'Sets the index mode to all threads.'], - 'Catalog mode': ['Ctrl+3', 'Sets the index mode to catalog.'], - 'Cycle sort type': ['Ctrl+x', 'Cycle through index sort types.'], + 'Paged mode': ['Alt+1', 'Sets the index mode to paged.'], + 'All pages mode': ['Alt+2', 'Sets the index mode to all threads.'], + 'Catalog mode': ['Alt+3', 'Sets the index mode to catalog.'], + 'Cycle sort type': ['Alt+x', 'Cycle through index sort types.'], 'Next thread': ['Shift+Down', 'See next thread.'], 'Previous thread': ['Shift+Up', 'See previous thread.'], 'Expand thread': ['Ctrl+e', 'Expand thread.'], @@ -12053,6 +12053,9 @@ Index.setIndexMode('catalog'); break; case Conf['Cycle sort type']: + if (g.VIEW !== 'index') { + return; + } Index.cycleSortType(); break; case Conf['Next thread']: diff --git a/builds/crx/script.js b/builds/crx/script.js index ff4b673bd..12327aa39 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -305,10 +305,10 @@ 'Next page': ['Shift+Right', 'Jump to the next page.'], 'Previous page': ['Shift+Left', 'Jump to the previous page.'], 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], - 'Paged mode': ['Ctrl+1', 'Sets the index mode to paged.'], - 'All pages mode': ['Ctrl+2', 'Sets the index mode to all threads.'], - 'Catalog mode': ['Ctrl+3', 'Sets the index mode to catalog.'], - 'Cycle sort type': ['Ctrl+x', 'Cycle through index sort types.'], + 'Paged mode': ['Alt+1', 'Sets the index mode to paged.'], + 'All pages mode': ['Alt+2', 'Sets the index mode to all threads.'], + 'Catalog mode': ['Alt+3', 'Sets the index mode to catalog.'], + 'Cycle sort type': ['Alt+x', 'Cycle through index sort types.'], 'Next thread': ['Shift+Down', 'See next thread.'], 'Previous thread': ['Shift+Up', 'See previous thread.'], 'Expand thread': ['Ctrl+e', 'Expand thread.'], @@ -12067,6 +12067,9 @@ Index.setIndexMode('catalog'); break; case Conf['Cycle sort type']: + if (g.VIEW !== 'index') { + return; + } Index.cycleSortType(); break; case Conf['Next thread']: diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 27d44c4b5..6c88f5a56 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -653,19 +653,19 @@ vp-replace 'Focus the search field on the board index.' ] 'Paged mode': [ - 'Ctrl+1' + 'Alt+1' 'Sets the index mode to paged.' ] 'All pages mode': [ - 'Ctrl+2' + 'Alt+2' 'Sets the index mode to all threads.' ] 'Catalog mode': [ - 'Ctrl+3' + 'Alt+3' 'Sets the index mode to catalog.' ] 'Cycle sort type': [ - 'Ctrl+x' + 'Alt+x' 'Cycle through index sort types.' ] # Thread Navigation diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 696517c5e..7886509e3 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -110,6 +110,7 @@ Keybinds = return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'catalog' Index.setIndexMode 'catalog' when Conf['Cycle sort type'] + return unless g.VIEW is 'index' Index.cycleSortType() # Thread Navigation when Conf['Next thread'] From bbb41dd2262add4ce53919224d2a6e4787a4f7f7 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 9 Mar 2014 16:04:16 -0700 Subject: [PATCH 4/4] Threadupdater stuff --- builds/4chan-X.user.js | 10 ++++------ builds/crx/script.js | 10 ++++------ src/Monitoring/ThreadUpdater.coffee | 10 +++++----- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index fbfd3bd49..396d4cf56 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -9457,12 +9457,10 @@ } else { this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', "
"); $.addClass(doc, 'float'); - $.ready((function(_this) { - return function() { - $.addClass(doc, 'float'); - return $.add(d.body, sc); - }; - })(this)); + $.ready(function() { + $.addClass(doc, 'float'); + return $.add(d.body, sc); + }); } this.checkPostCount = 0; this.timer = $('#update-timer', sc); diff --git a/builds/crx/script.js b/builds/crx/script.js index 12327aa39..b94eedd28 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9472,12 +9472,10 @@ } else { this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', "
"); $.addClass(doc, 'float'); - $.ready((function(_this) { - return function() { - $.addClass(doc, 'float'); - return $.add(d.body, sc); - }; - })(this)); + $.ready(function() { + $.addClass(doc, 'float'); + return $.add(d.body, sc); + }); } this.checkPostCount = 0; this.timer = $('#update-timer', sc); diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index e8d77e420..019970a70 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -8,11 +8,11 @@ ThreadUpdater = id: 'updater' $.ready -> Header.addShortcut sc - else + else @dialog = sc = UI.dialog 'updater', 'bottom: 0px; left: 0px;', "
" $.addClass doc, 'float' - $.ready => + $.ready -> $.addClass doc, 'float' $.add d.body, sc @@ -57,12 +57,12 @@ ThreadUpdater = Thread.callbacks.push name: 'Thread Updater' cb: @node - + disconnect: -> return if g.VIEW isnt 'thread' or !Conf['Thread Updater'] $.off @timer, 'click', @update $.off @status, 'click', @update - + clearTimeout @timeoutID if @timeoutID for entry in @entry.subEntries @@ -182,7 +182,7 @@ ThreadUpdater = setInterval: -> i = ThreadUpdater.interval + 1 - + if Conf['Optional Increase'] # Lower the max refresh rate limit on visible tabs. cur = ThreadUpdater.outdateCount or 1