X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=3207c110723a16d26bcbc6c9ad1836c45034a7a3;hb=29ef3f7db6bc1d39c658a15d95d22e45bbd59c16;hp=342fc99bd659c07084ff3effa3c0bbf2ac87ffa7;hpb=51e3ccc452c854c6a372d51ab5ecab854bdc29c0;p=brisk.git
diff --git a/web/commons.js b/web/commons.js
index 342fc99..3207c11 100644
--- a/web/commons.js
+++ b/web/commons.js
@@ -222,12 +222,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 +307,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 +466,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 +494,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 +507,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 +833,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 +845,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 +869,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 +891,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") );
}
/*