added web socket support without spooling

changed button layout to action button
This commit is contained in:
Johannes Nickel 2013-06-12 17:36:46 +02:00
parent d754f71ba6
commit bfe316f9f5
3 changed files with 11 additions and 6 deletions

View file

@ -13,8 +13,13 @@ class App.Maintenance extends App.ControllerContent
sendMessage: (e) ->
e.preventDefault()
params = @formParam(e.target)
console.log(params)
App.Event.trigger('session:maintanance', {title: params.HeaderText, message: params.Message})
App.Event.trigger(
'ws:send'
action: 'broadcast'
event: 'session:maintenance'
spool: false
data: {title: params.headerText, message: params.message}
)
App.Config.set( 'maintenance', App.Maintenance, 'Routes' )

View file

@ -1,9 +1,9 @@
class App.MaintananceWidget extends App.Controller
class App.MaintenanceWidget extends App.Controller
constructor: ->
super
# bind on event to show message
App.Event.bind 'session:maintanance', (data) =>
App.Event.bind 'session:maintenance', (data) =>
console.log('hannes was here')
new Message(data)
@ -25,4 +25,4 @@ class Message extends App.ControllerModal
keyboard: true,
)
App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' )
App.Config.set( 'maintenance', App.MaintenanceWidget, 'Widgets' )

View file

@ -16,7 +16,7 @@
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn">Send Message</button>
<button type="submit" class="btn btn-primary submit">Send Message</button>
</div>
</div>
</form>