X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Froom.js;h=2a017b92e837406c4d1676a2e85e61e830fe361f;hb=fe2b23562e38f13d1a87ba23c7d7a273a8f19b56;hp=000ce3817b8943ba67b0ac6bab3a9ab318cdec2f;hpb=70a16abf6a1bad283cc2aa9503a3b675863fdefa;p=brisk.git
diff --git a/web/room.js b/web/room.js
index 000ce38..2a017b9 100644
--- a/web/room.js
+++ b/web/room.js
@@ -3,10 +3,59 @@
*/
+function state_add(flags)
+{
+ var content = "";
+ var st, name = "";
+ var tit = "";
+
+ if ((flags & 0xf00) != 0) {
+ st = flags & 0xf00;
+ switch (st) {
+ case 0x100:
+ name = "st_pau.png";
+ tit = "sono in pausa";
+ break;
+ case 0x200:
+ name = "st_out.png";
+ tit = "sono fuori";
+ break;
+ case 0x300:
+ name = "st_dog.png";
+ tit = "sono a spasso col cane";
+ break;
+ case 0x400:
+ name = "st_eat.png";
+ tit = "sto mangiando";
+ break;
+ case 0x500:
+ name = "st_wrk.png";
+ tit = "sono a lavoro";
+ break;
+ case 0x600:
+ name = "st_smk.png";
+ tit = "sto fumando una sigaretta (e facendomi venire il cancro)";
+ break;
+ case 0x700:
+ name = "st_eye.png";
+ tit = "sono presente!";
+ break;
+ default:
+ break;
+ }
+ if (name != "") {
+ content += '';
+ }
+ }
+
+ return content;
+}
+
function j_stand_cont(data)
{
var i;
var content;
+ var st, name = "";
content = '
';
for (i = 0 ; i < data.length ; i++) {
@@ -27,6 +76,7 @@ function j_stand_cont(data)
if (data[i][0] & 0x01)
content += '';
+ content += state_add(data[i][0]);
content += '';
if ((i % 4) == 3)
@@ -67,6 +117,7 @@ function j_tab_cont(table_idx, data)
if (data[i][0] & 0x01)
content += '';
+ content += state_add(data[i][0]);
content += '
';
}
@@ -103,7 +154,7 @@ function j_login_manager(form)
else {
// console.log("richiesta token");
/* richiede token */
- token = server_request('getchallenge|'+encodeURIComponent(form.elements['nameid'].value));
+ token = server_request('mesg', 'getchallenge', 'cli_name', encodeURIComponent(form.elements['nameid'].value));
tokens = token.split('|');
// console.log('XX token: '+token);
@@ -148,3 +199,64 @@ function login_init()
menu_init();
login_formtext_hilite();
}
+
+function warrant_formtext_hilite()
+{
+ formtext_hilite($("nameid"));
+ formtext_hilite($("emailid"));
+ formsub_hilite($("subid"));
+ formsub_hilite($("cloid"));
+}
+
+
+function j_check_email(email)
+{
+ if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
+ return (true);
+ return (false);
+}
+
+function j_authbox(form)
+{
+ var no;
+
+ if (form.elements['realsub'].value == "chiudi") {
+ $('authbox').style.visibility = "hidden";
+ return (false);
+ }
+
+ if (form.elements['name'].value == '' || j_check_email(form.elements['email'].value) == false)
+ no = new notify(gst, "
I campi user e/o e-mail non sono validi; correggeteli per favore.", 1, "chiudi", 280, 100);
+ else {
+ // submit the request
+ token = server_request('mesg', 'warranty',
+ 'cli_name', encodeURIComponent(form.elements['name'].value),
+ 'cli_email', encodeURIComponent(form.elements['email'].value) );
+ if (token == "1") {
+ $('authbox').style.visibility = "hidden";
+ form.elements['name'].value = "";
+ form.elements['email'].value = "";
+ return (false);
+ }
+ }
+
+ return (false);
+}
+
+function authbox(w, h)
+{
+ var box;
+
+ box = $('authbox');
+
+ box.style.zIndex = 200;
+ box.style.width = w+"px";
+ box.style.marginLeft = -parseInt(w/2)+"px";
+ box.style.height = h+"px";
+ box.style.top = parseInt((document.body.clientHeight - h) / 2) + document.body.scrollTop;
+
+ warrant_formtext_hilite();
+
+ box.style.visibility = "visible";
+ $("nameid").focus();
+}