From: Matteo Nastasi (mop) Date: Wed, 5 Dec 2012 17:48:34 +0000 (+0100) Subject: move restart of iframe/htmlfile based stream from iframe onload callback to postproc... X-Git-Tag: v4.4.0~1 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=f705d38215e4db73d23542d66b3c057424d28aab;p=brisk.git move restart of iframe/htmlfile based stream from iframe onload callback to postproc method (fired by xynt_streaming watchdog method --- diff --git a/web/Obj/transports.phh b/web/Obj/transports.phh index fcf1631..3de2197 100644 --- a/web/Obj/transports.phh +++ b/web/Obj/transports.phh @@ -92,7 +92,7 @@ var xynt_streaming = \"ready\";", $base, $base); if ($step > 0) $ret .= sprintf("last_clean = %d;\n", ($step-1)); $ret .= sprintf(" -window.onload = function () { if (xynt_streaming != \"ready\") { xynt_streaming.reload(); } }; +window.onload = function () { if (xynt_streaming != \"ready\") { xynt_streaming.transp.stopped = true; } }; "); diff --git a/web/xynt-streaming.js b/web/xynt-streaming.js index b75dec7..4ebeb1a 100644 --- a/web/xynt-streaming.js +++ b/web/xynt-streaming.js @@ -146,11 +146,13 @@ function transport_htmlfile(doc, xynt_streaming, page) this.ifra = this.transfdoc.getElementById("iframe"); this.ifra.contentWindow.location.href = page; + this.stopped = false; } transport_htmlfile.prototype = { doc: null, xynt_streaming: null, + stopped: true, ifra: null, tradoc: null, @@ -220,7 +222,10 @@ transport_htmlfile.prototype = { this.ifra.contentWindow.script_clean = step; }, - postproc: function () { + postproc: function () { /* public */ + if (this.stopped && !this.xstr_is_ready()) { + this.xynt_streaming.reload(); + } } } @@ -237,19 +242,24 @@ function transport_iframe(doc, xynt_streaming, page) this.ifra.style.visibility = "hidden"; doc.body.appendChild(this.ifra); this.ifra.contentWindow.location.href = page; + this.stopped = false; } transport_iframe.prototype = { doc: null, xynt_streaming: null, + stopped: true, ifra: null, destroy: function () { /* public */ try { if (this.ifra != null) { - // FIXME: on Opera on Windows this remove child crash js so is commented - // on IE on Windows without it stream abort fails - // so we need to decide how can run it + // NOTE: on Opera this remove child crash js if called from + // inside of the iframe, on IE on Windows without + // it stream abort fails. + // the problem is fixed setting into the iframe's onload + // function the stopped attribute to true and delegate + // postproc() fired by xynt_streaming watchdog() this.doc.body.removeChild(this.ifra); delete this.ifra; this.ifra = null; @@ -323,7 +333,10 @@ transport_iframe.prototype = { this.ifra.contentWindow.script_clean = step; }, - postproc: function () { + postproc: function () { /* public */ + if (this.stopped && !this.xstr_is_ready()) { + this.xynt_streaming.reload(); + } } }