From 8fac461bc252da4aebf1fefbe25904251946bb6a Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Fri, 14 Dec 2012 09:24:24 +0100 Subject: [PATCH] visual heartbit added and reload fixed in explorer transport --- web/briskin5/index.php | 20 ++++++++++++------ web/heartbit.js | 12 ++++++++++- web/index.php | 11 +++------- web/xynt-streaming.js | 48 +++++++++++++++++++++++++++++++++++++++--- 4 files changed, 73 insertions(+), 18 deletions(-) diff --git a/web/briskin5/index.php b/web/briskin5/index.php index ca57254..181b9e9 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -32,8 +32,14 @@ require_once("Obj/briskin5.phh"); $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.
Scegli il seme:', 'en' => 'You win the auction.
Choose the seed:' ), - 'tit_pref'=>array( 'it' => 'Preferenze.', - 'en' => 'Preferences.'), + 'tit_info' => array( 'it' => 'Info', + 'en' => 'Info'), + 'tit_relo' => array( 'it' => 'Reload', + 'en' => 'Reload'), + 'tit_out' => array( 'it' => 'Fuori', + 'en' => 'Out'), + 'tit_pref' => array( 'it' => 'Prefs', + 'en' => 'Prefs'), 'itm_ringauc' => array('it' => 'riproduci un suono di notifica alla fine dell\' asta', 'en' => 'play a sound at the end of the auction'), 'btn_update' => array('it' => 'Aggiorna.', @@ -247,11 +253,13 @@ window.onload = function() {
- - - + + + - + + +
diff --git a/web/heartbit.js b/web/heartbit.js index d408775..c1d0180 100644 --- a/web/heartbit.js +++ b/web/heartbit.js @@ -1,4 +1,4 @@ -function heartbit(symb) +function heartbit_old(symb) { if ($("heartbit").innerHTML.length >= 120) { $("heartbit").innerHTML = $("heartbit").innerHTML.substring(10); @@ -9,3 +9,13 @@ function heartbit(symb) } } +function heartbit(s_stat, w_stat) +{ + if (w_stat == "r") { + $("stm_stat").src = "img/line-status_cb.png"; + } + else { + $("stm_stat").src = "img/line-status_o"+s_stat+".png"; + } +} + diff --git a/web/index.php b/web/index.php index 5ed0bd3..e8b0cf1 100644 --- a/web/index.php +++ b/web/index.php @@ -20,13 +20,7 @@ * not, write to the Free Software Foundation, Inc, 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * - - -TODO: - - header - - setcookie - - gestire per intero la var globale di output -*/ + */ require_once("Obj/brisk.phh"); require_once("Obj/auth.phh"); @@ -849,7 +843,8 @@ supported by:


%s %s -
'; +
+'; /* Templates. */ if ($ACTION == 'login') { diff --git a/web/xynt-streaming.js b/web/xynt-streaming.js index 50cea6d..dc0043e 100644 --- a/web/xynt-streaming.js +++ b/web/xynt-streaming.js @@ -198,6 +198,8 @@ transport_htmlfile.prototype = { }, ctx_new_getchar: function(idx) { /* public */ + return (this.ifra.contentWindow.ctx_new.charAt(idx)); + }, ctx_old_len_is_set: function () { /* public */ @@ -309,6 +311,7 @@ transport_iframe.prototype = { }, ctx_new_getchar: function(idx) { /* public */ + return (this.ifra.contentWindow.ctx_new.charAt(idx)); }, ctx_old_len_is_set: function () { /* public */ @@ -379,7 +382,7 @@ xynt_streaming.prototype = { doc: null, cookiepath: "/brisk/", watchdog_hdl: null, - hbit: null, + hbit: function () {}, keepalive_old: -1, keepalive_new: -1, keepalives_equal: 0, @@ -396,6 +399,9 @@ xynt_streaming.prototype = { stream: "", the_end: false, + w_stat_old: "", + s_stat_old: "", + start: function() { /* public */ if (this.the_end) return; @@ -447,12 +453,44 @@ xynt_streaming.prototype = { this.hbit = hbit; }, + hbit_status: function () { + if (this.watchdog_hdl) + w_stat = "g"; + else + w_stat = "r"; + + if (this.transp.ctx_new_is_set() && + this.transp.ctx_new_curlen_get() > 0) { + if (this.keepalives_equal == 0) { + s_stat = "g"; + } + else if (this.keepalives_equal < this.keepalives_eq_max) { + s_stat = "y"; + } + else { + s_stat = "r"; + } + } + else { + s_stat = "r"; + } + + if (this.s_stat_old != s_stat || + this.w_stat_old != w_stat) + this.hbit(s_stat, w_stat); + this.s_stat_old = s_stat; + this.w_stat_old = w_stat; + }, + watchdog: function () { // alert("watchdog"); var i, again; var comm_newpart, comm_len, comm_arr; var ctx_new_len; + this.watchdog_hdl = null; + + this.hbit_status(); if (this.sandbox != null) { // from old: var zug = "POLL sess = "+sess+" stat = "+stat+" subst = "+subst+" step = "+this.gst.st+" step_loc = "+this.gst.st_loc+" step_loc_new = "+this.gst.st_loc_new+" STOP: "+this.stopped; var zug = "WATCHDOG sess = ["+this.sess+"] step = "+this.gst.st+" step_loc = "+this.gst.st_loc+" step_loc_new = "+this.gst.st_loc_new; @@ -491,6 +529,8 @@ xynt_streaming.prototype = { } if ( (this.watchdog_ct % this.watchdog_checktm) == 0) { this.log("hs::watchdog: this.keepalive_old: "+this.keepalive_old+" this.keepalive_new: "+this.keepalive_new); + + // alert("qui "+this.transp.ctx_new_curlen_get()+" "+this.transp.ctx_old_len_get(); if (this.keepalive_old == this.keepalive_new) { this.keepalives_equal++; } @@ -521,9 +561,9 @@ xynt_streaming.prototype = { catch(b) { break; } - // ctx_new_len = this.ifra.contentWindow.ctx_new.length; ctx_new_len = this.transp.ctx_new_curlen_get(); + this.log("new_len: "+ ctx_new_len); // if (ctx_new_len <= this.ifra.contentWindow.ctx_old_len) { if (ctx_new_len <= this.transp.ctx_old_len_get()) { break; @@ -532,7 +572,8 @@ xynt_streaming.prototype = { this.keepalive_new++; // alert("pre-loop 1"); for (i = this.transp.ctx_old_len_get() ; i < ctx_new_len ; i++) { - // if (this.ifra.contentWindow.ctx_new.charAt(i) != '_') { + // alert("ctx_new_getchar: "+this.transp.ctx_new_getchar(i)); + if (this.transp.ctx_new_getchar(i) != '_') { // this.log("ctx_new.char(i) != '_' ["+this.ifra.contentWindow.ctx_new.charAt(i)+"]"); break; @@ -603,6 +644,7 @@ xynt_streaming.prototype = { this.transp.postproc(); } this.watchdog_hdl = setTimeout(function(obj) { /* obj.log("tout2"); */ obj.watchdog(); }, this.watchdog_timeout, this); + this.hbit_status(); } // alert("watchdog return normal"); -- 2.17.1