X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2Fbriskin5.js;h=91fe98f27d89ed56c80b86dfac3aa1544a9ddd5f;hb=a83aff42b8b01a66aba1bfa42e9d7722fc8e1455;hp=88c7a88ef37cf69f7c03035aaa3949649ded4265;hpb=9fe7c6c2413b91e1b738603d4fbc039e59d895db;p=brisk.git diff --git a/web/briskin5/briskin5.js b/web/briskin5/briskin5.js index 88c7a88..91fe98f 100644 --- a/web/briskin5/briskin5.js +++ b/web/briskin5/briskin5.js @@ -1,7 +1,7 @@ /* * brisk - briskin5.js * - * Copyright (C) 2006-2008 Matteo Nastasi + * Copyright (C) 2006-2012 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -19,10 +19,11 @@ * not, write to the Free Software Foundation, Inc, 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * - * $Id$ - * */ +var mlang_briskin5 = { 'is_calling' : { 'it' : ' sta chiamando', + 'en' : ' is calling' } } + function background_set() { $("bg").style.backgroundImage = 'url("img/brisk_table_sand'+table_pos+'.jpg")'; @@ -114,7 +115,7 @@ function dispose_asta(idx, pnt, nopoint) btn.style.left = asta_xarr[i % 3]; btn.style.top = parseInt(i / 3) * 50 + 24; btn.src = "img/astalascio"+lng+".png"; - btn.style.visibility = "visible"; + btn.style.visibility = ""; btn.onclick = function () { safelascio(); }; } else { @@ -207,7 +208,9 @@ function table_init() { $("asta").style.visibility = "hidden"; $("caller").style.visibility = "hidden"; show_astat(-2,-2,-2,-2,-2); - for (i=0 ; i < 8 ; i++) { + set_iscalling(-1); + + for (i=0 ; i < CARD_HAND ; i++) { Drag.init($("card" + i), card_mouseup_cb); for (e = 0 ; e < PLAYERS_N ; e++) $("card"+sux[e]+i).style.visibility = "hidden"; @@ -217,7 +220,7 @@ function table_init() { $("takes"+sux[i]).style.visibility = "hidden"; } - for (i = 0 ; i < 8 ; i++) { + for (i=0 ; i < CARD_HAND ; i++) { cards_pos[i] = i; cards_ea_pos[i] = i; cards_ne_pos[i] = i; @@ -263,23 +266,95 @@ function act_reload() { window.onunload = null; window.onbeforeunload = null; - document.location.reload(); + // alert(document.location.toString()); + document.location.assign("index.php"); + // document.location.reload(); } function set_names(so,ea,ne,nw,we) { -// alert("EA: "+ea); - $("name").innerHTML = italizer(so); - $("name").title = unescapeHTML(so[1]); - $("name_ea").innerHTML = italizer(ea); + // alert("SET NAME"); + $("name").innerHTML = user_decorator(so, false); + $("name").title = unescapeHTML(so[1]); + $("name_ea").innerHTML = user_decorator(ea, false); $("name_ea").title = unescapeHTML(ea[1]); - $("name_ne").innerHTML = italizer(ne); + $("name_ne").innerHTML = user_decorator(ne, false); $("name_ne").title = unescapeHTML(ne[1]); - $("name_nw").innerHTML = italizer(nw); + $("name_nw").innerHTML = user_decorator(nw, false); $("name_nw").title = unescapeHTML(nw[1]); - $("name_we").innerHTML = italizer(we); + $("name_we").innerHTML = user_decorator(we, false); $("name_we").title = unescapeHTML(we[1]); + for (i = 0 ; i < PLAYERS_N ; i++) + $("name"+astat_suffix[i]).title_orig = $("name"+astat_suffix[i]).title; + return; } +function set_iscalling(idx) +{ + var i; + + for (i = 0 ; i < PLAYERS_N ; i++) { + $("name"+astat_suffix[i]).className = "pubinfo"+astat_suffix[i]+(i == idx ? "_iscalling" : ""); + $("name"+astat_suffix[i]).title = $("name"+astat_suffix[i]).title_orig + (i == idx ? mlang_briskin5['is_calling'][g_lang] : ""); + } +} + +function preferences_init() +{ + var rd; + + if ((rd = readCookie("CO_bin5_pref_ring_endauct")) != null) { + $('pref_ring_endauct').checked = (rd == "true" ? true : false); + } + else { + $('pref_ring_endauct').checked = false; + } + $('preferences').ring_endauct = $('pref_ring_endauct').checked; +} + +function preferences_update() +{ + var ret; + createCookie("CO_bin5_pref_ring_endauct", ($('preferences').ring_endauct ? "true" : "false"), 24*3650, cookiepath); + ret = server_request('mesg', 'preferences_update'); +} + +function act_preferences_update() +{ + preferences_update() + preferences_showhide(); +} + +function pref_ring_endauct_set(obj) +{ + $('preferences').ring_endauct = obj.checked; +} + + +function preferences_show() +{ + var no; + + div_show($('preferences')); +} + +function preferences_showhide() +{ + if ($('preferences').style.visibility == 'hidden') { + preferences_init(); + + $('preferences').style.top = parseInt((document.body.clientHeight - + parseInt(getStyle($('preferences'), "height","height")) + ) / 2) + document.body.scrollTop; + $('preferences').style.visibility = 'visible'; + } + else + $('preferences').style.visibility = 'hidden'; +} + +function act_select_rules(rule_id) +{ + send_mesg("chatt|/rules " + rule_id); +}