Skip to content

Commit

Permalink
Integrate node-pile. This closes issue mauricemach#79.
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Oct 2, 2011
1 parent 2eef4f5 commit 7969d36
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 83 deletions.
31 changes: 31 additions & 0 deletions examples/assets.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require('./zappa') ->

@enable 'serve jquery'

@get "/": ->
@render 'index'

@client ->
console.log "Hello, I will run on every page"

@client namespaced: ->
console.log "I will run only where namespace 'namespaced' is"


@view index: ->
div ->
h1 -> "Hello, node-pile in Zappa!"

@css '''
h1 {
color: blue;
}
'''

@view layout: ->
doctype 5
html ->
head ->
title "Hello Assets"
@renderStyleTags() + @renderScriptTags("namespaced")
body @body
16 changes: 8 additions & 8 deletions examples/views.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ require('./zappa') ->
@get
'/': ->
@render 'index', foo: 'bar'

'/eco': ->
@render 'index.eco', foo: 'bar'

'/jade': ->
@render 'index.jade', foo: 'bar'

@view index: ->
h2 'CoffeeKup inline template'
p @foo

@view layout: ->
doctype 5
html ->
Expand All @@ -21,12 +21,12 @@ require('./zappa') ->
body ->
h1 'CoffeeKup inline layout'
@body

@view 'index.eco': '''
<h2>Eco inline template</h2>
<p><%= @foo %></p>
'''

@view 'layout.eco': '''
<!DOCTYPE html>
<html>
Expand All @@ -38,12 +38,12 @@ require('./zappa') ->
</body>
</html>
'''

@view 'index.jade': '''
h2 Jade inline template
p= foo
'''

@view 'layout.jade': '''
!!! 5
html
Expand All @@ -52,4 +52,4 @@ require('./zappa') ->
body
h1 Jade inline layout
!= body
'''
'''
4 changes: 3 additions & 1 deletion examples/views/layout.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ doctype 5
html ->
head ->
title 'CoffeeKup file layout'
@renderStyleTags()
@renderScriptTags()
body ->
h1 'CoffeeKup file layout'
@body
@body
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"socket.io": "0.8.4",
"coffeekup": "0.3.1",
"node-uuid": "1.2.0",
"uglify-js": "1.1.0"
"pile": "0.2.1"
},
"devDependencies": {
"jsdom": "0.2.5",
Expand Down Expand Up @@ -41,4 +41,4 @@
"Kris Molendyke <[email protected]>",
"Rafael de Oleza Alomar <[email protected]>"
]
}
}
2 changes: 1 addition & 1 deletion src/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ skeleton = ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};")
.replace('settings = null;', "var settings = #{JSON.stringify settings};")
Loading

0 comments on commit 7969d36

Please sign in to comment.