install -g coffee-script 3. npm install -g coffee-toaster 4. git clone [email protected]:gameboxed/todomvc.git 5. git checkout -b minimal remotes/origin/minimal 6. cd todomvc; toaster -dw 7. open index.html and see if it works AGENDA 1. Presentation 2. Introducing the TodoMVC project 3. Look at the minimal implementation 4. Implementing “delete a task” feature - you follow me 5. Exercise: Implementing “complete/uncomplete a task” 6. Exercise: Implementing “complete all tasks” 7. Exercise: Implementing “Edit a task” 8. Summary Saturday, August 18, 12
as a toy language. Frontend programming was just a little addition. The “Real Work” was done on backend. It has changed. Mainly thanks to Single-Page- Applications. Nowadays JavaScript and CoffeeScript are one of the most important languages. Frontend programming is as important as backend. Recently I’ve dived into frontend and I don’t regret it at all. CoffeeScript and Gameboxed Engine are the most brilliant things since Rails.” Michał Łomnicki, Ruby programmer the maintainer of schema_plus, automatic_foreign_key, exceptioner gems Saturday, August 18, 12
if not card console.debug "no card picked" callback?() return console.debug "card found: #{card.identifier}" card.onPicked(@) if card.onPicked? @eventBroker.trigger("player:picked_card:#{card.identifier}", card, callback) @eventBroker.trigger("player:picked_card", card) Saturday, August 18, 12
new engine.invite_and_win.FacebookHQ() tryToEnterGameArea: () => if @amIEnteringGameFirstTime() if @amICommingFromInvitation() @tellPlayerHeIsPartOfTeam(@facebookHQ.friendsInviting) @teachPlayerHowToPlay() else #n-th time... if @amICommingFromInvitation() @tellPlayerHeIsPartOfTeam(@facebookHQ.friendsInviting) if not @playerLikesFanpage() @askPlayerToLikeFanpage() if @haveNotYetPickedFavPizzaCountry() @askPlayerToDeclareHisFavCountry() Saturday, August 18, 12
=> if @amIEnteringGameFirstTime() if @amICommingFromInvitation() @tellPlayerHeIsPartOfTeam(@facebookHQ.friendsInviting) @teachPlayerHowToPlay() else #n-th time... if @amICommingFromInvitation() @tellPlayerHeIsPartOfTeam(@facebookHQ.friendsInviting) if not @playerLikesFanpage() @askPlayerToLikeFanpage() if @haveNotYetPickedFavPizzaCountry() @askPlayerToDeclareHisFavCountry() a role Saturday, August 18, 12