From bfe316f9f58d4ab051858ec2eb1187373977f5e2 Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Wed, 12 Jun 2013 17:36:46 +0200 Subject: [PATCH] added web socket support without spooling changed button layout to action button --- .../javascripts/app/controllers/maintenance.js.coffee | 9 +++++++-- .../app/controllers/maintenance_widget.js.coffee | 6 +++--- app/assets/javascripts/app/views/maintenance.jst.eco | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/maintenance.js.coffee b/app/assets/javascripts/app/controllers/maintenance.js.coffee index 682e807d3..63bcc7093 100644 --- a/app/assets/javascripts/app/controllers/maintenance.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance.js.coffee @@ -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' ) diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee index 9b927e8bf..6e3b1c543 100644 --- a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -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' ) diff --git a/app/assets/javascripts/app/views/maintenance.jst.eco b/app/assets/javascripts/app/views/maintenance.jst.eco index f4b75acb9..995cb9a22 100644 --- a/app/assets/javascripts/app/views/maintenance.jst.eco +++ b/app/assets/javascripts/app/views/maintenance.jst.eco @@ -16,7 +16,7 @@
- +
\ No newline at end of file