X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Froom.js;h=f6d6d247b2cef63c8375ac3a496f8f7f33a82487;hb=29386faba01ac22d3d47e5f467412dc63b4e22cf;hp=173b00453fd90be6436fea4bf135d42b2f665bbb;hpb=7f526939ded24298104cacd02b5f364bcc7bfa56;p=brisk.git diff --git a/web/room.js b/web/room.js index 173b004..f6d6d24 100644 --- a/web/room.js +++ b/web/room.js @@ -421,11 +421,13 @@ function j_stand_cont(ddata) table_add($("standup"), td); } - standup_data_old = data; - return; } - // $("esco").innerHTML = ''; + + var usr = $("standup").getElementsByClassName("id_usr"); + for (i = 0 ; i < usr.length ; i++) { + addEvent(usr[i], "click", click_update_cb); + } } function esco_cb() { @@ -435,7 +437,43 @@ function esco_cb() { act_logout(0); }; +var g_user_info_target = ""; +function info_show(username) +{ + // ret = server_request('mesg', 'prefs|save','__POST__', 'prefs', JSON.stringify(g_prefs)); + var info_in = JSON.parse(server_request('mesg', 'chatt|/info ' + username)); + var info = null; + + if (info_in.ret == 0) { + var fields = { login: { type: 'value' }, + state: { type: 'value' }, + guar: { type: 'value' }, + match: { type: 'value' }, + game: { type: 'value' }, + friend: { type: 'radio' } }; + + info = new Fieldify($('info'), fields); + info.populate(info_in); + info.visible(true); + } + else { + console.log("some error: open a dialog"); + } + // FIXME: just to be finished + console.log(info); +} + +function click_update_cb(e) +{ + if (g_user_info_target == e.target.innerHTML) { + g_user_info_target = ""; + info_show(e.target.innerHTML); + } + else { + g_user_info_target = e.target.innerHTML; + } +} function j_tab_cont(table_idx, data) { @@ -443,13 +481,15 @@ 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 += '
'; } $("table"+table_idx).innerHTML = content; + var usr = $("table"+table_idx).getElementsByClassName("id_usr"); + for (i = 0 ; i < usr.length ; i++) { + addEvent(usr[i], "click", click_update_cb); + } } function j_tab_act_cont(idx, act) @@ -523,31 +563,36 @@ function j_check_login(login, ret) } -function j_new_apprendice(form) +function j_new_apprentice(form) { var ret = { ret: '' }; var token; do { + if (form.elements['realsub'].value == "close") { + $('apprentice_div').style.display = 'none'; + break; + } + if (j_check_login(form.elements['nameid'].value, ret) == false || j_check_email(form.elements['emailid'].value, ret) == false) { - no = new notify(gst, "
" + ret.ret + "
", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100); + no = new notify(gst, "
" + ret.ret + "
", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100); break; } // submit the request - token = server_request('mesg', 'apprendice', + token = server_request('mesg', 'apprentice', 'cli_name', encodeURIComponent(form.elements['nameid'].value), 'cli_email', encodeURIComponent(form.elements['emailid'].value), 'cli_lang', g_lang); if (token == "1") { // FIXME LANG - $('apprendice_div').style.display = "none"; - no = new notify(gst, "
Richiesta inviata con successo.
Riceverai a breve un' e-mail per verificare la correttezza dell'indirizzo.
", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100); + $('apprentice_div').style.display = "none"; + no = new notify(gst, "
Richiesta inviata con successo.
Riceverai a breve un' e-mail per verificare la correttezza dell'indirizzo.
", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100); } else { - no = new notify(gst, "
" + token + "
", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100); + no = new notify(gst, "
" + token + "
", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100); } } while (0); @@ -693,7 +738,7 @@ function j_mesgtoadmbox(form) var no; do { - if (form.elements['realsub'].value == "chiudi") { + if (form.elements['realsub'].value == "cloid") { $('mesgtoadmbox').style.visibility = "hidden"; break; }