X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=9d96a7271d48ba538a6e2e45b6430ab24c389a60;hb=c57d11623d49e18566644f731791ae34d6e06967;hp=e09f8269b08c0af0fe0fab2fd783d1ab8f55558f;hpb=9b1e396b87b8237ee618a911b4eccf14ec39b349;p=brisk.git diff --git a/web/commons.js b/web/commons.js index e09f826..9d96a72 100644 --- a/web/commons.js +++ b/web/commons.js @@ -164,22 +164,26 @@ function rnd_int(min, max) { function error_images() { - alert("GHESEMU!"); + // alert("GHESEMU!"); + setTimeout(preload_images, 2000, g_preload_img_arr, g_imgct-1); } function abort_images() { - alert("ABORTAIMAGES"); + // alert("ABORTAIMAGES"); + setTimeout(preload_images, 2000, g_preload_img_arr, g_imgct-1); } function unload_images() { - alert("ABORTAIMAGES"); + // alert("ABORTAIMAGES"); + setTimeout(preload_images, 2000, g_preload_img_arr, g_imgct-1); } function reset_images() { - alert("ABORTAIMAGES"); + // alert("ABORTAIMAGES"); + setTimeout(preload_images, 2000, g_preload_img_arr, g_imgct-1); } function update_images() @@ -240,15 +244,23 @@ function send_mesg(mesg) } } -function server_request(mesg) +function server_request() { var xhr_wr = createXMLHttpRequest(); - + var i, collect = ""; + + if (arguments.length > 0) { + for (i = 0 ; i < arguments.length ; i+= 2) { + collect += (i == 0 ? "" : "&") + arguments[i] + "=" + encodeURIComponent(arguments[i+1]); + } + } + // alert("Args: "+arguments.length); + var is_conn = (sess == "not_connected" ? false : true); // console.log("server_request:preresp: "+xhr_wr.responseText); - xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+'mesg='+mesg, false); + xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+collect, false); xhr_wr.onreadystatechange = function() { return; }; xhr_wr.send(null); @@ -397,6 +409,13 @@ function act_reload() document.location.reload(); } +function act_reloadroom() +{ + window.onunload = null; + window.onbeforeunload = null; + document.location.assign("index.php"); +} + function act_shutdown() { var c = 0; @@ -690,14 +709,23 @@ function notify(st, text, tout, butt, w, h) clodiv.className = "notify_clo"; clodiv.appendChild(clo); - box = document.createElement("div"); + cont = document.createElement("div"); + + cont.style.borderBottomStyle = "solid"; + cont.style.borderBottomWidth = "1px"; + cont.style.borderBottomColor = "gray"; + cont.style.height = (h - 30)+"px"; + cont.style.overflow = "auto"; + cont.innerHTML = text; + + box = document.createElement("div"); box.className = "notify"; - box.innerHTML = text; box.style.zIndex = 200; box.style.width = w+"px"; box.style.marginLeft = -parseInt(w/2)+"px"; box.style.height = h+"px"; box.style.top = parseInt((document.body.clientHeight - h) / 2) + document.body.scrollTop; + box.appendChild(cont); box.appendChild(clodiv); box.style.visibility = "visible"; @@ -1111,3 +1139,5 @@ function topbanner_cb() // console.log("A: "+a+" B: "+b); } + +