Rename function. A bit deeper.

This commit is contained in:
Nicolas Stepien 2011-05-04 09:09:34 +02:00
parent ca2051313d
commit 62763b2e0c
2 changed files with 10 additions and 14 deletions

View File

@ -1469,7 +1469,7 @@
}, html);
$.append(d.body, dialog);
watched = $.getValue('watched', {});
watcher.list(watched);
watcher.refresh(watched);
watchedBoard = watched[g.BOARD] || {};
inputs = $$('form > input[value=delete], div.thread > input[value=delete]');
_results = [];
@ -1490,12 +1490,10 @@
}
return _results;
},
list: function(watched) {
refresh: function(watched) {
var board, div, id, props, _results;
div = $('#watcher > div:not(.move)');
while (div) {
while (div = $('#watcher > div:not(.move)')) {
$.remove(div);
div = $('#watcher > div:not(.move)');
}
_results = [];
for (board in watched) {
@ -1552,7 +1550,7 @@
watched = $.getValue('watched', {});
delete watched[board][id];
$.setValue('watched', watched);
return watcher.list(watched);
return watcher.refresh(watched);
},
watch: function(thread) {
var favicon, id, props, tc, watched, _name;
@ -1571,7 +1569,7 @@
watched[_name = g.BOARD] || (watched[_name] = {});
watched[g.BOARD][id] = props;
$.setValue('watched', watched);
return watcher.list(watched);
return watcher.refresh(watched);
}
};
anonymize = {

View File

@ -1165,7 +1165,7 @@ watcher =
#populate watcher
watched = $.getValue 'watched', {}
watcher.list watched
watcher.refresh watched
#add watch buttons
watchedBoard = watched[g.BOARD] or {}
@ -1182,11 +1182,9 @@ watcher =
$.bind favicon, 'click', watcher.cb.toggle
$.before input, favicon
list: (watched) ->
div = $ '#watcher > div:not(.move)'
while div
refresh: (watched) ->
while div = $ '#watcher > div:not(.move)'
$.remove div
div = $ '#watcher > div:not(.move)'
for board of watched
for id, props of watched[board]
watcher.addLink props, $ '#watcher'
@ -1226,7 +1224,7 @@ watcher =
delete watched[board][id]
$.setValue 'watched', watched
watcher.list watched
watcher.refresh watched
watch: (thread) ->
favicon = $ 'img.favicon', thread
@ -1244,7 +1242,7 @@ watcher =
watched[g.BOARD][id] = props
$.setValue 'watched', watched
watcher.list watched
watcher.refresh watched
anonymize =
init: ->