added web socket support without spooling
changed button layout to action button
This commit is contained in:
parent
d754f71ba6
commit
bfe316f9f5
3 changed files with 11 additions and 6 deletions
|
@ -13,8 +13,13 @@ class App.Maintenance extends App.ControllerContent
|
||||||
sendMessage: (e) ->
|
sendMessage: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
console.log(params)
|
App.Event.trigger(
|
||||||
App.Event.trigger('session:maintanance', {title: params.HeaderText, message: params.Message})
|
'ws:send'
|
||||||
|
action: 'broadcast'
|
||||||
|
event: 'session:maintenance'
|
||||||
|
spool: false
|
||||||
|
data: {title: params.headerText, message: params.message}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
App.Config.set( 'maintenance', App.Maintenance, 'Routes' )
|
App.Config.set( 'maintenance', App.Maintenance, 'Routes' )
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class App.MaintananceWidget extends App.Controller
|
class App.MaintenanceWidget extends App.Controller
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
||||||
# bind on event to show message
|
# bind on event to show message
|
||||||
App.Event.bind 'session:maintanance', (data) =>
|
App.Event.bind 'session:maintenance', (data) =>
|
||||||
console.log('hannes was here')
|
console.log('hannes was here')
|
||||||
new Message(data)
|
new Message(data)
|
||||||
|
|
||||||
|
@ -25,4 +25,4 @@ class Message extends App.ControllerModal
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' )
|
App.Config.set( 'maintenance', App.MaintenanceWidget, 'Widgets' )
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<button type="submit" class="btn">Send Message</button>
|
<button type="submit" class="btn btn-primary submit">Send Message</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
Loading…
Reference in a new issue