From c158e0475ad4fd60ed19b3cff0e74d9fbecb1c1e Mon Sep 17 00:00:00 2001 From: seaweedchan Date: Sat, 11 May 2013 04:58:24 -0700 Subject: [PATCH] Fix #71 --- builds/4chan-X.js | 9 ++++----- builds/4chan-X.user.js | 9 ++++----- builds/crx/script.js | 9 ++++----- src/General/Config.coffee | 8 ++------ src/Monitoring/ThreadWatcher.coffee | 7 +++---- 5 files changed, 17 insertions(+), 25 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 6edbd8852..ea9947984 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -183,8 +183,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], - 'Fixed Thread Watcher': [true, 'Thread watcher scrolls with you on the page'], - 'Persistent Thread Watcher': [false, 'Opens the thread watcher by default.'], + 'Toggleable Thread Watcher': [false, 'Adds a shortcut for the thread watcher, and fixes the watcher to the page.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, @@ -7359,14 +7358,14 @@ $.sync('WatchedThreads', this.refresh); $.on(sc, 'click', this.toggleWatcher); $.on($('.move>.close', ThreadWatcher.dialog), 'click', this.toggleWatcher); - if (Conf['Fixed Thread Watcher']) { + if (Conf['Toggleable Thread Watcher']) { + Header.addShortcut(sc); $.addClass(doc, 'fixed-watcher'); } - Header.addShortcut(sc); $.ready(function() { ThreadWatcher.refresh(); $.add(d.body, ThreadWatcher.dialog); - if (!Conf['Persistent Thread Watcher']) { + if (Conf['Toggleable Thread Watcher']) { return ThreadWatcher.dialog.hidden = true; } }); diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 4cfa94184..551744a0e 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -183,8 +183,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], - 'Fixed Thread Watcher': [true, 'Thread watcher scrolls with you on the page'], - 'Persistent Thread Watcher': [false, 'Opens the thread watcher by default.'], + 'Toggleable Thread Watcher': [false, 'Adds a shortcut for the thread watcher, and fixes the watcher to the page.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, @@ -7368,14 +7367,14 @@ $.sync('WatchedThreads', this.refresh); $.on(sc, 'click', this.toggleWatcher); $.on($('.move>.close', ThreadWatcher.dialog), 'click', this.toggleWatcher); - if (Conf['Fixed Thread Watcher']) { + if (Conf['Toggleable Thread Watcher']) { + Header.addShortcut(sc); $.addClass(doc, 'fixed-watcher'); } - Header.addShortcut(sc); $.ready(function() { ThreadWatcher.refresh(); $.add(d.body, ThreadWatcher.dialog); - if (!Conf['Persistent Thread Watcher']) { + if (Conf['Toggleable Thread Watcher']) { return ThreadWatcher.dialog.hidden = true; } }); diff --git a/builds/crx/script.js b/builds/crx/script.js index c0cb3d24a..94f8afb4d 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -165,8 +165,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], - 'Fixed Thread Watcher': [true, 'Thread watcher scrolls with you on the page'], - 'Persistent Thread Watcher': [false, 'Opens the thread watcher by default.'], + 'Toggleable Thread Watcher': [false, 'Adds a shortcut for the thread watcher, and fixes the watcher to the page.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, @@ -7346,14 +7345,14 @@ $.sync('WatchedThreads', this.refresh); $.on(sc, 'click', this.toggleWatcher); $.on($('.move>.close', ThreadWatcher.dialog), 'click', this.toggleWatcher); - if (Conf['Fixed Thread Watcher']) { + if (Conf['Toggleable Thread Watcher']) { + Header.addShortcut(sc); $.addClass(doc, 'fixed-watcher'); } - Header.addShortcut(sc); $.ready(function() { ThreadWatcher.refresh(); $.add(d.body, ThreadWatcher.dialog); - if (!Conf['Persistent Thread Watcher']) { + if (Conf['Toggleable Thread Watcher']) { return ThreadWatcher.dialog.hidden = true; } }); diff --git a/src/General/Config.coffee b/src/General/Config.coffee index b5b7b3e75..49eed2ee2 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -233,13 +233,9 @@ Config = true 'Bookmark threads.' ] - 'Fixed Thread Watcher': [ - true - 'Thread watcher scrolls with you on the page' - ] - 'Persistent Thread Watcher': [ + 'Toggleable Thread Watcher': [ false - 'Opens the thread watcher by default.' + 'Adds a shortcut for the thread watcher, and fixes the watcher to the page.' ] 'Auto Watch': [ true diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index cbffd7152..1232118da 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -15,15 +15,14 @@ ThreadWatcher = $.on sc, 'click', @toggleWatcher $.on $('.move>.close', ThreadWatcher.dialog), 'click', @toggleWatcher - if Conf['Fixed Thread Watcher'] + if Conf['Toggleable Thread Watcher'] + Header.addShortcut sc $.addClass doc, 'fixed-watcher' - - Header.addShortcut sc $.ready -> ThreadWatcher.refresh() $.add d.body, ThreadWatcher.dialog - unless Conf['Persistent Thread Watcher'] + if Conf['Toggleable Thread Watcher'] ThreadWatcher.dialog.hidden = true Thread::callbacks.push