From 6163ac391007c82e3b3ab8104c4912de156f5f47 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Wed, 14 Jan 2015 08:54:38 -0700 Subject: [PATCH] Fix threadwatcher --- CHANGELOG.md | 21 ++++++++++++++++++++- builds/appchan-x.user.js | 20 ++++++++++++++------ builds/crx/script.js | 20 ++++++++++++++------ src/Monitoring/ThreadWatcher.coffee | 13 ++++++++----- 4 files changed, 56 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f8b0575c..daf9f9ef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,23 @@ -- A bunch of shit from ccd0's 4chan X fork. +- Countless changes from ccd0's 4chan X fork, including + * Unread count in Thread Watcher. + * New Gallery Features: Fullscreen, slideshow. + * Download with original filename in menu. + * New site embedding support. + * Floating embeds (from ihavenoface). + * Option to restart GIFs/WEBMs when opened. + * Command-Click alternative to CTRL-Click on OS X. + * IP count and IP marking support. + * Improved Quote Threading. + * Disable Autoplaying Sounds option. + * Post on Captcha Completion option. + * Settings that only apply when a parent option is checked are now shown in a tree beneath the parent option and hidden when the parent option is unchecked. + * Better support of archived threads. + * Bugfixes and performance improvements. + +- Implement Download With Original Filename in Gallery. +- Implement Mayhem's Filter Labels. +- Implement a localized FAQ instead of linking to somebody else's. +- Improved JSON Navigation. ### v2.9.44 *2015-01-09* diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index f4012052e..f97953ad5 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -14281,6 +14281,7 @@ ThreadWatcher = { init: function() { + var el; if (!Conf['Thread Watcher']) { return; } @@ -14305,6 +14306,12 @@ case 'thread': $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh); } + if (Conf['Slideout Watcher']) { + ThreadWatcher.shortcut = el = $.el('div', { + id: 'so-watcher', + innerHTML: '' + }); + } ThreadWatcher.fetchAuto(); if (Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') { Menu.menu.addEntry({ @@ -14384,10 +14391,7 @@ } ThreadWatcher.refresh(); if (Conf['Slideout Watcher']) { - el = $.el('div', { - id: 'so-watcher', - innerHTML: '' - }); + el = ThreadWatcher.shortcut; Header.addShortcut(el, true); } else { el = d.body; @@ -14731,7 +14735,9 @@ return $[helper[0]](thread.catalogView.nodes.root, 'watched'); } }); - ThreadWatcher.refreshIcon(); + if (Conf['Slideout Watcher']) { + ThreadWatcher.refreshIcon(); + } _ref2 = ThreadWatcher.menu.refreshers; for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { refresher = _ref2[_j]; @@ -14792,7 +14798,9 @@ if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) { newLine = ThreadWatcher.makeLine(boardID, threadID, data); $.replace(line, newLine); - return ThreadWatcher.refreshIcon(); + if (Conf['Slideout Watcher']) { + return ThreadWatcher.refreshIcon(); + } } else { return ThreadWatcher.refresh(); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 3812f9b55..403e1d6f7 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -14297,6 +14297,7 @@ ThreadWatcher = { init: function() { + var el; if (!Conf['Thread Watcher']) { return; } @@ -14321,6 +14322,12 @@ case 'thread': $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh); } + if (Conf['Slideout Watcher']) { + ThreadWatcher.shortcut = el = $.el('div', { + id: 'so-watcher', + innerHTML: '' + }); + } ThreadWatcher.fetchAuto(); if (Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') { Menu.menu.addEntry({ @@ -14400,10 +14407,7 @@ } ThreadWatcher.refresh(); if (Conf['Slideout Watcher']) { - el = $.el('div', { - id: 'so-watcher', - innerHTML: '' - }); + el = ThreadWatcher.shortcut; Header.addShortcut(el, true); } else { el = d.body; @@ -14747,7 +14751,9 @@ return $[helper[0]](thread.catalogView.nodes.root, 'watched'); } }); - ThreadWatcher.refreshIcon(); + if (Conf['Slideout Watcher']) { + ThreadWatcher.refreshIcon(); + } _ref2 = ThreadWatcher.menu.refreshers; for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { refresher = _ref2[_j]; @@ -14808,7 +14814,9 @@ if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) { newLine = ThreadWatcher.makeLine(boardID, threadID, data); $.replace(line, newLine); - return ThreadWatcher.refreshIcon(); + if (Conf['Slideout Watcher']) { + return ThreadWatcher.refreshIcon(); + } } else { return ThreadWatcher.refresh(); } diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 59b606ae9..30c938a52 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -22,6 +22,11 @@ ThreadWatcher = when 'thread' $.on d, 'ThreadUpdate', @cb.onThreadRefresh + if Conf['Slideout Watcher'] + ThreadWatcher.shortcut = el = $.el 'div', + id: 'so-watcher' + innerHTML: '' + ThreadWatcher.fetchAuto() if Conf['JSON Navigation'] and Conf['Menu'] and g.BOARD.ID isnt 'f' @@ -75,9 +80,7 @@ ThreadWatcher = ThreadWatcher.refresh() if Conf['Slideout Watcher'] - el = $.el 'div', - id: 'so-watcher' - innerHTML: '' + el = ThreadWatcher.shortcut Header.addShortcut el, true else el = d.body @@ -289,7 +292,7 @@ ThreadWatcher = toggler.title = "#{helper[1]} Thread" $[helper[0]] thread.catalogView.nodes.root, 'watched' if thread.catalogView - ThreadWatcher.refreshIcon() + ThreadWatcher.refreshIcon() if Conf['Slideout Watcher'] for refresher in ThreadWatcher.menu.refreshers refresher() @@ -319,7 +322,7 @@ ThreadWatcher = if line = $ "#watched-threads > [data-full-i-d='#{boardID}.#{threadID}']", ThreadWatcher.dialog newLine = ThreadWatcher.makeLine boardID, threadID, data $.replace line, newLine - ThreadWatcher.refreshIcon() + ThreadWatcher.refreshIcon() if Conf['Slideout Watcher'] else ThreadWatcher.refresh()