From c043b8bcf8bd877e60aa1a0004b43cca2beeb6eb Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 16 Sep 2014 20:38:13 +0200 Subject: [PATCH] Refactoring of modal api. --- .../_application_controller.js.coffee | 128 +++++++----------- .../_application_controller_form.js.coffee | 6 + .../_application_controller_generic.js.coffee | 61 ++++----- .../app/controllers/_channel/email.js.coffee | 97 +++++-------- .../controllers/agent_ticket_create.js.coffee | 27 ++-- .../controllers/agent_ticket_merge.js.coffee | 4 +- .../app/controllers/getting_started.js.coffee | 1 - .../app/controllers/layout_ref.js.coffee | 42 ++++++ .../app/controllers/signup.js.coffee | 2 - .../app/controllers/taskbar_widget.js.coffee | 26 ++-- .../app/controllers/ticket_customer.js.coffee | 4 +- .../app/controllers/ticket_overview.js.coffee | 23 ++-- .../app/controllers/widget/link.js.coffee | 13 +- .../controllers/widget/maintenance.js.coffee | 13 +- .../widget/session_taken_over.js.coffee | 2 +- .../app/lib/app_post/browser.coffee | 4 +- .../app/lib/app_post/websocket.js.coffee | 4 +- .../app/views/generic/admin/edit.jst.eco | 17 --- .../app/views/generic/admin/new.jst.eco | 17 --- .../app/views/layout_ref/index.jst.eco | 1 + .../javascripts/app/views/link/add.jst.eco | 20 +-- .../javascripts/app/views/maintenance.jst.eco | 2 +- .../javascripts/app/views/modal.jst.eco | 52 +++---- 23 files changed, 243 insertions(+), 323 deletions(-) delete mode 100644 app/assets/javascripts/app/views/generic/admin/edit.jst.eco delete mode 100644 app/assets/javascripts/app/views/generic/admin/new.jst.eco diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index fc2b5c133..40b32f350 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -441,125 +441,91 @@ class App.ControllerModal extends App.Controller className: 'modal fade' events: - 'submit form': 'submit' - 'click .js-submit': 'submit' - 'click .js-cancel': 'modalHide' - 'click .js-close': 'modalHide' + 'submit form': 'onSubmit' + 'click .js-submit': 'onSubmit' + 'click .js-cancel': 'hide' + 'click .js-close': 'hide' - constructor: (options) -> + constructor: (options = {}) -> + defaults = + backdrop: true + keyboard: true + close: true + title: '?' + + options = _.extend( options, defaults ) # do not use @el, because it's inserted by js - if options - delete options.el - - # callbacks -# @callback = {} -# if options.success -# @callback.success = options.success -# if options.error -# @callback.error = options.error + delete options.el super(options) - if options.show - @render() - render: -> + @show() + + show: (content) -> + console.log('M', @message) + if @button is true + @button = 'Submit' @html App.view('modal')( - title: @title + head: @head message: @message detail: @detail close: @close + cancel: @cancel + button: @button ) - @modalShow( - backdrop: @backdrop - keyboard: @keyboard - ) - - modalShow: (params) -> - defaults = { - backdrop: true - keyboard: true - show: true - } - data = $.extend({}, defaults, params) - @el.modal(data) - - @el.bind('hidden.bs.modal', => - - # navigate back to home page -# if @pageData && @pageData.home -# @navigate @pageData.home - - # navigate back - if params && params.navigateBack - window.history.back() - - # remove modal from dom - $('.modal').remove(); - ) + if content + @el.find('.modal-body').html content + @el.modal('show') modalHide: (e) -> if e e.preventDefault() @el.modal('hide') - submit: (e) -> + hide: (e) -> + if e + e.preventDefault() + @el.modal('hide') + + onShow: -> + console.log('no nothing') + # do nothing + + onHide: -> + console.log('no nothing') + # do nothing + + onSubmit: (e) -> e.preventDefault() - @log 'error', 'You need to implement your own "submit" method!' + @log 'error', 'You need to implement your own "onSubmit" method!' class App.ErrorModal extends App.ControllerModal constructor: -> super - @render() - - render: -> - @html App.view('modal')( - title: 'Error', - message: @message - detail: @detail - close: @close - ) - @modalShow( - backdrop: false, - keyboard: false, - ) + @show() class App.SessionMessage extends App.ControllerModal constructor: -> super - @render() - render: -> - @html App.view('modal')( - title: @title || '?' - message: @message || '?' - detail: @detail - close: @close - button: @button - ) - @modalShow( - backdrop: @backdrop, - keyboard: @keyboard, - ) + console.log('SM', @) - # reload page on modal hidden - if @forceReload - @el.on('hidden', => - @reload() - ) + @show() - modalHide: (e) => + # reload page on modal hidden + onHide: (e) => if @forceReload @reload(e) - @el.modal('hide') - submit: (e) => + onSubmit: (e) => if @forceReload @reload(e) reload: (e) -> if e e.preventDefault() + $('#app').hide().attr('style', 'display: none!important') if window.location.reload window.location.reload() return true diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index e61ec781d..f07430279 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -19,6 +19,9 @@ class App.ControllerForm extends App.Controller @form.find('textarea').trigger('change') @form.find('select').trigger('change') + @finishForm = true + @form + html: => @form.html() @@ -1594,6 +1597,9 @@ class App.ControllerForm extends App.Controller else if form.parents('form')[0] form = $( form.parents('form')[0] ) + # use current content as form if form isn't already finished + else if !@finishForm + from = form else App.Log.error 'ControllerForm', 'no form found!', form diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee index 706c4a722..31ec5bbc4 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee @@ -1,21 +1,22 @@ class App.ControllerGenericNew extends App.ControllerModal constructor: (params) -> super - @render() - render: -> + @head = App.i18n.translateContent( 'New' ) + ': ' + App.i18n.translateContent( @pageData.object ) + @cancel = true + @button = true - @html App.view('generic/admin/new')( head: @pageData.object ) - new App.ControllerForm( + controller = new App.ControllerForm( el: @el.find('#object_new') model: App[ @genericObject ] params: @item screen: @screen || 'edit' autofocus: true ) - @modalShow() - submit: (e) -> + @show(controller.form) + + onSubmit: (e) -> e.preventDefault() params = @formParam( e.target ) @@ -39,32 +40,33 @@ class App.ControllerGenericNew extends App.ControllerModal if ui.callback item = App[ ui.genericObject ].fullLocal(@id) ui.callback( item ) - ui.modalHide() + ui.hide() fail: -> ui.log 'errors' - ui.modalHide() + ui.hide() ) class App.ControllerGenericEdit extends App.ControllerModal constructor: (params) -> super @item = App[ @genericObject ].find( params.id ) - @render() - render: -> + @head = App.i18n.translateContent( 'Edit' ) + ': ' + App.i18n.translateContent( @pageData.object ) + @cancel = true + @button = true - @html App.view('generic/admin/edit')( head: @pageData.object ) - new App.ControllerForm( - el: @el.find('#object_edit') + controller = new App.ControllerForm( + el: @el.find('#object_new') model: App[ @genericObject ] params: @item screen: @screen || 'edit' autofocus: true ) - @modalShow() - submit: (e) -> + @show(controller.form) + + onSubmit: (e) -> e.preventDefault() params = @formParam(e.target) @item.load(params) @@ -86,11 +88,11 @@ class App.ControllerGenericEdit extends App.ControllerModal if ui.callback item = App[ ui.genericObject ].fullLocal(@id) ui.callback( item ) - ui.modalHide() + ui.hide() fail: => ui.log 'errors' - ui.modalHide() + ui.hide() ) class App.ControllerGenericIndex extends App.Controller @@ -186,22 +188,15 @@ class App.ControllerGenericIndex extends App.Controller class App.ControllerGenericDestroyConfirm extends App.ControllerModal constructor: -> super - @render() + @head = 'Confirm' + @cancel = true + @button = 'Yes' + @message = 'Sure to delete this object?' + @show(@message) - render: -> - @html App.view('modal')( - title: 'Confirm' - message: 'Sure to delete this object?' - cancel: true - button: 'Yes' - ) - @modalShow( - backdrop: true - keyboard: true - ) - - submit: (e) => - @modalHide() + onSubmit: (e) -> + e.preventDefault() + @hide() @item.destroy() class App.ControllerDrox extends App.Controller @@ -398,7 +393,7 @@ class App.GenericHistory extends App.ControllerModal @historyListCache ) - @modalShow() + @hide() # enable user popups @userPopups() diff --git a/app/assets/javascripts/app/controllers/_channel/email.js.coffee b/app/assets/javascripts/app/controllers/_channel/email.js.coffee index 08af8863e..b11c2b73b 100644 --- a/app/assets/javascripts/app/controllers/_channel/email.js.coffee +++ b/app/assets/javascripts/app/controllers/_channel/email.js.coffee @@ -73,31 +73,24 @@ class App.ChannelEmailFilter extends App.Controller class App.ChannelEmailFilterEdit extends App.ControllerModal constructor: -> super - @render(@object) - - render: (data = {}) -> if @object - @html App.view('generic/admin/edit')( - head: 'Postmaster Filter' - ) @form = new App.ControllerForm( - el: @el.find('#object_edit'), model: App.PostmasterFilter, params: @object, autofocus: true, ) else - @html App.view('generic/admin/new')( - head: 'Postmaster Filter' - ) @form = new App.ControllerForm( - el: @el.find('#object_new'), model: App.PostmasterFilter, autofocus: true, ) - @modalShow() + @head = 'Postmaster Filter' + @button = true + @close = true + @cancel = true + @show( @form.form ) - submit: (e) => + onSubmit: (e) => e.preventDefault() # get params @@ -122,9 +115,9 @@ class App.ChannelEmailFilterEdit extends App.ControllerModal # save object object.save( done: => - @modalHide() + @hide() fail: => - @modalHide() + @hide() ) @@ -165,31 +158,24 @@ class App.ChannelEmailAddress extends App.Controller class App.ChannelEmailAddressEdit extends App.ControllerModal constructor: -> super - @render(@object) - - render: (data = {}) -> if @object - @html App.view('generic/admin/edit')( - head: 'Email-Address' - ) @form = new App.ControllerForm( - el: @el.find('#object_edit') model: App.EmailAddress params: @object autofocus: true ) else - @html App.view('generic/admin/new')( - head: 'Email-Address' - ) @form = new App.ControllerForm( - el: @el.find('#object_new'), model: App.EmailAddress, autofocus: true, ) - @modalShow() + @head = 'Email-Address' + @button = true + @close = true + @cancel = true + @show( @form.form ) - submit: (e) => + onSubmit: (e) => e.preventDefault() # get params @@ -213,9 +199,9 @@ class App.ChannelEmailAddressEdit extends App.ControllerModal # save object object.save( done: => - @modalHide() + @hide() fail: => - @modalHide() + @hide() ) class App.ChannelEmailSignature extends App.Controller @@ -253,31 +239,24 @@ class App.ChannelEmailSignature extends App.Controller class App.ChannelEmailSignatureEdit extends App.ControllerModal constructor: -> super - @render(@object) - - render: (data = {}) -> if @object - @html App.view('generic/admin/edit')( - head: 'Signature' - ) @form = new App.ControllerForm( - el: @el.find('#object_edit') model: App.Signature params: @object autofocus: true ) else - @html App.view('generic/admin/new')( - head: 'Signature' - ) @form = new App.ControllerForm( - el: @el.find('#object_new') model: App.Signature autofocus: true ) - @modalShow() + @head = 'Signature' + @button = true + @close = true + @cancel = true + @show( @form.form ) - submit: (e) => + onSubmit: (e) => e.preventDefault() # get params @@ -301,9 +280,9 @@ class App.ChannelEmailSignatureEdit extends App.ControllerModal # save object object.save( done: => - @modalHide() + @hide() fail: => - @modalHide() + @hide() ) class App.ChannelEmailInbound extends App.Controller @@ -342,30 +321,24 @@ class App.ChannelEmailInbound extends App.Controller class App.ChannelEmailInboundEdit extends App.ControllerModal constructor: -> super - @render(@object) - - render: (data = {}) -> if @object - @html App.view('generic/admin/edit')( - head: 'Email Channel' - ) @form = new App.ControllerForm( - el: @el.find('#object_edit') - model: App.Channel + model: App.Channel + params: @object autofocus: true ) else - @html App.view('generic/admin/new')( - head: 'Email Channel' - ) @form = new App.ControllerForm( - el: @el.find('#object_new') - model: App.Channel + model: App.Channel autofocus: true ) - @modalShow() + @head = 'Email Channel' + @button = true + @close = true + @cancel = true + @show( @form.form ) - submit: (e) => + onSubmit: (e) => e.preventDefault() # get params @@ -390,9 +363,9 @@ class App.ChannelEmailInboundEdit extends App.ControllerModal # save object object.save( done: => - @modalHide() + @hide() fail: => - @modalHide() + @hide() ) class App.ChannelEmailOutbound extends App.Controller diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 76becf54d..53973644c 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -479,22 +479,20 @@ class Sidebar extends App.Controller class UserNew extends App.ControllerModal constructor: -> super - @render() + @head = 'New User' + @cancel = true + @button = true - render: -> - - @html App.view('agent_user_create')( head: 'New User' ) - - new App.ControllerForm( + controller = new App.ControllerForm( el: @el.find('#form-user') model: App.User screen: 'edit' autofocus: true ) - @modalShow() + @show( controller.form ) - submit: (e) -> + onSubmit: (e) -> e.preventDefault() params = @formParam(e.target) @@ -503,12 +501,13 @@ class UserNew extends App.ControllerModal if !params.login && params.email params.login = params.email - user = new App.User - # find role_id - role = App.Role.findByAttribute( 'name', 'Customer' ) - params.role_ids = role.id + if !params.role_ids || _.isEmpty( params.role_ids ) + role = App.Role.findByAttribute( 'name', 'Customer' ) + params.role_ids = role.id @log 'notice', 'updateAttributes', params + + user = new App.User user.load(params) errors = user.validate() @@ -532,11 +531,11 @@ class UserNew extends App.ControllerModal # start customer info controller ui.userInfo( user_id: user.id ) - ui.modalHide() + ui.hide() App.User.full( @id, callbackReload , true ) fail: -> - ui.modalHide() + ui.hide() ) class Router extends App.ControllerPermanent diff --git a/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee index af8a1dd63..7fac9ca3b 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee @@ -63,7 +63,7 @@ class App.TicketMerge extends App.ControllerModal $(e.target).parents().find('[name="master_ticket_number"]').val( ticket.number ) ) - @modalShow() + @hide() submit: (e) => e.preventDefault() @@ -91,7 +91,7 @@ class App.TicketMerge extends App.ControllerModal App.Collection.load( type: 'Ticket', data: [data.slave_ticket] ) # hide dialog - @modalHide() + @hide() # view ticket @log 'notice', 'nav...', App.Ticket.find( data.master_ticket['id'] ) diff --git a/app/assets/javascripts/app/controllers/getting_started.js.coffee b/app/assets/javascripts/app/controllers/getting_started.js.coffee index 7dd104a86..71aee3358 100644 --- a/app/assets/javascripts/app/controllers/getting_started.js.coffee +++ b/app/assets/javascripts/app/controllers/getting_started.js.coffee @@ -130,7 +130,6 @@ class Index extends App.ControllerContent msg: App.i18n.translateContent( 'Can\'t create user!' ) timeout: 2500 } -# @modalHide() ) relogin: (data, status, xhr) => diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee index 4d8478d55..c920e49b9 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.js.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -41,6 +41,48 @@ class ContentSidebarRightSidebarOptional extends App.ControllerContent App.Config.set( 'layout_ref/content_sidebar_right_sidebar_optional', ContentSidebarRightSidebarOptional, 'Routes' ) +class ModalForm extends App.ControllerModal + constructor: -> + super + @head = '123 some title' + @cancel = true + @button = true + + controller = new App.ControllerForm( + model: App.User + autofocus: true + ) + + @show(controller.form) + + onHide: => + window.history.back() + + onSubmit: (e) => + e.preventDefault() + params = App.ControllerForm.params( $(e.target).closest('form') ) + console.log('params', params) + + +App.Config.set( 'layout_ref/modal_form', ModalForm, 'Routes' ) + +class ModalText extends App.ControllerModal + constructor: -> + super + @head = '123 some title' + + form = App.view('layout_ref/content')() + + @show(form) + + onHide: => + window.history.back() + + + +App.Config.set( 'layout_ref/modal_text', ModalText, 'Routes' ) + + class ContentSidebarTabsRight extends App.ControllerContent elements: diff --git a/app/assets/javascripts/app/controllers/signup.js.coffee b/app/assets/javascripts/app/controllers/signup.js.coffee index 258345ceb..47477537f 100644 --- a/app/assets/javascripts/app/controllers/signup.js.coffee +++ b/app/assets/javascripts/app/controllers/signup.js.coffee @@ -70,8 +70,6 @@ class Index extends App.ControllerContent success: @success error: @error ) -# fail: => -# @modalHide() ) success: (data, status, xhr) => diff --git a/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee b/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee index 301889ac4..aee945e6d 100644 --- a/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee @@ -75,7 +75,7 @@ class App.TaskbarWidget extends App.Controller remove: (e, key = false, force = false) => e.preventDefault() if !key - key = $(e.target).parent().parent().data('key') + key = $(e.target).parents('a').data('key') if !key throw "No such key attributes found for task item" @@ -117,20 +117,14 @@ class App.TaskbarWidget extends App.Controller class Remove extends App.ControllerModal constructor: -> super - @render() + @head = 'Confirm' + @message = 'Tab has changed, you really want to close it?' + @cancel = true + @close = true + @button = 'Close' + @show() - render: -> - @html App.view('modal')( - title: 'Confirm' - message: 'Tab has changed, you really want to close it?' - close: true - button: 'Close' - ) - @modalShow( - backdrop: true, - keyboard: true, - ) - - submit: (e) => - @modalHide() + onSubmit: (e) => + e.preventDefault() + @hide() @ui.remove(e, @key, true) diff --git a/app/assets/javascripts/app/controllers/ticket_customer.js.coffee b/app/assets/javascripts/app/controllers/ticket_customer.js.coffee index 1841b9f88..f3b94d39e 100644 --- a/app/assets/javascripts/app/controllers/ticket_customer.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_customer.js.coffee @@ -18,7 +18,7 @@ class App.TicketCustomer extends App.ControllerModal }, autofocus: true, ) - @modalShow() + @hide() submit: (e) => e.preventDefault() @@ -30,7 +30,7 @@ class App.TicketCustomer extends App.ControllerModal callback = => # close modal - @modalHide() + @hide() # update ticket @ticket.updateAttributes( diff --git a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee index f3062317c..ce84bb223 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee @@ -437,13 +437,7 @@ class App.OverviewSettings extends App.ControllerModal constructor: -> super @overview = App.Overview.find(@overview_id) - @render() - render: -> - - @html App.view('dashboard/ticket_settings')( - overview: @overview, - ) @configure_attributes_article = [] if @view_mode is 'd' @configure_attributes_article.push({ @@ -593,15 +587,20 @@ class App.OverviewSettings extends App.ControllerModal class: 'medium' }) - new App.ControllerForm( - el: @el.find('#form-setting') + form = App.view('dashboard/ticket_settings')( + overview: @overview, + ) + @head = App.i18n.translateContent( 'Edit' ) + ': ' + App.i18n.translateContent( @overview.name ) + @close = true + @cancel = true + @button = true + controller = new App.ControllerForm( model: { configure_attributes: @configure_attributes_article } autofocus: false ) + @show( controller.form ) - @modalShow() - - submit: (e) => + onSubmit: (e) => e.preventDefault() params = @formParam(e.target) @@ -627,7 +626,7 @@ class App.OverviewSettings extends App.ControllerModal else @overview.trigger('local:rerender') ) - @modalHide() + @hide() class Navbar extends App.Controller constructor: -> diff --git a/app/assets/javascripts/app/controllers/widget/link.js.coffee b/app/assets/javascripts/app/controllers/widget/link.js.coffee index d8097e598..19cc99634 100644 --- a/app/assets/javascripts/app/controllers/widget/link.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/link.js.coffee @@ -83,17 +83,18 @@ class App.WidgetLink extends App.Controller class App.LinkAdd extends App.ControllerModal constructor: -> super - @render() + @head = 'Links' + @button = true + @cancel = true - render: => - @html App.view('link/add')( + form = App.view('link/add')( link_object: @link_object, link_object_id: @link_object_id, object: @object, ) - @modalShow() + @show( form ) - submit: (e) => + onSubmit: (e) => e.preventDefault() params = @formParam(e.target) @@ -111,6 +112,6 @@ class App.LinkAdd extends App.ControllerModal } processData: true, success: (data, status, xhr) => - @modalHide() + @hide() @parent.fetch() ) diff --git a/app/assets/javascripts/app/controllers/widget/maintenance.js.coffee b/app/assets/javascripts/app/controllers/widget/maintenance.js.coffee index 53aae0fff..3f147dd0c 100644 --- a/app/assets/javascripts/app/controllers/widget/maintenance.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/maintenance.js.coffee @@ -6,23 +6,18 @@ class Widget extends App.Controller App.Event.bind( 'session:maintenance' (data) => - new Message( message: data ) + console.log('session:maintenance', data) + @showMessage( data ) 'maintenance' ) -class Message extends App.ControllerModal - constructor: -> - super - @render(@message) - - render: (message = {}) -> - + showMessage: (message = {}) => if message.reload @disconnectClient() button = 'Reload application' new App.SessionMessage( - title: message.title + head: message.head message: message.message keyboard: false backdrop: true diff --git a/app/assets/javascripts/app/controllers/widget/session_taken_over.js.coffee b/app/assets/javascripts/app/controllers/widget/session_taken_over.js.coffee index a52156b8d..6c56c3524 100644 --- a/app/assets/javascripts/app/controllers/widget/session_taken_over.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/session_taken_over.js.coffee @@ -39,7 +39,7 @@ class Widget extends App.Controller # only if new client id isnt own client id if data.taskbar_id isnt App.TaskManager.TaskbarId() @error = new App.SessionMessage( - title: 'Session' + head: 'Session' message: 'Session taken over... please reload page or work with other browser window.' keyboard: false backdrop: true diff --git a/app/assets/javascripts/app/lib/app_post/browser.coffee b/app/assets/javascripts/app/lib/app_post/browser.coffee index 109f35a0d..ac2b64b12 100644 --- a/app/assets/javascripts/app/lib/app_post/browser.coffee +++ b/app/assets/javascripts/app/lib/app_post/browser.coffee @@ -42,9 +42,9 @@ class App.Browser @message: (data) -> new App.ControllerModal( - title: 'Browser too old!' + head: 'Browser too old!' message: "Your Browser is not supported (#{data.browser} #{data.version} #{data.OS}). Please use a newer one." - show: true + close: false backdrop: false keyboard: false ) diff --git a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee index f2c9a1c03..33d257ada 100644 --- a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee @@ -194,7 +194,7 @@ class _webSocketSingleton extends App.Controller # close error message show up (because try so connect again) if exists App.Delay.clear('websocket-no-connection-try-reconnect-message', 'ws') if @error - @error.modalHide() + @error.hide() @error = false @tryToConnect = false @@ -242,7 +242,7 @@ class _webSocketSingleton extends App.Controller message: 'Lost network connection to system, trying to reconnect...' backdrop: false keyboard: false - show: true + close: false ) if !@tryToConnect App.Delay.set message, 7000, 'websocket-no-connection-try-reconnect-message', 'ws' diff --git a/app/assets/javascripts/app/views/generic/admin/edit.jst.eco b/app/assets/javascripts/app/views/generic/admin/edit.jst.eco deleted file mode 100644 index 7a877f055..000000000 --- a/app/assets/javascripts/app/views/generic/admin/edit.jst.eco +++ /dev/null @@ -1,17 +0,0 @@ -
- -
diff --git a/app/assets/javascripts/app/views/generic/admin/new.jst.eco b/app/assets/javascripts/app/views/generic/admin/new.jst.eco deleted file mode 100644 index 0c484f506..000000000 --- a/app/assets/javascripts/app/views/generic/admin/new.jst.eco +++ /dev/null @@ -1,17 +0,0 @@ -
- -
diff --git a/app/assets/javascripts/app/views/layout_ref/index.jst.eco b/app/assets/javascripts/app/views/layout_ref/index.jst.eco index f57cccc89..0121a8fb4 100644 --- a/app/assets/javascripts/app/views/layout_ref/index.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/index.jst.eco @@ -9,6 +9,7 @@
  • Content + Sidebar Right not shown if screen resulution is lower then 1280px Example
  • Content + Sidebar Left Example
  • Content + Sidebar Tabs Right Example
  • +
  • Modal Dialog Example with From / Example with Text
  • \ No newline at end of file diff --git a/app/assets/javascripts/app/views/link/add.jst.eco b/app/assets/javascripts/app/views/link/add.jst.eco index ee94f57e4..69fcc06d5 100644 --- a/app/assets/javascripts/app/views/link/add.jst.eco +++ b/app/assets/javascripts/app/views/link/add.jst.eco @@ -1,13 +1,4 @@ -
    - -
    + \ No newline at end of file diff --git a/app/assets/javascripts/app/views/maintenance.jst.eco b/app/assets/javascripts/app/views/maintenance.jst.eco index 3d48ebc7d..b2a46bdc8 100644 --- a/app/assets/javascripts/app/views/maintenance.jst.eco +++ b/app/assets/javascripts/app/views/maintenance.jst.eco @@ -6,7 +6,7 @@
    - +
    diff --git a/app/assets/javascripts/app/views/modal.jst.eco b/app/assets/javascripts/app/views/modal.jst.eco index 3badf8a3c..c49d7ac78 100644 --- a/app/assets/javascripts/app/views/modal.jst.eco +++ b/app/assets/javascripts/app/views/modal.jst.eco @@ -1,28 +1,30 @@