X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Froom.js;h=27093bbba3b31e9734db1a57c23af4bf90576430;hb=4fc44e9a6f4f15b3d86cfb378d7a8d73cffe0844;hp=0e0aed916e1be31f7e68652b0d0cda87ff5f0205;hpb=ea9ea2b7924e1aa5e55f5cbc3909375a38b9d730;p=brisk.git diff --git a/web/room.js b/web/room.js index 0e0aed9..27093bb 100644 --- a/web/room.js +++ b/web/room.js @@ -580,6 +580,40 @@ function mesgtoadmbox(w, h) $('mesgtoadm_form').elements['subj'].focus(); } +function j_pollbox(form) +{ + var no, i, choose; + + do { + // submit the request + + for (i = 0 ; i < form.elements.length ; i++) { + if (form.elements[i].checked == true) + break; + } + if (i == form.elements.length) { + no = new notify(gst, "
Non hai espresso nessuna preferenza;
correggi per favore.", 1, "chiudi", 280, 100); + return false; + } + else + choose = form.elements[i].value; + + token = server_request('mesg', 'poll', + 'cli_choose', encodeURIComponent(choose) ); + + if (token == "1") { + // TODO: mesg to user + // $('mesgtoadmbox').style.visibility = "hidden"; + break; + } + } while (0); + + return (false); +} + + + + function list_set(what, setco, info) { if (what == 'auth') { @@ -595,3 +629,66 @@ function list_set(what, setco, info) createCookie("CO_list", what, 24*365, cookiepath); } } + +function sideslide(domobj, height, step) +{ + this.st = 'wait'; + this.twait = 5000; + + this.domobj = domobj; + this.height = height; + this.step = step; + + this.start(); +} + +sideslide.prototype = { + id: null, + st: 'wait', + twait: 0, + scroll: 0, + countdown: 0, + + domobj: null, + height: 0, + step: 0, + + start: function() { + var instant = this; + + this.st = 'wait'; + this.id = setTimeout(function () { instant.sideslide_cb(); }, this.twait); + }, + + sideslide_cb: function() { + var instant = this; + + if (this.st == 'wait') { + this.st = 'scroll'; + this.countdown = 10; + this.id = setInterval(function () { instant.sideslide_cb(); }, 100); + } + else if (this.st == 'scroll') { + this.scroll += (this.step / 10); + if (this.scroll >= this.height - this.step) { + this.scroll = 0; + } + this.domobj.scrollTop = this.scroll; + this.countdown--; + if (this.countdown == 0) { + this.stop(); + this.st = 'wait'; + this.id = setTimeout(function () { instant.sideslide_cb(); }, this.twait); + } + } + }, + + + stop: function() { + if (this.id != null) { + clearInterval(this.id); + this.id = null; + } + } + +}