Auto Watch on thread creation.
This commit is contained in:
parent
76cb2b4f9a
commit
8cd6598e00
@ -1724,7 +1724,10 @@
|
|||||||
$.set('qr.persona', persona);
|
$.set('qr.persona', persona);
|
||||||
_ref = b.lastChild.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], postNumber = _ref[2];
|
_ref = b.lastChild.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], postNumber = _ref[2];
|
||||||
if (thread === '0') {
|
if (thread === '0') {
|
||||||
window.open("/" + g.BOARD + "/res/" + postNumber, '_self');
|
if (conf['Thread Watcher'] && conf['Auto Watch']) {
|
||||||
|
$.set('autoWatch', postNumber);
|
||||||
|
}
|
||||||
|
location.pathname = "/" + g.BOARD + "/res/" + postNumber;
|
||||||
} else {
|
} else {
|
||||||
qr.cooldown.auto = qr.replies.length > 1;
|
qr.cooldown.auto = qr.replies.length > 1;
|
||||||
qr.cooldown.set(/sage/i.test(reply.email) ? 60 : 30);
|
qr.cooldown.set(/sage/i.test(reply.email) ? 60 : 30);
|
||||||
@ -2381,7 +2384,12 @@
|
|||||||
$.on(favicon, 'click', watcher.cb.toggle);
|
$.on(favicon, 'click', watcher.cb.toggle);
|
||||||
$.before(input, favicon);
|
$.before(input, favicon);
|
||||||
}
|
}
|
||||||
watcher.refresh();
|
if (g.THREAD_ID === $.get('autoWatch', 0)) {
|
||||||
|
watcher.watch(g.THREAD_ID);
|
||||||
|
$["delete"]('autoWatch');
|
||||||
|
} else {
|
||||||
|
watcher.refresh();
|
||||||
|
}
|
||||||
return $.on(window, 'storage', function(e) {
|
return $.on(window, 'storage', function(e) {
|
||||||
if (e.key === ("" + NAMESPACE + "watched")) return watcher.refresh();
|
if (e.key === ("" + NAMESPACE + "watched")) return watcher.refresh();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1300,8 +1300,10 @@ qr =
|
|||||||
|
|
||||||
[_, thread, postNumber] = b.lastChild.textContent.match /thread:(\d+),no:(\d+)/
|
[_, thread, postNumber] = b.lastChild.textContent.match /thread:(\d+),no:(\d+)/
|
||||||
if thread is '0' # new thread
|
if thread is '0' # new thread
|
||||||
|
if conf['Thread Watcher'] and conf['Auto Watch']
|
||||||
|
$.set 'autoWatch', postNumber
|
||||||
# auto-noko
|
# auto-noko
|
||||||
window.open "/#{g.BOARD}/res/#{postNumber}", '_self'
|
location.pathname = "/#{g.BOARD}/res/#{postNumber}"
|
||||||
else
|
else
|
||||||
# Enable auto-posting if we have stuff to post, disable it otherwise.
|
# Enable auto-posting if we have stuff to post, disable it otherwise.
|
||||||
qr.cooldown.auto = qr.replies.length > 1
|
qr.cooldown.auto = qr.replies.length > 1
|
||||||
@ -1862,8 +1864,12 @@ watcher =
|
|||||||
$.on favicon, 'click', watcher.cb.toggle
|
$.on favicon, 'click', watcher.cb.toggle
|
||||||
$.before input, favicon
|
$.before input, favicon
|
||||||
|
|
||||||
#populate watcher, display watch buttons
|
if g.THREAD_ID is $.get 'autoWatch', 0
|
||||||
watcher.refresh()
|
watcher.watch g.THREAD_ID
|
||||||
|
$.delete 'autoWatch'
|
||||||
|
else
|
||||||
|
#populate watcher, display watch buttons
|
||||||
|
watcher.refresh()
|
||||||
|
|
||||||
$.on window, 'storage', (e) -> watcher.refresh() if e.key is "#{NAMESPACE}watched"
|
$.on window, 'storage', (e) -> watcher.refresh() if e.key is "#{NAMESPACE}watched"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user