X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fxhr.js;h=3cbfe6782227c95ef6ce6e9a457584e5dbc5cdc9;hb=ae4baf0b0142cc538df4370430f4971440b33ee6;hp=0265e24f7c6bf860b33a8e3f6321bb662b555166;hpb=f406d58f75cd486eaab74be94faf70d516684e5a;p=brisk.git diff --git a/web/xhr.js b/web/xhr.js index 0265e24..3cbfe67 100644 --- a/web/xhr.js +++ b/web/xhr.js @@ -24,7 +24,7 @@ var xhr_rd_cookiepath = "/brisk/"; var xhr_rd = false; var xhr_rd_stopped = true; var xhr_rd_oldctx = ""; -var xhr_rd_newctx; +var xhr_rd_newctx = ""; var xhr_rd_cur_n = -1; var xhr_rd_old_n = -1; @@ -33,6 +33,14 @@ var the_end = false; var ct = 0; var watchdog = 0; +function hbit(symb) +{ + if ($("heartbit").innerHTML.length >= 40) + $("heartbit").innerHTML = symb; + else + $("heartbit").innerHTML += symb; +} + function xhr_rd_cb(xhr_rd) { var ret; @@ -53,7 +61,11 @@ function xhr_rd_start(sess,stat,subst,step) { if (the_end) return; - createCookie("sess",sess,1,xhr_rd_cookiepath); + createCookie("sess", sess, 24*365, xhr_rd_cookiepath); + + // NOTE: *ctx = "" to prevent konqueror stream commands duplication. + xhr_rd_oldctx = ""; + xhr_rd_newctx = ""; /* NOTE document.uniqueID exists only under IE */ // alert("di qui3"); @@ -81,17 +93,13 @@ function xhr_rd_poll(sess) xhr_rd.abort(); } */ - var zug = "XHR_RD_POLL sess = "+sess+" stat = "+stat+" subst = "+subst+" step = "+gst.st+" step_loc = "+gst.st_loc+" step_loc_new = "+gst.st_loc_new+" STOP: "+xhr_rd_stopped; if (zug != $("sandbox").innerHTML) $("sandbox").innerHTML = zug; - - /* heartbeat log */ - $("sandbox2").innerHTML += "_"; - if ($("sandbox2").innerHTML.length == 20) - $("sandbox2").innerHTML = "_"; + /* heartbit log */ + hbit("_"); do { again = 0; @@ -106,13 +114,18 @@ function xhr_rd_poll(sess) singlecomm = gst.comms.shift(); // alert("EXE"+gugu); // $("xhrdeltalog").innerHTML = "EVALL: "+singlecomm.replace("<", "<", "g"); +"
"; + hbit("+"); + eval(singlecomm); again = 1; } else { xhrrestart = 1; try { - xhr_rd_newctx = xhr_rd.responseText; + if (xhr_rd == null) + throw "restart"; + if (xhr_rd.responseText != null) + xhr_rd_newctx = xhr_rd.responseText; } catch (e) { if (xhr_rd_stopped == true) { @@ -126,9 +139,9 @@ function xhr_rd_poll(sess) if (the_end != true) { watchdog = 0; setTimeout(xhr_rd_poll, tout, sess); - $("sandbox2").innerHTML += "-"; - if ($("sandbox2").innerHTML.length == 20) - $("sandbox2").innerHTML = "-"; + + // hbit("."); + } return; } @@ -152,6 +165,8 @@ function xhr_rd_poll(sess) var delta = 0; var match_lines = /^_*$/; + hbit("/\\"); + // check for the same command group if (xhr_rd_old_n != xhr_rd_cur_n) { xhr_rd_old_n = xhr_rd_cur_n; @@ -215,9 +230,9 @@ function xhr_rd_poll(sess) // $("sandbox").innerHTML += "return 3
"; if (the_end != true) { setTimeout(xhr_rd_poll, tout, sess); - $("sandbox2").innerHTML += "-"; - if ($("sandbox2").innerHTML.length == 20) - $("sandbox2").innerHTML = "-"; + + // hbit("."); + } return; };