diff options
author | Jeremie Taboada <taboada.jeremie@gmail.com> | 2015-06-05 01:21:00 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-06-08 17:01:47 +0100 |
commit | 4dfc78abbd52b3ee24f7249ab8b98b5e68cc822f (patch) | |
tree | 513e634055488b67b19ac6073a7725eac678e791 | |
parent | d45704ef40f3fe68ab583a85674cea8a07d2e005 (diff) |
Add become judge page.
-rw-r--r-- | cao-mobile.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cao-mobile.js b/cao-mobile.js index f639d1b..3946879 100644 --- a/cao-mobile.js +++ b/cao-mobile.js @@ -1,16 +1,22 @@ $(document).ready(function() { + var $home = $("#home"); + var $become_judge = $("#become-judge"); + var $join_btn = $("#join-btn"); + var $become_judge_btn = $("#become-judge-btn"); + cao.on_socket_open = function() { - var $joinBtn = $("#join-btn"); - $joinBtn.show(); - $joinBtn.on("click", function () { + $join_btn.show(); + $join_btn.on("click", function () { cao.join_game(prompt('Name of the game')); }); }; cao.on_join_game_ok = function() { - $('#btn_join').hide(); - $('#btn_pick_black').show(); - $('#white_cards').show(); + $home.removeClass("current"); + $become_judge.addClass("current"); + $become_judge_btn.on("click", function () { + cao.pick_black_card(); + }); }; cao.on_show_white_card = function(idx, desc) { |