X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Ftransports.phh;h=2d9714ef8f386631e28d1dd272a518c4e9a2ddf9;hb=3ebedb90c5d41ce34cf4dd9dba00f12fb78d024a;hp=08ad7a0bbb380c19a96aa44517118793276c6d41;hpb=14136ff3d45c9d1212d6b5e0fd789b57ed73b893;p=brisk.git diff --git a/web/Obj/transports.phh b/web/Obj/transports.phh index 08ad7a0..2d9714e 100644 --- a/web/Obj/transports.phh +++ b/web/Obj/transports.phh @@ -22,6 +22,37 @@ * */ +/* + * test: SO x Browser + * Values: Y: works, N: not works, @: continuous download, + * D: continuous download after first reload + * + * Stream IFRAME: + * + * Iframe| IW | FF | Ch | Op | Ko | IE + * ------+----+----+----+----+----+---- + * Lnx | D | | @ | | @ | x + * Win | x | D | @ | @ | | D + * Mac | x | | | | | + * + * + * XHR | IW | FF | Ch | Op | Ko | IE + * ------+----+----+----+----+----+---- + * Lnx | Y | | ^D | | Y | x + * Win | x | Y | Y | | | N + * Mac | x | | | | | + * + * + * HtmlFl| IW | FF | Ch | Op | Ko | IE + * ------+----+----+----+----+----+---- + * Lnx | N | | | | N | + * Win | x | N | N | | | Y* (* seems delay between click and load of a new page) + * Mac | x | | | | | + * + * + */ + + class Transport_template { function Transport_template() { @@ -31,7 +62,7 @@ class Transport_template { { } - static function fini($init_string, $blockerr) + static function fini($init_string, $base, $blockerr) { } @@ -47,7 +78,7 @@ class Transport_xhr { function init($enc, &$header_out, $init_string, $base, $step) { - $ret = $init_string; + $ret = sprintf("@BEGIN@ /* %s */ @END@", $init_string); if ($enc != 'plain') $header_out['Content-Encoding'] = $enc; $header_out['Cache-Control'] = 'no-cache, must-revalidate'; // HTTP/1.1 @@ -57,8 +88,9 @@ class Transport_xhr { return ($ret); } - static function fini($init_string, $blockerr) + static function fini($init_string, $base, $blockerr) { + return (sprintf('@BEGIN@ %s window.onbeforeunload = null; window.onunload = null; document.location.assign("%sindex.php"); @END@', ($blockerr ? 'xstm.stop(); ' : ''), $base)); return (""); } @@ -92,7 +124,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 () { try { if (xynt_streaming != \"ready\") { xynt_streaming.transp.stopped = true; } } catch(e) { /* console.log(\"catcha\"); */ } }; "); @@ -101,7 +133,7 @@ window.onload = function () { if (xynt_streaming != \"ready\") { xynt_streaming. return ($ret); } - static function fini($init_string, $blockerr) + static function fini($init_string, $base, $blockerr) { $ret = ""; $ret .= sprintf(" @@ -109,9 +141,9 @@ window.onload = function () { if (xynt_streaming != \"ready\") { xynt_streaming. "); @@ -139,4 +171,31 @@ push(\"%s\");\n// -->\n", $step, escpush($cont) ); class Transport_htmlfile extends Transport_iframe { } +class Transport { + function Transport() + { + } + + static function create($transp) + { + if ($transp == 'xhr') { + return new Transport_xhr(); + } + else if ($transp == 'htmlfile') { + return new Transport_htmlfile(); + } + else { + return new Transport_iframe(); + } + } + static function gettype($transp) + { + if ($transp == 'xhr' || $transp == 'htmlfile') { + return "Transport_".$transp; + } + else { + return 'Transport_iframe'; + } + } +} ?> \ No newline at end of file