X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=9f70f65e4a748997ca56499ed1f782c4eef04513;hb=0e17eb7ed18d621be70d7890f531a2dc1cab2a42;hp=711b086cc91ce1c4824346d8d82b2d8f54104699;hpb=34ccc0593731592021bee6ab1661f8eb5ab5b1a4;p=brisk.git diff --git a/web/commons.js b/web/commons.js index 711b086..9f70f65 100644 --- a/web/commons.js +++ b/web/commons.js @@ -1,7 +1,7 @@ /* * brisk - commons.js * - * Copyright (C) 2006-2011 Matteo Nastasi + * Copyright (C) 2006-2012 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -249,12 +249,12 @@ function send_mesg(mesg) // alert("xhr_wr: "+xhr_wr+" is_conn: "+is_conn); xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+'mesg='+mesg, (is_conn ? true : false)); + xhr_wr.setRequestHeader("If-Modified-Since", new Date().toUTCString()); xhr_wr.onreadystatechange = function() { return; }; - if (typeof(console) == 'object') { - if (typeof(console.log) == 'function') { + if (typeof(g_debug) == 'number' && g_debug > 0 + && typeof(console) == 'object' && typeof(console.log) == 'function') { var ldate = new Date(); console.log(ldate.getTime()+':MESG:'+mesg); - } } xhr_wr.send(null); @@ -330,6 +330,11 @@ function act_chatt(value) } /* Stat: ROOM */ +function act_ping() +{ + send_mesg("ping"); +} + function act_sitdown(table) { send_mesg("sitdown|"+table);