JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
save card number in jquery card object (card.view)
authorJason Woofenden <jason@jasonwoof.com>
Wed, 2 Nov 2011 19:38:39 +0000 (15:38 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 2 Nov 2011 19:38:39 +0000 (15:38 -0400)
client.coffee
server.coffee

index 1e2c966..da53a24 100644 (file)
@@ -61,6 +61,7 @@ instantiate_card = (card) ->
                        card.z = next_card_z()
 
        view = $ $ "<div class=\"card #{card_class}\" style=\"left: #{transform_x(card.x)}px; top: #{transform_y(card.y)}px; z-index: #{card.z}\"><span class=\"cardtext\">#{text}</span></div>"
+       view.data card.number
        button_box = $ $ '<div/>'
        flip_button = new_button "flip over"
        mark_button = new_button "mark"
index 3ba1034..4ae7fe7 100644 (file)
@@ -194,6 +194,9 @@ test_init = ->
                        { text: "Stone Wall 0/10", x: 500, y: 420, owner: 'p1', pile: 'p1_draw', flipped: true}
                        { text: "Log 0/1", x: 660, y: 420, owner: 'p1', pile: 'p1_draw', flipped: true}
                        { text: "Ent 0/5", x: 800, y: 420, owner: 'p1', pile: 'p1_draw', flipped: true}
+                       { text: "Barricade 0/10", x: 500, y: 420, owner: 'p1', pile: 'p1_draw', flipped: true}
+                       { text: "O(log(n)) 0/1", x: 660, y: 420, owner: 'p1', pile: 'p1_draw', flipped: true}
+                       { text: "Fence 0/5", x: 800, y: 420, owner: 'p1', pile: 'p1_draw', flipped: true}
                ]
 
 test_init()