preferences and sound when auction finish added
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Fri, 21 Aug 2009 07:20:09 +0000 (07:20 +0000)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Fri, 21 Aug 2009 07:20:09 +0000 (07:20 +0000)
web/briskin5/briskin5.js
web/briskin5/index.php

index 88c7a88..c49f913 100644 (file)
@@ -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';
+}
index 862eed0..919e09e 100644 (file)
@@ -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.<br> Scegli il seme:',
-                                              'en' => 'You win the auction.<br> Choose the seed:' )
+                                              'en' => 'You win the auction.<br> 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 = "<?php echo "$sess"; ?>";
   
@@ -227,9 +236,10 @@ window.onload = function() {
 <tr>
 <td style="text-align: center;"><input type="button" class="button" name="xinfo"  value="Info." onclick="act_tableinfo();"></td>
 <td style="text-align: center;"><input type="button" class="button" name="xreload"  value="Reload." onclick="act_reload();"></td>
+<td style="text-align: center;"><input type="button" class="button" name="xout"  value="Out." onclick="safelogout();"></td>
 </tr><tr>
+<td style="text-align: center;" colspan="2"><input type="button" class="button" name="xpref"  value="<?php echo $mlang_bin5_index['tit_pref'][$G_lang]; ?>" onclick="preferences_showhide();"></td>
 <td style="text-align: center;"><img id="exitlock" class="button" style="visibility: hidden; border: 0px; display: inline; position: relative;" onclick="act_exitlock();"></td>
-<td style="text-align: center;"><input type="button" class="button" name="xout"  value="Out." onclick="safelogout();"></td>
 </tr>
 </table>
 </div>
@@ -268,5 +278,21 @@ window.onload = function() {
 </pre>
 <div id="xhrdeltalog" style="text-align: left;"></div>
 </div>
+
+<div id="preferences" class="notify" style="z-index: 200; width: 400px; margin-left: -200px; height: 200px; top: 126px; visibility: hidden;">
+<div id="preferences_child" style="border-bottom: 1px solid gray; overflow: auto; height: 170px;">
+
+<h2><?php echo $mlang_bin5_index['tit_pref'][$G_lang]; ?></h2>
+<div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
+<br><br>
+<input type="checkbox" name="pref_ring_endauct" id="pref_ring_endauct" onclick="pref_ring_endauct_set(this);"><?php echo $mlang_bin5_index['itm_ringauc'][$G_lang] ?>
+</div>
+
+
+</div>
+<div class="notify_clo"><input type="submit" class="input_sub" style="bottom: 4px;" onclick="act_preferences_update();" value="<?php echo $mlang_bin5_index['btn_update'][$G_lang]; ?>"/></div>
+</div>
+
+
 </body>
 </html>