From fd17945b9b7929b14e71974ecfcdc799ebe7c471 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sat, 17 Dec 2011 18:25:55 +0100 Subject: [PATCH] renamed xhr.js to http_streaming.js and move hbit to externa heartbit.js file --- INSTALL.sh | 2 +- web/briskin5/index.php | 5 +++-- web/heartbit.js | 11 +++++++++++ web/{xhr.js => http_streaming.js} | 16 +++------------- web/index.php | 13 +++++-------- 5 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 web/heartbit.js rename web/{xhr.js => http_streaming.js} (97%) diff --git a/INSTALL.sh b/INSTALL.sh index 134d2fb..e4321a1 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -313,7 +313,7 @@ sed -i "s@define *( *BRISK_CONF,[^)]*)@define(BRISK_CONF, \"$brisk_conf\")@g" ${ sed -i "s@define *( *BRISK_AUTH_CONF,[^)]*)@define(BRISK_AUTH_CONF, \"$brisk_auth_conf\")@g" ${web_path}__/Obj/auth.phh -sed -i "s@\( \+xhr_rd_cookiepath *: *\)\"[^\"]*\" *,@\1 \"$cookie_path\",@g" ${web_path}__/xhr.js +sed -i "s@\( \+xhr_rd_cookiepath *: *\)\"[^\"]*\" *,@\1 \"$cookie_path\",@g" ${web_path}__/http_streaming.js sed -i "s@var \+cookiepath \+= \+\"[^\"]*\";@var cookiepath = \"$cookie_path\";@g" ${web_path}__/commons.js if [ -d ${web_path} ]; then diff --git a/web/briskin5/index.php b/web/briskin5/index.php index 6a0b9e1..369e6b9 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -53,7 +53,8 @@ header('Content-type: text/html; charset="utf-8"',true); Brisk - Tavolo <?php echo "$table_idx";?> - + + @@ -101,7 +102,7 @@ window.onload = function() { sess = ""; hstm = new http_streaming("sess"); - hstm.hbit_set(hbit); + hstm.hbit_set(heartbit); window.onbeforeunload = onbeforeunload_cb; window.onunload = onunload_cb; diff --git a/web/heartbit.js b/web/heartbit.js new file mode 100644 index 0000000..d408775 --- /dev/null +++ b/web/heartbit.js @@ -0,0 +1,11 @@ +function heartbit(symb) +{ + if ($("heartbit").innerHTML.length >= 120) { + $("heartbit").innerHTML = $("heartbit").innerHTML.substring(10); + $("heartbit").innerHTML += symb; + } + else { + $("heartbit").innerHTML += symb; + } +} + diff --git a/web/xhr.js b/web/http_streaming.js similarity index 97% rename from web/xhr.js rename to web/http_streaming.js index 16a3495..a813814 100644 --- a/web/xhr.js +++ b/web/http_streaming.js @@ -1,5 +1,5 @@ /* - * brisk - xhr.js + * brisk - http_streaming.js * * Copyright (C) 2006-2011 Matteo Nastasi * mailto: nastasi@alternativeoutput.it @@ -24,7 +24,6 @@ * MANDATORY * * NOT MANDATORY - * - remove hbit imple * - gst management * - sandbox management * - myfrom into the constructor @@ -34,23 +33,14 @@ * - substitute fixed "eval" with a generic command hunks processor * * DONE - xhr_rd prefix remove from inner class attrs + * DONE - move hbit implementation to external file * */ -function hbit(symb) -{ - if ($("heartbit").innerHTML.length >= 120) { - $("heartbit").innerHTML = $("heartbit").innerHTML.substring(10); - $("heartbit").innerHTML += symb; - } - else { - $("heartbit").innerHTML += symb; - } -} - function http_streaming(cookiename) { this.xhr = createXMLHttpRequest(); + // this.xhr.setRequestHeader("Content-type", "text/html; charset=utf-8"); this.cookiename = cookiename; } diff --git a/web/index.php b/web/index.php index 170bb75..489f23b 100644 --- a/web/index.php +++ b/web/index.php @@ -873,9 +873,8 @@ supported by:
- - + + @@ -1007,10 +1006,9 @@ echo "$body"; ?> - - + + @@ -1067,8 +1065,7 @@ else { ?> sess = ""; hstm = new http_streaming("sess"); - hstm.hbit_set(hbit); - // xhr_rd.setRequestHeader("Content-type", "text/html; charset=utf-8"); + hstm.hbit_set(heartbit); tra = new train($('room_tit')); window.onunload = onunload_cb; window.onbeforeunload = onbeforeunload_cb; -- 2.17.1