var rename_group function old_name new_name tweetonica api rename_grou

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var rename_group = function(old_name, new_name) {
tweetonica.api.rename_group(old_name, new_name, function(results) {
var tmp = [];
for (var g in cache) {
var info = cache[g];
if (info.name == old_name) {
info.name = results.name;
info.rssurl = results.rssurl;
}
tmp[info.name] = info;
}
cache = tmp;
$('#groups a').each(function() {
var o = $(this);
if (o.data('groupname') == old_name) {
o.data('groupname', new_name);
$('span', o).text(display_group_name(new_name, true));
open_group(o);
}
});
check_for_updates();
}, function(error) {
$('#error-description').text('Sorry, we were unable to rename group. Please try again later');
$('#error-dialog').dialog('open');
});
}