Author: hhubner
Date: 2006-03-03 17:31:33 -0500 (Fri, 03 Mar 2006)
New Revision: 1887
Modified:
branches/xml-class-rework/projects/mah-jongg/website/game.js
branches/xml-class-rework/projects/mah-jongg/website/game.xsl
Log:
Small UI enhancements.
Modified: branches/xml-class-rework/projects/mah-jongg/website/game.js
===================================================================
--- branches/xml-class-rework/projects/mah-jongg/website/game.js 2006-03-03 20:56:27 UTC (rev 1886)
+++ branches/xml-class-rework/projects/mah-jongg/website/game.js 2006-03-03 22:31:33 UTC (rev 1887)
@@ -7,24 +7,29 @@
return document.getElementById(name);
}
+var interval;
+
function init_new_round_form()
{
+ interval = setInterval("check_new_round_form()", 300);
$('east').focus();
}
function check_new_round_form()
{
+ var is_valid = true;
+
for (i in winds) {
if ($(winds[i]).value.match(/^\s*$/)) {
- $(winds[i]).focus();
- return false;
+ is_valid = false;
}
}
- return true;
+ $('make_round_button').disabled = is_valid ? undefined : 'disabled';
+
+ return is_valid;
}
-var check_new_game_inputs_interval;
var winner_clicked = false;
function set_winner_clicked()
@@ -35,8 +40,8 @@
function check_new_game_inputs()
{
- if (!check_new_game_inputs_interval) {
- check_new_game_inputs_interval = setInterval("check_new_game_inputs()", 300);
+ if (!interval) {
+ interval = setInterval("check_new_game_inputs()", 300);
}
var is_valid = winner_clicked;
Modified: branches/xml-class-rework/projects/mah-jongg/website/game.xsl
===================================================================
--- branches/xml-class-rework/projects/mah-jongg/website/game.xsl 2006-03-03 20:56:27 UTC (rev 1886)
+++ branches/xml-class-rework/projects/mah-jongg/website/game.xsl 2006-03-03 22:31:33 UTC (rev 1887)
@@ -26,7 +26,7 @@
<img src="east.jpg" width="100" height="140"/>
</td>
<td>
- <input type="text" id="east" name="east"/>
+ <input type="text" id="east" name="east" autocomplete="off"/>
</td>
</tr>
<tr>
@@ -34,7 +34,7 @@
<img src="north.jpg" width="100" height="140"/>
</td>
<td>
- <input type="text" id="north" name="north"/>
+ <input type="text" id="north" name="north" autocomplete="off"/>
</td>
</tr>
<tr>
@@ -42,7 +42,7 @@
<img src="west.jpg" width="100" height="140"/>
</td>
<td>
- <input type="text" id="west" name="west"/>
+ <input type="text" id="west" name="west" autocomplete="off"/>
</td>
</tr>
<tr>
@@ -50,12 +50,12 @@
<img src="south.jpg" width="100" height="140"/>
</td>
<td>
- <input type="text" id="south" name="south"/>
+ <input type="text" id="south" name="south" autocomplete="off"/>
</td>
</tr>
<tr>
<td colspan="2">
- <button type="submit" name="action" value="make-round">Start Round</button>
+ <button type="submit" name="action" id="make_round_button" value="make-round" disabled="disabled">Start Round</button>
</td>
</tr>
</tbody>