Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jan 30th, 2012  |  syntax: CoffeeScript  |  size: 1.28 KB  |  hits: 99  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. require('./zappa') '10.0.2.15', 80, (ap)->
  2.  
  3.   @enable 'serve jquery', 'serve sammy', 'serve jquery-ui'
  4.  
  5.   @get '/': ->                        
  6.     @render index: {layout: no}
  7.  
  8.   @client '/index.js': ->
  9.    
  10.     @connect()
  11.    
  12.    
  13.     $("#draggable").draggable();
  14.     $("#droppable").droppable(drop: ( event, ui ) -> this.addClass( "ui-state-highlight" ).find( "p" ).html( "Dropped!" ))
  15.  
  16.  
  17.    
  18.    
  19.   @view index: ->
  20.     doctype 5
  21.     html ->
  22.       head ->
  23.         meta charset: 'utf-8'
  24.         title "#{'Test'}"    
  25.         style '''
  26.          #draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
  27.                 #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
  28.        '''
  29.         script src: '/socket.io/socket.io.js'
  30.         script src: '/zappa/jquery.js'
  31.         script src: '/zappa/sammy.js'        
  32.         script src: '/zappa/zappa.js'
  33. #        script src: '/zappa/jquery-1.7.1.min.js'
  34.        # script src: '/zappa/jquery-ui.js'
  35.         script src: '/index.js'
  36.       body ->  
  37.         div 'demo', ->
  38.           div 'ui-widget-content', id: 'draggable', ->
  39.             p 'Drag me to my target'
  40.           div 'ui-widget-header', id: 'droppable', ->
  41.             p 'Drop here'