X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Froom.js;h=e3f08b026ddfb22403122f76013505bd226acd61;hb=e05b72f2d772b765dd9bd54098cd2c4efbb7b06b;hp=c8c5052aff88dac953fa677304e78a324af7487c;hpb=8cf173d68f241c4a2afb9d129176d43886026ba0;p=brisk.git
diff --git a/web/room.js b/web/room.js
index c8c5052..e3f08b0 100644
--- a/web/room.js
+++ b/web/room.js
@@ -23,23 +23,21 @@
/*
- data = [ [ flags, name ], ... ]
+
+ data = [ [ flags, flags_vlt, name ], ... ]
*/
-var l_list_all = 0x00;
-var l_list_auth = 0x01;
-var l_list_isol = 0x02;
-function state_add(flags)
+function state_add(flags, flags_vlt, comp)
{
var content = "", supercont = "";
var st, superst, name = "", supername = "", supersfx = "";
var tit = "", supertit = "";
- if ((flags & 0xf00) != 0) {
- st = flags & 0xf00;
+ if ((flags_vlt & 0xf00) != 0) {
+ st = flags_vlt & 0xf00;
// MLANG 4,12,16,20,24,28
switch (st) {
case 0x100:
@@ -115,14 +113,19 @@ function state_add(flags)
switch (superst) {
case 0x20000:
- supername = "superuser"+supersfx+".png";
+ if (comp != null) {
+ supername = "suprend.php?comp="+comp+"&sfx="+supersfx;
+ }
+ else {
+ supername = "img/superuser"+supersfx+".png";
+ }
supertit = (g_lang == 'en' ? "Brisk Supporter" : "Brisk Supporter");
break;
}
}
if (supername != "") {
- content += ' ';
+ content += ' ';
}
if (name != "") {
@@ -260,6 +263,9 @@ function j_stand_tdcont(el)
return (user_dec_and_state(el));
}
+/*
+ ddata = [ [ , , , ], ... ]
+ */
function j_stand_cont(ddata)
{
var i, ii;
@@ -273,7 +279,7 @@ function j_stand_cont(ddata)
data = new Array();
for (i = 0, ii = 0 ; ii < ddata.length ; ii++) {
- if ((ddata[ii][0] & 0x02) == 0) {
+ if ((ddata[ii][BSK_USER_FLAGS] & 0x02) == 0) {
continue;
}
data[i++] = ddata[ii];
@@ -282,9 +288,11 @@ function j_stand_cont(ddata)
else
data = ddata;
+ // WARNING:
+ //
+ // managing update needs this branch (for few users and the else!!)
+ //
if (standup_data_old == null || data.length < 4) {
- // if (standup_data_old == null) {
-
content = '';
for (i = 0 ; i < data.length ; i++) {
if ((i % 4) == 0)
@@ -302,18 +310,6 @@ function j_stand_cont(ddata)
$("standup").innerHTML = content;
- // console.log("inizio");
- // for (i = 0 , curtag = table_walk($("standup")) ; curtag != null ; curtag = table_walk(curtag), i++ ) {
- // console.log("inloop["+i+"]: "+curtag.tagName+" ID: "+curtag.id);
- // }
- // console.log("fine "+i);
-
- // walktable($("standup"), nextag);
- // console.log($("standup").firstChild);
- // console.log($("standup").firstChild.firstChild.firstChild.firstChild);
-
- // log_walk($("standup"));
-
standup_data_old = data;
}
else {
@@ -333,7 +329,7 @@ function j_stand_cont(ddata)
// find removed entries
for (i = 0 ; i < standup_data_old.length ; i++) {
for (e = 0 ; e < data.length ; e++) {
- if (standup_data_old[i][1] == data[e][1]) {
+ if (standup_data_old[i][BSK_USER_NICK] == data[e][BSK_USER_NICK]) {
break;
}
}
@@ -343,7 +339,10 @@ function j_stand_cont(ddata)
}
else {
/* modified entries */
- if (standup_data_old[i][0] != data[e][0]) {
+ if (standup_data_old[i][BSK_USER_FLAGS] != data[e][BSK_USER_FLAGS] ||
+ standup_data_old[i][BSK_USER_FLGVL] != data[e][BSK_USER_FLGVL] ||
+ standup_data_old[i].length != data[e].length ||
+ (data[e].length == 4 && standup_data_old[i][BSK_USER_SCOL] != data[e][BSK_USER_SCOL])) {
arr_mod[idx_mod_n] = data[e];
idx_mod[idx_mod_n++] = i;
}
@@ -354,12 +353,12 @@ function j_stand_cont(ddata)
// find new entries
for (e = 0 ; e < data.length ; e++) {
for (i = 0 ; i < standup_data_old.length ; i++) {
- if (data[e][1] == standup_data_old[i][1] ) {
+ if (data[e][BSK_USER_NICK] == standup_data_old[i][BSK_USER_NICK] ) {
break;
}
}
if (i == standup_data_old.length) {
- // console.log("ADD: "+data[e][1]);
+ // console.log("ADD: "+data[e][BSK_USER_NICK]);
arr_add[idx_add_n] = data[e];
map_add[idx_add_n++] = e;
}
@@ -416,7 +415,7 @@ function j_stand_cont(ddata)
// console.log("fineloop");
for (i ; i_add < idx_add_n ; i_add++, i++) {
- // console.log("ADD: "+i+" arr_add: "+ arr_add[i_add][1]);
+ // console.log("ADD: "+i+" arr_add: "+ arr_add[i_add][BSK_USER_NICK]);
td = document.createElement("td");
td.className = "room_standup";
td.id = map_add[i_add];
@@ -446,8 +445,6 @@ function j_tab_cont(table_idx, data)
var content = '';
for (i = 0 ; i < data.length ; i++) {
- // content += user_decorator(data[i]);
- // content += state_add(data[i][0]);
content += j_stand_tdcont(data[i]);
content += '
';
@@ -695,77 +692,6 @@ function j_pollbox(form)
}
-
-
-function list_set(what, is_update, info)
-{
- // console.log(what);
- var i;
- var relo = false;
- var old_st = readCookie("CO_list");
-
- if (what == 'auth') {
- $('list_auth').style.color = 'red';
- $('list_isol').style.color = 'black';
- $('list_all').style.color = 'black';
- if (old_st == 'isolation')
- relo = true;
- g_listen = l_list_auth;
- }
- else if (what == 'isolation') {
- $('list_auth').style.color = 'black';
- $('list_isol').style.color = 'red';
- $('list_all').style.color = 'black';
- if (old_st != 'isolation')
- relo = true;
- g_listen = l_list_isol;
- }
- else {
- $('list_auth').style.color = 'black';
- $('list_isol').style.color = 'black';
- $('list_all').style.color = 'red';
- if (old_st == 'isolation')
- relo = true;
- g_listen = l_list_all;
- }
-
- set_checked_value($('ra_listen_auth'), what);
- set_checked_value($('ra_listen_isol'), what);
- set_checked_value($('ra_listen_all'), what);
-
- $('list_info').innerHTML = info;
- if (is_update) {
- createCookie("CO_list", what, 24*365, cookiepath);
- }
-
-
- if (relo || !is_update) {
- for (i = g_tables_auth_n ; i < g_tables_n ; i++) {
-
- if (i % 4 == 0) {
- $('tr_noauth'+i).style.display = (what == 'isolation' ? 'none' : '');
- }
-
- $('td_noauth'+i).style.display = (what == 'isolation' ? 'none' : '');
- }
- if (what == 'isolation') {
- tra.hide_noauth();
- }
- else {
- tra.show_noauth();
- }
-
- if (false) {
- // ricalculation of standup area
- if (standup_data_old != null) {
- standup_data = standup_data_old;
- standup_data_old = null;
- j_stand_cont(standup_data);
- }
- }
- }
-}
-
function sideslide(domobj, height, step)
{
this.st = 'wait';