
Untitled
By: a guest on
Jan 30th, 2012 | syntax:
CoffeeScript | size: 1.28 KB | hits: 99 | expires: Never
require('./zappa') '10.0.2.15', 80, (ap)->
@enable 'serve jquery', 'serve sammy', 'serve jquery-ui'
@get '/': ->
@render index: {layout: no}
@client '/index.js': ->
@connect()
$("#draggable").draggable();
$("#droppable").droppable(drop: ( event, ui ) -> this.addClass( "ui-state-highlight" ).find( "p" ).html( "Dropped!" ))
@view index: ->
doctype 5
html ->
head ->
meta charset: 'utf-8'
title "#{'Test'}"
style '''
#draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
#droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
'''
script src: '/socket.io/socket.io.js'
script src: '/zappa/jquery.js'
script src: '/zappa/sammy.js'
script src: '/zappa/zappa.js'
# script src: '/zappa/jquery-1.7.1.min.js'
# script src: '/zappa/jquery-ui.js'
script src: '/index.js'
body ->
div 'demo', ->
div 'ui-widget-content', id: 'draggable', ->
p 'Drag me to my target'
div 'ui-widget-header', id: 'droppable', ->
p 'Drop here'