X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Froom.js;h=82e6fcc1fac0e1e592bbcce3191c72b183dd04c8;hb=b65dddf6cb8fdc5a98719ed170ca38c2059b362c;hp=25725553a58ef1c393c0a7ee24d7e5faa8687a9b;hpb=3dc6d58fd477565017745b33c752232166a0b508;p=brisk.git diff --git a/web/room.js b/web/room.js index 2572555..82e6fcc 100644 --- a/web/room.js +++ b/web/room.js @@ -29,18 +29,6 @@ */ -var l_list_all = 0x00; -var l_list_auth = 0x01; -var l_list_isol = 0x02; - -function client_prefs() -{ -} - -client_prefs.prototype = { - listen: -1 -} - function state_add(flags) { var content = "", supercont = ""; @@ -704,192 +692,6 @@ function j_pollbox(form) return (false); } -function prefs_assign(content) -{ - var prefs_new; - var s; - - s = "prefs_new = " + content; - eval(s); - - return (prefs_new); -} - -var prefs_list_idx = new Array( 0x00, 0x01, 0x02 ); -var prefs_list_id = new Array( "all", "auth", "isol" ); - -function prefs_apply(prefs_new, is_update, is_volat) -{ - var i; - var relo = false; - - if (typeof(g_prefs) == 'undefined') - return false; - /* listen management */ - if (g_prefs.listen != prefs_new.listen || is_update) { - for (i = 0 ; i < prefs_list_idx.length ; i++) { - set_checked_value($('ra_listen_'+prefs_list_id[i]), prefs_new.listen); - if (prefs_new.listen == prefs_list_idx[i]) { - if (!is_volat) - $('list_'+prefs_list_id[i]).style.color = 'red'; - $('list_info').innerHTML = mlang_commons['tit_list'][i][g_lang]; - } - else { - if (!is_volat) - $('list_'+prefs_list_id[i]).style.color = 'black'; - } - } - - relo = true; - } - - - // TO BE ANALYZED !!! - // 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 = (prefs_new.listen == l_list_isol ? 'none' : ''); - } - - $('td_noauth'+i).style.display = (prefs_new.listen == l_list_isol ? 'none' : ''); - } - if (prefs_new.listen == l_list_isol) { - 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); - } - } - } - - g_prefs.listen = prefs_new.listen; -} - -function prefs_load(content, is_update, is_volat) -{ - var prefs_new; - - if ((prefs_new = prefs_assign(content)) == null) - return false; - - return prefs_apply(prefs_new, is_update, is_volat); -} - -function prefs_save() -{ - var ret; - - if (typeof(g_prefs) == 'undefined') - return false; - - ret = server_request('mesg', 'prefs','__POST__', 'prefs', JSON.stringify(g_prefs)); - - if (ret == 1) - $('preferences').style.visibility = 'hidden'; -} - -function prefs_update() -{ - var i; - var prefs_new; - var relo = false; - - if (typeof(g_prefs) == 'undefined') - return false; - - prefs_new = new client_prefs(); - - /* listen management */ - for (i = 0 ; i < prefs_list_idx.length ; i++) { - prefs_new.listen = get_checked_value($('ra_listen_'+prefs_list_id[i])); - if (prefs_new.listen != '') - break; - } - - /* from form to struct */ - prefs_apply(prefs_new, true, true); -} - -function list_set(what, is_update, info) -{ - 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) {