X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fprefs.js;h=263970ca4d0fb7d130a0b79b40d9071203947c8d;hb=6b4ef168170e40c7580678dcd73fd81b5e95b2e0;hp=f0969f1c363c16b35af26aff36a43c7da9ef374b;hpb=c5cc1b418c38a357bcbe6c3ae671dd2da21fd4ab;p=brisk.git diff --git a/web/prefs.js b/web/prefs.js index f0969f1..263970c 100644 --- a/web/prefs.js +++ b/web/prefs.js @@ -5,6 +5,7 @@ var l_prefs_list_idx = new Array( 0x00, 0x01, 0x02 ); var l_prefs_list_id = new Array( "all", "auth", "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'); +var standup_data_notisol = null; function client_prefs(old) { @@ -35,6 +36,8 @@ function prefs_apply(prefs_new, is_update, is_volat) var i; var relo = false; + console.log('prefs_apply: begin'); + if (typeof(g_prefs) == 'undefined') return false; /* listen management */ @@ -65,7 +68,7 @@ function prefs_apply(prefs_new, is_update, is_volat) } if (relo || !is_update) { - for (i = g_tables_auth_n ; i < g_tables_n ; i++) { + for (i = g_tables_appr_n ; i < g_tables_n ; i++) { if (i % 4 == 0) { $('tr_noauth'+i).style.display = (prefs_new.listen == l_list_isol ? 'none' : ''); } @@ -79,9 +82,27 @@ function prefs_apply(prefs_new, is_update, is_volat) tra.show_noauth(); } - if (false) { + if (prefs != undefined) { + if (prefs.listen != l_list_isol && prefs_new.listen == l_list_isol) { + if (standup_data_old != null) { + standup_data_notisol = standup_data_old.slice(); + } + } + else if (prefs.listen == l_list_isol && prefs_new.listen != l_list_isol) { + if (standup_data_notisol != null) { + standup_data_old = standup_data_notisol; + standup_data_notisol = null; + } + } + } + + if (true) { // ricalculation of standup area + g_prefs.listen = prefs_new.listen; + + console.log('here we are'); if (standup_data_old != null) { + console.log('here we are2'); standup_data = standup_data_old; standup_data_old = null; j_stand_cont(standup_data); @@ -112,10 +133,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) @@ -206,7 +238,7 @@ function list_set(what, is_update, info) if (relo || !is_update) { - for (i = g_tables_auth_n ; i < g_tables_n ; i++) { + for (i = g_tables_appr_n ; i < g_tables_n ; i++) { if (i % 4 == 0) { $('tr_noauth'+i).style.display = (what == 'isolation' ? 'none' : '');