X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fprefs.js;h=83f3d31afe9a8d310c3d17aacd539ac1faf4e9a2;hb=ddcd0fa5b77835ba0fed3ffed6b55ff5559151f9;hp=f0969f1c363c16b35af26aff36a43c7da9ef374b;hpb=c5cc1b418c38a357bcbe6c3ae671dd2da21fd4ab;p=brisk.git diff --git a/web/prefs.js b/web/prefs.js index f0969f1..83f3d31 100644 --- a/web/prefs.js +++ b/web/prefs.js @@ -1,8 +1,7 @@ var l_list_all = 0x00; -var l_list_auth = 0x01; -var l_list_isol = 0x02; -var l_prefs_list_idx = new Array( 0x00, 0x01, 0x02 ); -var l_prefs_list_id = new Array( "all", "auth", "isol" ); +var l_list_isol = 0x01; +var l_prefs_list_idx = new Array( 0x00, 0x01 ); +var l_prefs_list_id = new Array( "all", "isol" ); var l_comps_name = new Array('s_fg_r', 's_fg_g', 's_fg_b', 's_bg_r', 's_bg_g', 's_bg_b'); @@ -65,13 +64,9 @@ function prefs_apply(prefs_new, is_update, is_volat) } 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' : ''); - } + $('tr.noauth').style.display = (prefs_new.listen == l_list_isol ? 'none' : ''); + $('td.noauth').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(); } @@ -112,10 +107,21 @@ function prefs_save() if (typeof(g_prefs) == 'undefined') return false; - ret = server_request('mesg', 'prefs','__POST__', 'prefs', JSON.stringify(g_prefs)); + ret = server_request('mesg', 'prefs|save','__POST__', 'prefs', JSON.stringify(g_prefs)); - if (ret == 1) + if (ret == 1) { $('preferences').style.visibility = 'hidden'; + } + else { + alert(ret); + } +} + +function prefs_reset() +{ + var ret; + + ret = server_request('mesg', 'prefs|reset'); } function prefs_update(field) @@ -170,16 +176,7 @@ function list_set(what, is_update, info) 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'; + if (what == 'isolation') { $('list_isol').style.color = 'red'; $('list_all').style.color = 'black'; if (old_st != 'isolation') @@ -187,7 +184,6 @@ function list_set(what, is_update, info) 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') @@ -195,7 +191,6 @@ function list_set(what, is_update, info) 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); @@ -206,14 +201,9 @@ function list_set(what, is_update, info) 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' : ''); - } + $('tr.noauth').style.display = (what == 'isolation' ? 'none' : ''); + $('td.noauth').style.display = (what == 'isolation' ? 'none' : ''); + if (what == 'isolation') { tra.hide_noauth(); }