From 614b8793291647f99233c7528d64942494f1cb0f Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sat, 8 Aug 2009 15:29:10 +0000 Subject: [PATCH] block_time extension added to notify_ex --- web/commons.js | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/web/commons.js b/web/commons.js index 5de441f..f564eea 100644 --- a/web/commons.js +++ b/web/commons.js @@ -332,7 +332,10 @@ function act_wakeup() send_mesg("wakeup"); } - +function act_splash(date) +{ + send_mesg("splash|"+date); +} function act_help() { @@ -556,7 +559,7 @@ slowimg.prototype = { } -function notify_ex(st, text, tout, butt, w, h, is_opa) +function notify_ex(st, text, tout, butt, w, h, is_opa, block_time) { var clo, box; var t = this; @@ -571,12 +574,21 @@ function notify_ex(st, text, tout, butt, w, h, is_opa) clo.type = "submit"; clo.className = "button"; clo.style.bottom = "4px"; - clo.value = butt; clo.obj = this; - clo.onclick = this.input_hide; - + if (block_time > 0) { + clo.value = "leggere, prego."; + this.butt = butt; + } + else { + clo.value = butt; + clo.onclick = this.input_hide; + } + clodiv = document.createElement("div"); clodiv.className = "notify_clo"; + this.clo = clo; + this.clodiv = clodiv; + clodiv.appendChild(clo); cont = document.createElement("div"); @@ -609,8 +621,13 @@ function notify_ex(st, text, tout, butt, w, h, is_opa) this.toutid = setTimeout(function(obj){ obj.unblock(); }, tout, this); - formsub_hilite(clo); - clo.focus(); + if (block_time != 0) { + this.tblkid = setTimeout(function(obj){ obj.clo.value = obj.butt; obj.clo.onclick = obj.input_hide; formsub_hilite(obj.clo); obj.clo.focus(); }, block_time, this); + } + else { + formsub_hilite(clo); + clo.focus(); + } } @@ -620,7 +637,11 @@ notify_ex.prototype = { st: null, notitag: null, toutid: null, - + clo: null, + clodiv: null, + butt: null, + tblkid: null, + unblock: function() { if (this.st.st_loc < this.st.st_loc_new) { @@ -651,7 +672,7 @@ notify.superClass = notify_ex.prototype; function notify(st, text, tout, butt, w, h) { - notify_ex.call(this, st, text, tout, butt, w, h, false); + notify_ex.call(this, st, text, tout, butt, w, h, false, 0); } -- 2.17.1