X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-cgt.git;a=blobdiff_plain;f=client.coffee;h=e49c00385efae61bb5620efc33f151b0e69843d5;hp=205d4ccf2fa49286034379a346f31fbccc3b7b25;hb=f2045f8594e9e8f61aa439a9316529dafc680755;hpb=79d3e474a96013531cce2d8e2d6890aee11cfad9 diff --git a/client.coffee b/client.coffee index 205d4cc..e49c003 100644 --- a/client.coffee +++ b/client.coffee @@ -24,14 +24,27 @@ unless Array::shuffle? @[top] = tmp return +new_button = (text) -> $ $ "
#{text}
" + add_card = (text, x, y) -> - card = $ $ "
#{text}
 
" + card = $ $ "
#{text}
" + button_box = $ $ '
' + flip_button = new_button "flip over" + mark_button = new_button "mark" + flip_button.bind 'click', -> + card.toggleClass 'flipped' + # FIXME tell server + mark_button.bind 'click', -> + card.toggleClass 'marked' + # FIXME tell server + button_box.append flip_button + button_box.append mark_button + card.append button_box $table.append card card.draggable stack: '.card' card.bind 'dragstop', (event, ui) -> p = card.position() - card.children().html("(#{p.left}, #{p.top})") - # FIXME tell server + #card.children().html("(#{p.left}, #{p.top})") init = -> if state.auto_shuffle