/*
* brisk - xhr.js
*
- * Copyright (C) 2006 matteo.nastasi@milug.org
+ * Copyright (C) 2006-2008 Matteo Nastasi
+ * mailto: nastasi@alternativeoutput.it
+ * matteo.nastasi@milug.org
+ * web: http://www.alternativeoutput.it
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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;
{
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");
+ // if (g_is_spawn == 1)
+ // alert("di qui3: "+(g_is_spawn == 1 ? "&table_idx="+g_table_idx : ""));
xhr_rd.open('GET', 'index_rd.php?sess='+sess+"&stat="+stat+"&subst="+subst+"&step="+step+"&onlyone="+(document.uniqueID ? "TRUE" : "FALSE")+"&myfrom="+myfrom, true);
// try {
xhr_rd.onreadystatechange = function() { xhr_rd_cb(xhr_rd); }
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 */
- $("heartbit").innerHTML += "_";
- if ($("heartbit").innerHTML.length == 20)
- $("heartbit").innerHTML = "_";
+ /* heartbit log */
+ hbit("_");
do {
again = 0;
singlecomm = gst.comms.shift();
// alert("EXE"+gugu);
// $("xhrdeltalog").innerHTML = "EVALL: "+singlecomm.replace("<", "<", "g"); +"<br>";
+ hbit("+");
+
eval(singlecomm);
again = 1;
}
if (the_end != true) {
watchdog = 0;
setTimeout(xhr_rd_poll, tout, sess);
- $("heartbit").innerHTML += "-";
- if ($("heartbit").innerHTML.length == 20)
- $("heartbit").innerHTML = "-";
+
+ // hbit(".");
+
}
return;
}
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;
// $("sandbox").innerHTML += "return 3<br>";
if (the_end != true) {
setTimeout(xhr_rd_poll, tout, sess);
- $("heartbit").innerHTML += "-";
- if ($("heartbit").innerHTML.length == 20)
- $("heartbit").innerHTML = "-";
+
+ // hbit(".");
+
}
return;
};