Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 38 lines (20 sloc) 1.435 kB
a9c68e5 @iammerrick Added readme.md
authored
1 # Lunch
2
3 Lunch is a playground application for me to experiment with writing robust client code in CoffeeScript.
4
5 # Check This Action!
6
7 ## CoffeeScript, SCSS, Compass & Require.js
8 First thing you will notice is I'm still using AMD for the module layer, some of the most beautiful JavaScript I've seen is this combination of tools. So to work on this application you will need to compile your CoffeeScript files like so:
9
10 `coffee -o public/javascripts/ -w coffeescript/`
11
12 And when you are ready to deploy, use r.js to build all those modules to one file:
13
14 `r.js -o config/build.js`
15
16 To compile those stylesheets:
17
18 `cd config && compass watch`
19
20 ## Require.js
21 I am using the i18n AMD plugin for messaging and internationalization support which I tie into a Handlebars.js helper. See coffeescript/messages/dictionary.coffee and coffeescript/views/view.coffee.
22
23 ## Backbone.js
24
25 You will now notice I am doing something a bit different from the conventional Backbone.js application, the views are simply relegated to returning a string and receiving a context.
26
27 I am changing Backbone.View to Controller in coffeescript/controllers/controller.coffee and adding some helpful methods like `html` & `append`, when you use @html you are able to add shortcuts in a hash like so:
28
29 {
30 'name' : '.name'
31 }
32
33 This allows you to reference the jQuery element of `.name` as @name.
34
35 A lot the stuff I've done here is pulled from the awesome Spine.js.
36
37
Something went wrong with that request. Please try again.