diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-06-04 18:40:21 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-06-04 18:40:21 +0100 |
commit | cb481680e233ca7ffa8761ed3efff475dbd85bc6 (patch) | |
tree | b4d419ce70267cd137c49b04dba600784004ae32 /cao-desktop.js | |
parent | 90af15a4f670d6e2fa7e7bc73210f4c0ac4ee3ba (diff) |
moved the content of the desktop version into the proper file
moved from cao-common.js to cao-desktop.js
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'cao-desktop.js')
-rw-r--r-- | cao-desktop.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cao-desktop.js b/cao-desktop.js new file mode 100644 index 0000000..29fc91c --- /dev/null +++ b/cao-desktop.js @@ -0,0 +1,39 @@ +$(document).ready(function() { + cao.on_socket_open = function() { + $('#btn_join').show(); + }; + + cao.on_join_game_ok = function() { + $('#btn_join').hide(); + $('#btn_pick_black').show(); + }; + + cao.on_show_white_card = function(idx, desc) { + /* to change */ + element = $('.card_desc').eq(idx); + element.html(desc); + element.dblclick(this.gen_callback_white_card(i)); + }; + + cao.on_pick_black_card_ok = function() { + $('#btn_collect').show(); + $('#btn_pick_black').hide(); + }; + + cao.on_show_black_card = function(desc) { + $('#black_card').show(); + $('#black_card').html(desc); + }; + + cao.on_played_white_card_ok = function(idx) { + element = $('.card_desc').eq(idx); + element.empty(); + element.dblclick(null); + }; + + cao.on_collect_cards_ok = function() { + $('#btn_collect').hide(); + }; + + cao.run(); +}); |