Do the threading first. Better watcher selector.
This commit is contained in:
parent
3b2b50a230
commit
7178f5e480
@ -1696,14 +1696,14 @@
|
||||
};
|
||||
watcher = {
|
||||
init: function() {
|
||||
var dialog, favicon, html, input, inputs, _i, _len;
|
||||
var favicon, html, input, inputs, _i, _len;
|
||||
html = '<div class=move>Thread Watcher</div>';
|
||||
dialog = ui.dialog('watcher', {
|
||||
watcher.dialog = ui.dialog('watcher', {
|
||||
top: '50px',
|
||||
left: '0px'
|
||||
}, html);
|
||||
$.append(d.body, dialog);
|
||||
inputs = $$('form > input[value=delete], div.thread > input[value=delete]');
|
||||
$.append(d.body, watcher.dialog);
|
||||
inputs = $$('.op input');
|
||||
for (_i = 0, _len = inputs.length; _i < _len; _i++) {
|
||||
input = inputs[_i];
|
||||
favicon = $.el('img', {
|
||||
@ -1720,10 +1720,9 @@
|
||||
});
|
||||
},
|
||||
refresh: function() {
|
||||
var board, dialog, div, favicon, id, link, props, watched, watchedBoard, x, _i, _j, _len, _len2, _ref, _ref2, _ref3, _results;
|
||||
var board, div, favicon, id, link, props, watched, watchedBoard, x, _i, _j, _len, _len2, _ref, _ref2, _ref3, _results;
|
||||
watched = $.getValue('watched', {});
|
||||
dialog = $('#watcher');
|
||||
_ref = $$('div:not(.move)', dialog);
|
||||
_ref = $$('div:not(.move)', watcher.dialog);
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
div = _ref[_i];
|
||||
$.rm(div);
|
||||
@ -1739,7 +1738,7 @@
|
||||
$.bind(x, 'click', watcher.cb.x);
|
||||
link = $.el('a', props);
|
||||
$.append(div, x, $.tn(' '), link);
|
||||
$.append(dialog, div);
|
||||
$.append(watcher.dialog, div);
|
||||
}
|
||||
}
|
||||
watchedBoard = watched[g.BOARD] || {};
|
||||
@ -2703,6 +2702,7 @@
|
||||
Recaptcha.init();
|
||||
$.bind(form, 'submit', qr.submit);
|
||||
}
|
||||
threading.init();
|
||||
if ($.config('Auto Noko')) {
|
||||
$('.postarea form').action += '?auto_noko';
|
||||
}
|
||||
@ -2757,7 +2757,6 @@
|
||||
if ($.config('Keybinds')) {
|
||||
keybinds.init();
|
||||
}
|
||||
threading.init();
|
||||
if (g.REPLY) {
|
||||
if ($.config('Thread Updater')) {
|
||||
updater.init();
|
||||
|
||||
@ -1385,11 +1385,11 @@ updater =
|
||||
watcher =
|
||||
init: ->
|
||||
html = '<div class=move>Thread Watcher</div>'
|
||||
dialog = ui.dialog 'watcher', top: '50px', left: '0px', html
|
||||
$.append d.body, dialog
|
||||
watcher.dialog = ui.dialog 'watcher', top: '50px', left: '0px', html
|
||||
$.append d.body, watcher.dialog
|
||||
|
||||
#add watch buttons
|
||||
inputs = $$ 'form > input[value=delete], div.thread > input[value=delete]'
|
||||
inputs = $$ '.op input'
|
||||
for input in inputs
|
||||
favicon = $.el 'img',
|
||||
className: 'favicon'
|
||||
@ -1403,8 +1403,7 @@ watcher =
|
||||
|
||||
refresh: ->
|
||||
watched = $.getValue 'watched', {}
|
||||
dialog = $ '#watcher'
|
||||
for div in $$ 'div:not(.move)', dialog
|
||||
for div in $$ 'div:not(.move)', watcher.dialog
|
||||
$.rm div
|
||||
for board of watched
|
||||
for id, props of watched[board]
|
||||
@ -1415,7 +1414,7 @@ watcher =
|
||||
link = $.el 'a', props
|
||||
|
||||
$.append div, x, $.tn(' '), link
|
||||
$.append dialog, div
|
||||
$.append watcher.dialog, div
|
||||
|
||||
watchedBoard = watched[g.BOARD] or {}
|
||||
for favicon in $$ 'img.favicon'
|
||||
@ -2099,6 +2098,8 @@ main =
|
||||
$.bind form, 'submit', qr.submit
|
||||
|
||||
#major features
|
||||
threading.init()
|
||||
|
||||
if $.config 'Auto Noko'
|
||||
$('.postarea form').action += '?auto_noko'
|
||||
|
||||
@ -2153,8 +2154,6 @@ main =
|
||||
if $.config 'Keybinds'
|
||||
keybinds.init()
|
||||
|
||||
threading.init()
|
||||
|
||||
if g.REPLY
|
||||
if $.config 'Thread Updater'
|
||||
updater.init()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user