Skip to content

Commit

Permalink
Added jquery etc
Browse files Browse the repository at this point in the history
  • Loading branch information
uberscientist committed Oct 20, 2012
1 parent 168843d commit bbdef9f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
10 changes: 9 additions & 1 deletion client/js/cannon.coffee
@@ -1 +1,9 @@
->
channel = postal.channel { channel: 'chat', topic:'message' }

subscription = channel.subscribe (data, envelope) ->
console.log data
$('#display').append data

$('#send').click ->
console.log 'click'
channel.publish {test: 'Hello!'}
22 changes: 19 additions & 3 deletions public/index.html
@@ -1,3 +1,19 @@
<p>Hello World</p>

<script src="js/cannon.js"></script>
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/underscore.js"></script>
<script>
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='jquery-1.8.2.min.js'%3E%3C/script%3E"));
}
</script>
<script src="js/postal.js"></script>
<script src="js/cannon.js"></script>
</head>
<body>
<p>Hello World</p>
<div id='display'></div>
<button id='send'>send</button>
</body>
19 changes: 18 additions & 1 deletion public/js/cannon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/start.coffee
@@ -1,8 +1,8 @@
path = require 'path'
connect = require 'connect'

public = path.join __dirname, '../public'
pub = path.join __dirname, '../public'
app = connect()

app.listen(4000)
app.use(connect.static public)
app.use(connect.static pub)

0 comments on commit bbdef9f

Please sign in to comment.