From: Matteo Nastasi (mop) Date: Sat, 17 Dec 2011 17:32:15 +0000 (+0100) Subject: http_streaming: sandbox obj not mandatory and passed to the constructor X-Git-Tag: pre-sac~2 X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=82602601a4300006e470e92cb44f18844a656a44 http_streaming: sandbox obj not mandatory and passed to the constructor --- diff --git a/web/briskin5/index.php b/web/briskin5/index.php index 369e6b9..7ee4a33 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -101,7 +101,7 @@ window.onload = function() { preferences_update(); sess = ""; - hstm = new http_streaming("sess"); + hstm = new http_streaming("sess", $('sandbox')); hstm.hbit_set(heartbit); window.onbeforeunload = onbeforeunload_cb; diff --git a/web/http_streaming.js b/web/http_streaming.js index a813814..d396324 100644 --- a/web/http_streaming.js +++ b/web/http_streaming.js @@ -25,7 +25,6 @@ * * NOT MANDATORY * - gst management - * - sandbox management * - myfrom into the constructor * - target page into the constructor * - type of streaming into the constructor @@ -34,10 +33,11 @@ * * DONE - xhr_rd prefix remove from inner class attrs * DONE - move hbit implementation to external file + * DONE - sandbox management * */ -function http_streaming(cookiename) +function http_streaming(cookiename, sandbox) { this.xhr = createXMLHttpRequest(); // this.xhr.setRequestHeader("Content-type", "text/html; charset=utf-8"); @@ -46,6 +46,8 @@ function http_streaming(cookiename) http_streaming.prototype = { cookiename: null, + sandbox: null, + cookiepath: "/brisk/", xhr: null, watchdog: null, @@ -167,11 +169,12 @@ http_streaming.prototype = { this.xhr.abort(); } */ - var zug = "POLL sess = "+sess+" stat = "+stat+" subst = "+subst+" step = "+gst.st+" step_loc = "+gst.st_loc+" step_loc_new = "+gst.st_loc_new+" STOP: "+this.stopped; - - if (zug != $("sandbox").innerHTML) - $("sandbox").innerHTML = zug; - + if (this.sandbox != null) { + var zug = "POLL sess = "+sess+" stat = "+stat+" subst = "+subst+" step = "+gst.st+" step_loc = "+gst.st_loc+" step_loc_new = "+gst.st_loc_new+" STOP: "+this.stopped; + + if (zug != this.sandbox.innerHTML) + this.sandbox.innerHTML = zug; + } /* heartbit log */ this.hbit("_"); do { diff --git a/web/index.php b/web/index.php index 489f23b..42fa7ac 100644 --- a/web/index.php +++ b/web/index.php @@ -1064,7 +1064,7 @@ else { ?> sess = ""; - hstm = new http_streaming("sess"); + hstm = new http_streaming("sess", $('sandbox')); hstm.hbit_set(heartbit); tra = new train($('room_tit')); window.onunload = onunload_cb;