*
*/
+var mlang_prefsf = { 'btn_close' : { 'it' : 'Chiudi.',
+ 'en' : 'Close.' },
+ 'tit_list' : { '0' : { 'it' : '',
+ 'en' : '' },
+ '1' : { 'it' : '(solo aut.)',
+ 'en' : '(only aut.)' },
+ '2' : { 'it' : '(isolam.to)',
+ 'en' : '(isolation)' } }
+ };
+
var mlang_prefsn = { 'btn_close' : { 'it' : 'Chiudi.',
'en' : 'Close.' },
'tit_list' : { '0' : { 'it' : '',
if (g_prefsn.data == null || g_prefsn.data.listen != field.value) {
$('list_info').innerHTML = mlang_prefsn['tit_list'][field.value][g_lang];
console.log('update listen');
- for (i = g_tables_auth_n ; i < g_tables_n ; i++) {
+ for (i = g_tables_cert_n + g_tables_auth_n ; i < g_tables_n ; i++) {
if (i % 4 == 0) {
$('tr_noauth'+i).style.display = (field.value == l_list_isol ? 'none' : '');
}
}
}
}
+
+var g_prefsf = null;
+function g_prefsf_listen_cb(item)
+{
+ var whats = [ 'all', 'auth', 'isolation' ];
+ var what = whats[item.value];
+
+ console.log("change listen", item.value);
+
+ $('list_info').innerHTML = mlang_prefsf.tit_list[item.value][g_lang];
+
+ for (i = g_tables_cert_n + 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();
+ }
+}
+
+function g_prefsf_comps_cb(item, type)
+{
+ console.log(item);
+ console.log(g_prefsf);
+
+ var col, ct = 0, s = "";
+ var col_arr = [ 'fg', 'bg' ];
+ var cmp_arr = [ 'r', 'g', 'b' ];
+ for (col in col_arr) {
+ for (cmp in cmp_arr) {
+ console.log(g_prefsf.bsk_comps[col_arr[col]][cmp_arr[cmp]].value);
+ var val_s = g_prefsf.bsk_comps[col_arr[col]][cmp_arr[cmp]].value;
+ if (parseInt(val_s) < 0 || parseInt(val_s) > 255 || isNaN(parseInt(val_s)))
+ return false;
+ s += dec2hex(parseInt(val_s), 2);
+ }
+ console.log("sub: [" + s + "]");
+ }
+ $('s_img').src = 'suprend.php?comp=' + s;
+}
+
+function prefsf_status_cb(st)
+{
+ // console.log('status_show HERE ' + st);
+ switch(st) {
+ case Fieldify.STATUS_OK:
+ $('prefsf-status-flag').src = 'img/light-green.png';
+ break;
+ case Fieldify.STATUS_PROC:
+ $('prefsf-status-flag').src = 'img/light-orange.png';
+ break;
+ default: // Fieldify.STATUS_ERR
+ $('prefsf-status-flag').src = 'img/light-red.png';
+ break;
+ }
+}
+
+function prefsf_initialize()
+{
+ clie_cb = { 'listen': { cb: g_prefsf_listen_cb, type: "fast" },
+ 'fg': { 'r': { cb: g_prefsf_comps_cb, type: "fast"},
+ 'g': { cb: g_prefsf_comps_cb, type: "fast"},
+ 'b': { cb: g_prefsf_comps_cb, type: "fast"}},
+ 'bg': { 'r': { cb: g_prefsf_comps_cb, type: "fast"},
+ 'g': { cb: g_prefsf_comps_cb, type: "fast"},
+ 'b': { cb: g_prefsf_comps_cb, type: "fast"}}};
+ g_prefsf = new Fieldify(null, null, null, clie_cb, "prefsf", [$("prefsf")], prefsf_status_cb);
+ g_prefsf.bsk_comps = { 'bg': { 'r': $C('bg_r') != undefined ? $C('bg_r')[0] : null,
+ 'g': $C('bg_g') != undefined ? $C('bg_g')[0] : null,
+ 'b': $C('bg_b') != undefined ? $C('bg_b')[0] : null },
+ 'fg': { 'r': $C('fg_r') != undefined ? $C('fg_r')[0] : null,
+ 'g': $C('fg_g') != undefined ? $C('fg_g')[0] : null,
+ 'b': $C('fg_b') != undefined ? $C('fg_b')[0] : null} };
+}