getValue into refresh
This commit is contained in:
parent
9d91220665
commit
d90fd1e016
@ -1530,13 +1530,14 @@
|
|||||||
$.bind(favicon, 'click', watcher.cb.toggle);
|
$.bind(favicon, 'click', watcher.cb.toggle);
|
||||||
$.before(input, favicon);
|
$.before(input, favicon);
|
||||||
}
|
}
|
||||||
watcher.refresh($.getValue('watched', {}));
|
watcher.refresh();
|
||||||
return $.bind(window, 'storage', (function() {
|
return $.bind(window, 'storage', (function() {
|
||||||
return watcher.refresh($.getValue('watched', {}));
|
return watcher.refresh();
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
refresh: function(watched) {
|
refresh: function() {
|
||||||
var board, dialog, div, favicon, id, link, props, watchedBoard, x, _i, _j, _len, _len2, _ref, _ref2, _ref3, _results;
|
var board, dialog, div, favicon, id, link, props, watched, watchedBoard, x, _i, _j, _len, _len2, _ref, _ref2, _ref3, _results;
|
||||||
|
watched = $.getValue('watched', {});
|
||||||
dialog = $('#watcher');
|
dialog = $('#watcher');
|
||||||
_ref = $$('div:not(.move)', dialog);
|
_ref = $$('div:not(.move)', dialog);
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
@ -1592,7 +1593,7 @@
|
|||||||
watched = $.getValue('watched', {});
|
watched = $.getValue('watched', {});
|
||||||
delete watched[board][id];
|
delete watched[board][id];
|
||||||
$.setValue('watched', watched);
|
$.setValue('watched', watched);
|
||||||
return watcher.refresh(watched);
|
return watcher.refresh();
|
||||||
},
|
},
|
||||||
watch: function(thread, id) {
|
watch: function(thread, id) {
|
||||||
var props, tc, watched, _name;
|
var props, tc, watched, _name;
|
||||||
@ -1605,7 +1606,7 @@
|
|||||||
watched[_name = g.BOARD] || (watched[_name] = {});
|
watched[_name = g.BOARD] || (watched[_name] = {});
|
||||||
watched[g.BOARD][id] = props;
|
watched[g.BOARD][id] = props;
|
||||||
$.setValue('watched', watched);
|
$.setValue('watched', watched);
|
||||||
return watcher.refresh(watched);
|
return watcher.refresh();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
anonymize = {
|
anonymize = {
|
||||||
|
|||||||
@ -1243,11 +1243,12 @@ watcher =
|
|||||||
$.before input, favicon
|
$.before input, favicon
|
||||||
|
|
||||||
#populate watcher, display watch buttons
|
#populate watcher, display watch buttons
|
||||||
watcher.refresh $.getValue 'watched', {}
|
watcher.refresh()
|
||||||
|
|
||||||
$.bind window, 'storage', (-> watcher.refresh $.getValue 'watched', {})
|
$.bind window, 'storage', (-> watcher.refresh() )
|
||||||
|
|
||||||
refresh: (watched) ->
|
refresh: ->
|
||||||
|
watched = $.getValue 'watched', {}
|
||||||
dialog = $ '#watcher'
|
dialog = $ '#watcher'
|
||||||
for div in $$ 'div:not(.move)', dialog
|
for div in $$ 'div:not(.move)', dialog
|
||||||
$.rm div
|
$.rm div
|
||||||
@ -1290,7 +1291,7 @@ watcher =
|
|||||||
watched = $.getValue 'watched', {}
|
watched = $.getValue 'watched', {}
|
||||||
delete watched[board][id]
|
delete watched[board][id]
|
||||||
$.setValue 'watched', watched
|
$.setValue 'watched', watched
|
||||||
watcher.refresh watched
|
watcher.refresh()
|
||||||
|
|
||||||
watch: (thread, id) ->
|
watch: (thread, id) ->
|
||||||
tc = $('span.filetitle', thread).textContent or $('blockquote', thread).textContent
|
tc = $('span.filetitle', thread).textContent or $('blockquote', thread).textContent
|
||||||
@ -1302,7 +1303,7 @@ watcher =
|
|||||||
watched[g.BOARD] or= {}
|
watched[g.BOARD] or= {}
|
||||||
watched[g.BOARD][id] = props
|
watched[g.BOARD][id] = props
|
||||||
$.setValue 'watched', watched
|
$.setValue 'watched', watched
|
||||||
watcher.refresh watched
|
watcher.refresh()
|
||||||
|
|
||||||
anonymize =
|
anonymize =
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user