var open_group function gropen each function var cl this className spl

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
var open_group = function(e) {
$('a.gropen').each(function() {
var cl = this.className.split(' ');
var newcl = 'grclosed ';
for (var i = 0; i < cl.length; i++) {
if (cl[i].indexOf('color-') == 0) {
newcl += cl[i] + ' ' + cl[i].substring(6) + '-sm';
break;
}
}
this.className = newcl;
});
var cl = e.attr('className').split(' ');
var newcl = 'gropen ';
for (var i = 0; i < cl.length; i++) {
if (cl[i].indexOf('color-') == 0) {
newcl += cl[i] + ' ' + cl[i].substring(6) + '-bg';
break;
}
}
e.get(0).className = newcl;
var g = cache[e.data('groupname')];
$('#info_groupname').text(display_group_name(g.name));
$('#info_groupfeed').attr('href', g.rssurl);
$('#info_groupfeed_text').val(g.rssurl);
$('#groupmembers_members').empty();
$('#groupmembers_feed .usermsg, #groupmembers_feed .line, #groupmembers_feed .msg-edit-buttons').remove();
for (var i = 0; i< g.users.length; i++) {
render_user(g.users[i], g);
}
if ($('#groupmembers_feed').css('display') != 'none') {
load_feed(g.name, 0);
}
}