From 7bfb5135d1ead5cf0d0fc93bf17e691adaae3afe Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Fri, 21 Aug 2009 07:20:09 +0000 Subject: [PATCH] preferences and sound when auction finish added --- web/briskin5/briskin5.js | 52 ++++++++++++++++++++++++++++++++++++++++ web/briskin5/index.php | 32 ++++++++++++++++++++++--- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/web/briskin5/briskin5.js b/web/briskin5/briskin5.js index 88c7a88..c49f913 100644 --- a/web/briskin5/briskin5.js +++ b/web/briskin5/briskin5.js @@ -283,3 +283,55 @@ function set_names(so,ea,ne,nw,we) return; } +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+"/briskin5"); + 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'; +} diff --git a/web/briskin5/index.php b/web/briskin5/index.php index 862eed0..919e09e 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -31,7 +31,13 @@ require_once("../Obj/proxyscan.phh"); require_once("Obj/briskin5.phh"); $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.
Scegli il seme:', - 'en' => 'You win the auction.
Choose the seed:' ) + 'en' => 'You win the auction.
Choose the seed:' ), + 'tit_pref'=>array( 'it' => 'Preferenze.', + 'en' => 'Preferences.'), + 'itm_ringauc' => array('it' => 'riproduci un suono di notifica alla fine dell\' asta', + 'en' => 'play a sound at the end of the auction'), + 'btn_update' => array('it' => 'Aggiorna.', + 'en' => 'Update.' ) ); @@ -89,7 +95,10 @@ var g_exitlock = 0; window.onload = function() { g_withflash = DetectFlashVer(6,0,0); remark_off(); - // table_init(); + + preferences_init(); + preferences_update(); + xhr_rd = createXMLHttpRequest(); sess = ""; @@ -227,9 +236,10 @@ window.onload = function() { + + - @@ -268,5 +278,21 @@ window.onload = function() {
+ + + + -- 2.17.1