From 4dfc78abbd52b3ee24f7249ab8b98b5e68cc822f Mon Sep 17 00:00:00 2001 From: Jeremie Taboada Date: Fri, 5 Jun 2015 01:21:00 +0100 Subject: Add become judge page. --- cao-mobile.js | 18 ++++++++++++------ 1 file 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) { -- cgit v1.2.3