X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=e305e990d76639a0804919611a9d25b6b28eb5bb;hb=a3a94bbfaa5b0484a6d32bb04bde148f5f95347b;hp=342fc99bd659c07084ff3effa3c0bbf2ac87ffa7;hpb=51e3ccc452c854c6a372d51ab5ecab854bdc29c0;p=brisk.git diff --git a/web/commons.js b/web/commons.js index 342fc99..e305e99 100644 --- a/web/commons.js +++ b/web/commons.js @@ -140,10 +140,14 @@ function removeEvent(obj,type,fn) function show_bigpict(obj, act, x, y) { - var big; + var big, sfx; - // alert("offsetTop: "+obj.offsetTop+" offsetLeft: "+obj.offsetLeft+"obj.id: "+obj.id); - big = $(obj.id+"_big"); + if (arguments.length > 4) + sfx = arguments[4]; + else + sfx = ''; + + big = $(obj.id+"_big"+sfx); if (act == "over") { big.style.left = obj.offsetLeft + x+"px"; big.style.top = obj.offsetTop + y+"px"; @@ -222,12 +226,17 @@ function createXMLHttpRequest() { function send_mesg(mesg) { var xhr_wr = createXMLHttpRequest(); - + var is_conn = (sess == "not_connected" ? false : true); - xhr_wr.open('GET', 'index_wr.php?sess='+sess+'&mesg='+mesg, true); + xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+'mesg='+mesg, (is_conn ? true : false)); xhr_wr.onreadystatechange = function() { return; }; xhr_wr.send(null); + if (!is_conn) { + if (xhr_wr.responseText != null) { + eval(xhr_wr.responseText); + } + } } /* Stat: CHAT and TABLE */ @@ -302,11 +311,27 @@ function act_help() send_mesg("help"); } +function act_tav() +{ + act_chatt('/tav '+$('txt_in').value); + $('txt_in').value = ''; +} + function act_about() { send_mesg("about"); } +function act_roadmap() +{ + send_mesg("roadmap"); +} + +function act_whysupport() +{ + send_mesg("whysupport"); +} + function act_exitlock() { send_mesg("exitlock"); @@ -445,7 +470,9 @@ slowimg.prototype = { if (this.step_n * this.deltat == this.time) { this.step_n--; } - this.step_free = parseInt(this.step_n * this.free); + if (this.free < 1) { + this.step_free = parseInt(this.step_n * this.free); + } }, start: function(st) @@ -471,7 +498,7 @@ slowimg.prototype = { this.step_cur++; setTimeout(function(obj){ obj.animate(); }, this.deltat, this); if (this.step_cur == this.step_free && this.st != null) { - if (this.st != null && this.st.st_loc < this.st.st_loc_new) { + if (this.st.st_loc < this.st.st_loc_new) { // alert("QUI1 " + this.step_cur + " ZZ "+ this.step_free); this.st.st_loc++; this.st = null; @@ -484,14 +511,16 @@ slowimg.prototype = { // $("logz").innerHTML += "xxxxxxxxxxxxxxxCLEAR
"; var date = new Date(); // $("logz").innerHTML += "Timestop: " + date + "
"; + + if (this.action != null) { + eval(this.action); + } + if (this.st != null && this.st.st_loc < this.st.st_loc_new) { // alert("QUI2"); this.st.st_loc++; this.st = null; } - if (this.action != null) { - eval(this.action); - } if (this.srcend != null) { this.img.src = this.srcend; } @@ -808,6 +837,8 @@ var fin = 0; function table_init() { var sux = new Array("", "_ea", "_ne", "_nw", "_we"); + // console.log("table_init"); + remark_off(); $("asta").style.visibility = "hidden"; $("caller").style.visibility = "hidden"; @@ -818,6 +849,7 @@ function table_init() { $("card"+sux[e]+i).style.visibility = "hidden"; } for (i=0 ; i < PLAYERS_N ; i++) { + // console.log("shut: "+"takes"+sux[i]); $("takes"+sux[i]).style.visibility = "hidden"; } @@ -841,6 +873,13 @@ var CHATT_MAXLINES = 40; /* PRO CHATT */ function chatt_sub(name,str) { + var must_scroll = false; + + // alert ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight); + + if ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight >= 0) + must_scroll = true; + // alert("ARRIVA NAME: "+ name + " STR:"+str); if (chatt_lines_n == CHATT_MAXLINES) { $("txt").innerHTML = ""; @@ -856,8 +895,13 @@ function chatt_sub(name,str) $("txt").innerHTML += chatt_lines[chatt_lines_n]; chatt_lines_n++; } - $("txt").innerHTML; - $("txt").scrollTop = 10000000; + // $("txt").innerHTML; + + + if (must_scroll) { + $("txt").scrollTop = 10000000; + } + // alert("scTOP "+$("txt").scrollTop+" scHEIGHT: "+$("txt").scrollHeight+" HEIGHT: "+getStyle($("txt"),"height", "height") ); } /*