--- /dev/null
+- resize the ctx_new var
+
+ABRT - stop js into iframe when the page is stopped
+
+DONE - fix "full path problem"
+
+DONE - clean the DOM at each reload
+
+DONE - iframe + index_rd that: push forever commands AND watchdog system
+
+DONE - use watchdog to prevent hang of the stream (reload and full reset of objects)
+
+DONE - executed commands
+
createCookie('sess', sess, 24*365,cookiepath);
gst = new globst();
hs = new http_streaming(window, gst, sess, console);
- // FIXME: with relative path not work!
- hs.start('http://dodo.birds.lan/xynt/test-hs-rd.php');
- // hs.start('test-hs-rd.php');
+ hs.start('test-hs-rd.php');
};
<?php
}
}
return (ret);
+}
+
+function url_complete(parent, url)
+{
+ var p, p2, rest;
+ var host = "", path = "";
+
+ // host extraction
+ p = parent.indexOf("://");
+ if (p > -1) {
+ rest = parent.substring(p+3);
+ p2 = rest.indexOf("/");
+ if (p2 > -1) {
+ host = parent.substring(0, p+3+p2);
+ rest = parent.substring(p+3+p2);
+ }
+ else {
+ host = rest;
+ rest = "";
+ }
+ }
+ else {
+ rest = parent;
+ }
+
+ // path extraction
+ p = rest.lastIndexOf("/");
+ if (p > -1) {
+ path = rest.substring(0, p+1);
+ }
+
+ // alert("host: ["+host+"] path: ["+path+"]");
+ if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/') {
+ return (url);
+ }
+ else if (url.substring(0,1) == '/') {
+ return (host+url);
+ }
+ else {
+ return (host+path+url);
+ }
}
\ No newline at end of file
this.ifra.style.visibility = "hidden";
this.doc.body.appendChild(this.ifra);
if (page != null)
- this.page = page;
+ this.page = url_complete(this.win.location.href, page);
this.page = url_append_args(this.page, "sess", this.sess, "st", gst.st);
- this.log(this.page);
+ // this.log("http_streaming::start:this.page "+this.page);
this.ifra.contentWindow.location.href = this.page;
this.watchdog_ct = 0;
this.watchdog_hdl = setTimeout(function(obj) { obj.log("tout1"); obj.watchdog(); }, this.watchdog_timeout, this);