From d46739142e5589ae18d1c8c995715763c27671be Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Fri, 7 Jun 2013 16:58:43 +0200 Subject: [PATCH 1/7] transfer --- .../controllers/maintenance_widget.js.coffee | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/assets/javascripts/app/controllers/maintenance_widget.js.coffee diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee new file mode 100644 index 000000000..16213578f --- /dev/null +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -0,0 +1,25 @@ +class App.MaintananceWidget extends App.Controller + constructor: -> + super + + # bind on event to show message + App.Event.bind 'session:maintanance', (data) => + console.log('hannes was here') + + +class Message extends App.ControllerModal + constructor: -> + super + @render() + + render: -> + @html App.view('modal')( + title: 'Maintanance Message', + message: @message + detail: @detail + close: @close + ) + @modalShow( + backdrop: false, + keyboard: false, + ) From db0922e95630a17c5579e7539e7df88bf42e11bf Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 7 Jun 2013 17:01:46 +0200 Subject: [PATCH 2/7] Added missing widget registration. --- .../javascripts/app/controllers/maintenance_widget.js.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee index 16213578f..206f463d3 100644 --- a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -1,7 +1,7 @@ class App.MaintananceWidget extends App.Controller constructor: -> super - + # bind on event to show message App.Event.bind 'session:maintanance', (data) => console.log('hannes was here') @@ -23,3 +23,5 @@ class Message extends App.ControllerModal backdrop: false, keyboard: false, ) + +App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' ) From 2cbdb49e0629fda4d7546da0fd891a1009c23b55 Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Sat, 8 Jun 2013 15:12:28 +0200 Subject: [PATCH 3/7] first step - send maintenance message to maintenance widget via UI --- .../app/controllers/maintenance.js.coffee | 21 ++++++++++++++++++ .../controllers/maintenance_widget.js.coffee | 7 +++--- .../javascripts/app/views/maintenance.jst.eco | 22 +++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/app/controllers/maintenance.js.coffee create mode 100644 app/assets/javascripts/app/views/maintenance.jst.eco diff --git a/app/assets/javascripts/app/controllers/maintenance.js.coffee b/app/assets/javascripts/app/controllers/maintenance.js.coffee new file mode 100644 index 000000000..682e807d3 --- /dev/null +++ b/app/assets/javascripts/app/controllers/maintenance.js.coffee @@ -0,0 +1,21 @@ +class App.Maintenance extends App.ControllerContent + events: + 'submit form': 'sendMessage' + constructor: -> + super + # render page + @render() + + render: -> + + @html App.view('maintenance')() + + sendMessage: (e) -> + e.preventDefault() + params = @formParam(e.target) + console.log(params) + App.Event.trigger('session:maintanance', {title: params.HeaderText, message: params.Message}) + + +App.Config.set( 'maintenance', App.Maintenance, 'Routes' ) +App.Config.set( 'maintenance', { prio: 3600, parent: '#admin', name: 'Maintenance Message', target: '#maintenance', role: ['Admin'] }, 'NavBar' ) \ No newline at end of file diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee index 206f463d3..9b927e8bf 100644 --- a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -5,6 +5,7 @@ class App.MaintananceWidget extends App.Controller # bind on event to show message App.Event.bind 'session:maintanance', (data) => console.log('hannes was here') + new Message(data) class Message extends App.ControllerModal @@ -14,14 +15,14 @@ class Message extends App.ControllerModal render: -> @html App.view('modal')( - title: 'Maintanance Message', + title: @title, message: @message detail: @detail close: @close ) @modalShow( - backdrop: false, - keyboard: false, + backdrop: true, + keyboard: true, ) App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' ) diff --git a/app/assets/javascripts/app/views/maintenance.jst.eco b/app/assets/javascripts/app/views/maintenance.jst.eco new file mode 100644 index 000000000..f4b75acb9 --- /dev/null +++ b/app/assets/javascripts/app/views/maintenance.jst.eco @@ -0,0 +1,22 @@ + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
\ No newline at end of file From b3b618414b1ad5380f12873df5f444099f9e392f Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Fri, 7 Jun 2013 16:58:43 +0200 Subject: [PATCH 4/7] transfer --- .../controllers/maintenance_widget.js.coffee | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/assets/javascripts/app/controllers/maintenance_widget.js.coffee diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee new file mode 100644 index 000000000..16213578f --- /dev/null +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -0,0 +1,25 @@ +class App.MaintananceWidget extends App.Controller + constructor: -> + super + + # bind on event to show message + App.Event.bind 'session:maintanance', (data) => + console.log('hannes was here') + + +class Message extends App.ControllerModal + constructor: -> + super + @render() + + render: -> + @html App.view('modal')( + title: 'Maintanance Message', + message: @message + detail: @detail + close: @close + ) + @modalShow( + backdrop: false, + keyboard: false, + ) From a7986fdbc156afca526ec21d87406fbb70bf795f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 7 Jun 2013 17:01:46 +0200 Subject: [PATCH 5/7] Added missing widget registration. --- .../javascripts/app/controllers/maintenance_widget.js.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee index 16213578f..206f463d3 100644 --- a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -1,7 +1,7 @@ class App.MaintananceWidget extends App.Controller constructor: -> super - + # bind on event to show message App.Event.bind 'session:maintanance', (data) => console.log('hannes was here') @@ -23,3 +23,5 @@ class Message extends App.ControllerModal backdrop: false, keyboard: false, ) + +App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' ) From b801fba146ad83fbb865e2da611cb25282d8891b Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Sat, 8 Jun 2013 15:12:28 +0200 Subject: [PATCH 6/7] first step - send maintenance message to maintenance widget via UI --- .../app/controllers/maintenance.js.coffee | 21 ++++++++++++++++++ .../controllers/maintenance_widget.js.coffee | 7 +++--- .../javascripts/app/views/maintenance.jst.eco | 22 +++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/app/controllers/maintenance.js.coffee create mode 100644 app/assets/javascripts/app/views/maintenance.jst.eco diff --git a/app/assets/javascripts/app/controllers/maintenance.js.coffee b/app/assets/javascripts/app/controllers/maintenance.js.coffee new file mode 100644 index 000000000..682e807d3 --- /dev/null +++ b/app/assets/javascripts/app/controllers/maintenance.js.coffee @@ -0,0 +1,21 @@ +class App.Maintenance extends App.ControllerContent + events: + 'submit form': 'sendMessage' + constructor: -> + super + # render page + @render() + + render: -> + + @html App.view('maintenance')() + + sendMessage: (e) -> + e.preventDefault() + params = @formParam(e.target) + console.log(params) + App.Event.trigger('session:maintanance', {title: params.HeaderText, message: params.Message}) + + +App.Config.set( 'maintenance', App.Maintenance, 'Routes' ) +App.Config.set( 'maintenance', { prio: 3600, parent: '#admin', name: 'Maintenance Message', target: '#maintenance', role: ['Admin'] }, 'NavBar' ) \ No newline at end of file diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee index 206f463d3..9b927e8bf 100644 --- a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -5,6 +5,7 @@ class App.MaintananceWidget extends App.Controller # bind on event to show message App.Event.bind 'session:maintanance', (data) => console.log('hannes was here') + new Message(data) class Message extends App.ControllerModal @@ -14,14 +15,14 @@ class Message extends App.ControllerModal render: -> @html App.view('modal')( - title: 'Maintanance Message', + title: @title, message: @message detail: @detail close: @close ) @modalShow( - backdrop: false, - keyboard: false, + backdrop: true, + keyboard: true, ) App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' ) diff --git a/app/assets/javascripts/app/views/maintenance.jst.eco b/app/assets/javascripts/app/views/maintenance.jst.eco new file mode 100644 index 000000000..f4b75acb9 --- /dev/null +++ b/app/assets/javascripts/app/views/maintenance.jst.eco @@ -0,0 +1,22 @@ + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
\ No newline at end of file From bfe316f9f58d4ab051858ec2eb1187373977f5e2 Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Wed, 12 Jun 2013 17:36:46 +0200 Subject: [PATCH 7/7] 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