From e90ac1e336f610bda7f60d8fa78a09dbc162d617 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 21 Sep 2015 19:47:48 +0200 Subject: [PATCH] Applied coffeelint. --- .../app/controllers/_channel/email.js.coffee | 6 +-- .../_dashboard/first_steps_clues.js.coffee | 2 +- .../app/controllers/_profile/avatar.js.coffee | 3 +- .../app/controllers/_settings/area.js.coffee | 2 +- .../_ui_element/autocompletion.js.coffee | 4 +- .../_ui_element/postmaster_match.js.coffee | 2 +- .../_ui_element/postmaster_set.js.coffee | 2 +- .../_ui_element/richtext.js.coffee | 1 - .../_ui_element/sla_times.js.coffee | 2 +- .../app/controllers/_ui_element/tag.js.coffee | 2 +- .../_ui_element/textarea.js.coffee | 2 +- .../ticket_perform_action.js.coffee | 2 +- .../_ui_element/ticket_selector.js.coffee | 6 +-- .../controllers/agent_ticket_create.js.coffee | 6 +-- .../app/controllers/dashboard.js.coffee | 8 ++-- .../app/controllers/getting_started.js.coffee | 8 ++-- .../app/controllers/navigation.js.coffee | 22 +++++----- .../organization_profile.js.coffee | 4 +- .../app/controllers/ticket_overview.js.coffee | 20 ++++----- .../app/controllers/ticket_zoom.js.coffee | 12 +++--- .../ticket_zoom/article_actions.js.coffee | 6 +-- .../ticket_zoom/article_view.js.coffee | 2 +- .../app/controllers/translation.js.coffee | 8 ++-- .../app/controllers/user_profile.js.coffee | 4 +- .../app/controllers/widget/notify.js.coffee | 2 +- .../controllers/widget/ticket_list.js.coffee | 6 +-- .../app/lib/app_init/log.js.coffee | 2 +- .../app/lib/app_post/audio.js.coffee | 6 +-- .../app/lib/app_post/auth.js.coffee | 2 +- .../app/lib/app_post/clipboard.js.coffee | 2 +- .../app/lib/app_post/collection.js.coffee | 8 ++-- .../app/lib/app_post/image_service.js.coffee | 4 +- .../app/lib/app_post/pretty_date.js.coffee | 2 +- .../app/lib/app_post/utils.js.coffee | 4 +- .../app/lib/app_post/websocket.js.coffee | 42 +++++++++---------- .../app/models/_application_model.js.coffee | 8 ++-- 36 files changed, 111 insertions(+), 113 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_channel/email.js.coffee b/app/assets/javascripts/app/controllers/_channel/email.js.coffee index 04218aafb..fa7504944 100644 --- a/app/assets/javascripts/app/controllers/_channel/email.js.coffee +++ b/app/assets/javascripts/app/controllers/_channel/email.js.coffee @@ -761,9 +761,9 @@ class App.ChannelEmailAccountWizard extends App.Wizard @el.modal('hide') else if data.source is 'inbound' || data.source is 'outbound' - @showSlide("js-#{data.source}") - @showAlert("js-#{data.source}", data.message_human || data.message ) - @showInvalidField("js-#{data.source}", data.invalid_field) + @showSlide("js-#{data.source}") + @showAlert("js-#{data.source}", data.message_human || data.message ) + @showInvalidField("js-#{data.source}", data.invalid_field) else if count is 2 @showAlert('js-verify', data.message_human || data.message ) diff --git a/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.js.coffee b/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.js.coffee index 911680082..f88d415a8 100644 --- a/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.js.coffee +++ b/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.js.coffee @@ -205,7 +205,7 @@ class App.FirstStepsClues extends App.Controller if target.right + modal.width <= maxWidth left = target.right position = 'right' - else + else # place left left = target.left - modal.width position = 'left' diff --git a/app/assets/javascripts/app/controllers/_profile/avatar.js.coffee b/app/assets/javascripts/app/controllers/_profile/avatar.js.coffee index 25e86e88e..b20d55406 100644 --- a/app/assets/javascripts/app/controllers/_profile/avatar.js.coffee +++ b/app/assets/javascripts/app/controllers/_profile/avatar.js.coffee @@ -59,7 +59,6 @@ class Index extends App.Controller url: @apiPath + '/users/avatar' data: JSON.stringify( params ) processData: true - success: (data, status, xhr) => ) pick: (avatar) => @@ -136,7 +135,7 @@ class Index extends App.Controller EXIF.getData event.target.files[0], -> orientation = this.exifdata.Orientation reader = new FileReader() - reader.onload = (e) => + reader.onload = (e) -> new ImageCropper imageSource: e.target.result callback: callback diff --git a/app/assets/javascripts/app/controllers/_settings/area.js.coffee b/app/assets/javascripts/app/controllers/_settings/area.js.coffee index 3f2cbaa25..b108bcc7e 100644 --- a/app/assets/javascripts/app/controllers/_settings/area.js.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area.js.coffee @@ -126,7 +126,7 @@ class App.SettingsAreaItem extends App.Controller if @setting.preferences.session_check App.Auth.loginCheck() - fail: => + fail: -> ui.formEnable(e) App.Event.trigger 'notify', { type: 'error' diff --git a/app/assets/javascripts/app/controllers/_ui_element/autocompletion.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/autocompletion.js.coffee index 65d11b1c0..d60153503 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/autocompletion.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/autocompletion.js.coffee @@ -40,11 +40,11 @@ class App.UiElement.autocompletion ### source = attribute.source if typeof(source) is 'string' - source = source.replace('#{@apiPath}', App.Config.get('api_path') ); + source = source.replace('#{@apiPath}', App.Config.get('api_path') ) $(local_attribute_full).autocomplete( source: source, minLength: attribute.minLengt || 3, - select: ( event, ui ) => + select: ( event, ui ) -> b(event, ui.item) ) App.Delay.set( a, 280, undefined, 'form_autocompletion' ) diff --git a/app/assets/javascripts/app/controllers/_ui_element/postmaster_match.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/postmaster_match.js.coffee index 42ec88b75..33f895c9a 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/postmaster_match.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/postmaster_match.js.coffee @@ -117,7 +117,7 @@ class App.UiElement.postmaster_match item.find('.js-attributeSelector').prepend(selector) # add filter - item.find('.js-add').bind('click', (e) => + item.find('.js-add').bind('click', (e) -> element = $(e.target).closest('.js-filterElement') elementClone = element.clone(true) element.after(elementClone) diff --git a/app/assets/javascripts/app/controllers/_ui_element/postmaster_set.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/postmaster_set.js.coffee index 464330b3e..dae685bf7 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/postmaster_set.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/postmaster_set.js.coffee @@ -69,7 +69,7 @@ class App.UiElement.postmaster_set item.find('.js-attributeSelector').prepend(selector) # add filter - item.find('.js-add').bind('click', (e) => + item.find('.js-add').bind('click', (e) -> element = $(e.target).closest('.js-filterElement') elementClone = element.clone(true) element.after(elementClone) diff --git a/app/assets/javascripts/app/controllers/_ui_element/richtext.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/richtext.js.coffee index 058c4a1cb..30bd3bdd0 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/richtext.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/richtext.js.coffee @@ -32,7 +32,6 @@ class App.UiElement.richtext url: App.Config.get('api_path') + '/ticket_attachment_upload' data: JSON.stringify( { store_id: store_id } ), processData: false - success: (data, status, xhr) => ) # remove attachment from dom diff --git a/app/assets/javascripts/app/controllers/_ui_element/sla_times.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/sla_times.js.coffee index 9793c7bcf..418a9a927 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/sla_times.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/sla_times.js.coffee @@ -21,7 +21,7 @@ class App.UiElement.sla_times ) # disable/enable rows - item.find('.js-activateRow').bind('change', (e) => + item.find('.js-activateRow').bind('change', (e) -> element = $(e.target) row = element.closest('tr') if element.prop('checked') diff --git a/app/assets/javascripts/app/controllers/_ui_element/tag.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/tag.js.coffee index 19c66ccc6..05c4f3172 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/tag.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/tag.js.coffee @@ -1,7 +1,7 @@ class App.UiElement.tag @render: (attribute) -> item = $( App.view('generic/input')( attribute: attribute ) ) - a = => + a = -> $('#' + attribute.id ).tokenfield() $('#' + attribute.id ).parent().css('height', 'auto') App.Delay.set( a, 120, undefined, 'tags' ) diff --git a/app/assets/javascripts/app/controllers/_ui_element/textarea.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/textarea.js.coffee index 1aa186930..f5d921294 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/textarea.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/textarea.js.coffee @@ -3,7 +3,7 @@ class App.UiElement.textarea fileUploaderId = 'file-uploader-' + new Date().getTime() + '-' + Math.floor( Math.random() * 99999 ) item = $( App.view('generic/textarea')( attribute: attribute ) + '
' ) - a = => + a = -> visible = $( item[0] ).is(":visible") if visible && !$( item[0] ).expanding('active') $( item[0] ).expanding() diff --git a/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.js.coffee index 0c73fbd31..15daa9334 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.js.coffee @@ -30,7 +30,7 @@ class App.UiElement.ticket_perform_action item.find('.js-attributeSelector').prepend(selector) # add filter - item.find('.js-add').bind('click', (e) => + item.find('.js-add').bind('click', (e) -> element = $(e.target).closest('.js-filterElement') elementClone = element.clone(true) element.after(elementClone) diff --git a/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.js.coffee index c8b907fba..b5a3f1e51 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.js.coffee @@ -130,14 +130,14 @@ class App.UiElement.ticket_selector item.find('.js-filterElement').first().remove() # bind for preview - item.on('change', 'select.form-control', (e) => + item.on('change', 'select.form-control', (e) -> App.Delay.set( search, 600, 'preview', ) ) - item.on('change keyup', 'input.form-control', (e) => + item.on('change keyup', 'input.form-control', (e) -> App.Delay.set( search, 600, @@ -162,7 +162,7 @@ class App.UiElement.ticket_selector @ticketTable(data.ticket_ids, data.ticket_count, item) ) - @ticketTable: (ticket_ids, ticket_count, item) => + @ticketTable: (ticket_ids, ticket_count, item) -> item.find('.js-previewCounter').html(ticket_count) new App.TicketList( el: item.find('.js-previewTable') 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 7397f770e..ac5169023 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -117,7 +117,7 @@ class App.TicketCreate extends App.Controller return false if !diff || _.isEmpty( diff ) return true - release: => + release: -> # nothing autosave: => @@ -522,7 +522,7 @@ class Sidebar extends App.Controller objects: 'Organizations' container: @el.closest('.content') ) - showOrganization = (el) => + showOrganization = (el) -> new App.WidgetOrganization( el: el organization_id: user.organization_id @@ -542,7 +542,7 @@ class Sidebar extends App.Controller callback: showOrganization } - showTemplates = (el) => + showTemplates = (el) -> # show template UI new App.WidgetTemplate( diff --git a/app/assets/javascripts/app/controllers/dashboard.js.coffee b/app/assets/javascripts/app/controllers/dashboard.js.coffee index 0ec7c24a2..57e0e9e9f 100644 --- a/app/assets/javascripts/app/controllers/dashboard.js.coffee +++ b/app/assets/javascripts/app/controllers/dashboard.js.coffee @@ -46,7 +46,7 @@ class App.Dashboard extends App.Controller isActive: => @activeState - url: => + url: -> '#dashboard' show: (params) => @@ -57,13 +57,13 @@ class App.Dashboard extends App.Controller # highlight navbar @navupdate '#dashboard' - hide: => + hide: -> # no - changed: => + changed: -> false - release: => + release: -> # no toggle: (e) => diff --git a/app/assets/javascripts/app/controllers/getting_started.js.coffee b/app/assets/javascripts/app/controllers/getting_started.js.coffee index da18471c5..41bb873aa 100644 --- a/app/assets/javascripts/app/controllers/getting_started.js.coffee +++ b/app/assets/javascripts/app/controllers/getting_started.js.coffee @@ -219,7 +219,7 @@ class Admin extends App.ControllerContent username: @params.email password: @params.password success: @relogin - error: => + error: -> App.Event.trigger 'notify', { type: 'error' msg: App.i18n.translateContent( 'Signin failed! Please contact the support team!' ) @@ -874,9 +874,9 @@ class ChannelEmail extends App.Wizard @navigate 'getting_started/agents' else if data.source is 'inbound' || data.source is 'outbound' - @showSlide("js-#{data.source}") - @showAlert("js-#{data.source}", data.message_human || data.message ) - @showInvalidField("js-#{data.source}", data.invalid_field) + @showSlide("js-#{data.source}") + @showAlert("js-#{data.source}", data.message_human || data.message ) + @showInvalidField("js-#{data.source}", data.invalid_field) else if count is 2 @showAlert('js-verify', data.message_human || data.message ) diff --git a/app/assets/javascripts/app/controllers/navigation.js.coffee b/app/assets/javascripts/app/controllers/navigation.js.coffee index 6122fab89..d9a712ad8 100644 --- a/app/assets/javascripts/app/controllers/navigation.js.coffee +++ b/app/assets/javascripts/app/controllers/navigation.js.coffee @@ -45,14 +45,14 @@ class App.Navigation extends App.ControllerWidgetPermanent # get open tabs to repopen on rerender open_tab = {} - @$('.open').children('a').each( (i,d) => + @$('.open').children('a').each( (i,d) -> href = $(d).attr('href') open_tab[href] = true ) # get active tabs to reactivate on rerender active_tab = {} - @$('.active').children('a').each( (i,d) => + @$('.active').children('a').each( (i,d) -> href = $(d).attr('href') active_tab[href] = true ) @@ -68,14 +68,14 @@ class App.Navigation extends App.ControllerWidgetPermanent # get open tabs to repopen on rerender open_tab = {} - @$('.open').children('a').each( (i,d) => + @$('.open').children('a').each( (i,d) -> href = $(d).attr('href') open_tab[href] = true ) # get active tabs to reactivate on rerender active_tab = {} - @$('.active').children('a').each( (i,d) => + @$('.active').children('a').each( (i,d) -> href = $(d).attr('href') active_tab[href] = true ) @@ -176,7 +176,7 @@ class App.Navigation extends App.ControllerWidgetPermanent @renderResult(result) - @$('#global-search-result').on('click', 'a', => + @$('#global-search-result').on('click', 'a', -> close() ) ) @@ -222,7 +222,7 @@ class App.Navigation extends App.ControllerWidgetPermanent ) # prevent submit of search box - @$('form.search').on( 'submit', (e) => + @$('form.search').on( 'submit', (e) -> e.preventDefault() ) @@ -246,7 +246,7 @@ class App.Navigation extends App.ControllerWidgetPermanent # bind to empty search @$('.empty-search').on( 'click' - => + -> emptyAndClose() ) @@ -347,10 +347,10 @@ class App.Navigation extends App.ControllerWidgetPermanent return(a-b) addPrioCount: (newlist, item) -> - if newlist[ item['prio'] ] - item['prio']++ - if newlist[ item['prio'] ] - @addPrioCount newlist, item + if newlist[ item['prio'] ] + item['prio']++ + if newlist[ item['prio'] ] + @addPrioCount newlist, item update: (url) => @$('li').removeClass('active') diff --git a/app/assets/javascripts/app/controllers/organization_profile.js.coffee b/app/assets/javascripts/app/controllers/organization_profile.js.coffee index 390ed6b66..71acd346c 100644 --- a/app/assets/javascripts/app/controllers/organization_profile.js.coffee +++ b/app/assets/javascripts/app/controllers/organization_profile.js.coffee @@ -36,7 +36,7 @@ class App.OrganizationProfile extends App.Controller App.OnlineNotification.seen( 'Organization', @organization_id ) @navupdate '#' - changed: => + changed: -> false render: (organization) => @@ -107,7 +107,7 @@ class Object extends App.Controller }) # start action controller - showHistory = => + showHistory = -> new App.OrganizationHistory( organization_id: organization.id ) editOrganization = => new App.ControllerGenericEdit( diff --git a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee index 0ef5a7f0b..04104148f 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee @@ -60,10 +60,10 @@ class App.TicketOverview extends App.Controller if @navBarController @navBarController.active(false) - changed: => + changed: -> false - release: => + release: -> # no overview: (overview_id) => @@ -243,18 +243,18 @@ class Table extends App.Controller show: true ) @navigate ticket.uiUrl() - callbackTicketTitleAdd = (value, object, attribute, attributes, refObject) => + callbackTicketTitleAdd = (value, object, attribute, attributes, refObject) -> attribute.title = object.title value - callbackLinkToTicket = (value, object, attribute, attributes, refObject) => + callbackLinkToTicket = (value, object, attribute, attributes, refObject) -> attribute.link = object.uiUrl() value - callbackUserPopover = (value, object, attribute, attributes, refObject) => + callbackUserPopover = (value, object, attribute, attributes, refObject) -> attribute.class = 'user-popover' attribute.data = id: refObject.id value - callbackOrganizationPopover = (value, object, attribute, attributes, refObject) => + callbackOrganizationPopover = (value, object, attribute, attributes, refObject) -> attribute.class = 'organization-popover' attribute.data = id: refObject.id @@ -324,7 +324,7 @@ class Table extends App.Controller # start bulk action observ @el.find('.bulkAction').append( @bulk_form() ) if @el.find('.table-overview').find('input[name="bulk"]:checked').length isnt 0 - @el.find('.bulkAction').removeClass('hide') + @el.find('.bulkAction').removeClass('hide') # show/hide bulk action @el.find('.table-overview').delegate('input[name="bulk"], input[name="bulk_all"]', 'click', (e) => @@ -342,7 +342,7 @@ class Table extends App.Controller ) # deselect bulk_all if one item is uncheck observ - @el.find('.table-overview').delegate('[name="bulk"]', 'click', (e) => + @el.find('.table-overview').delegate('[name="bulk"]', 'click', (e) -> if !$(e.target).attr('checked') $(e.target).parents().find('[name="bulk_all"]').attr('checked', false) ) @@ -370,7 +370,7 @@ class Table extends App.Controller @fetch() #@render() - articleTypeFilter = (items) => + articleTypeFilter = (items) -> for item in items if item.name is 'note' return [item] @@ -436,7 +436,7 @@ class Table extends App.Controller @ticketIDs bulkSetSelected: (ticketIDs) -> - @el.find('.table-overview').find('[name="bulk"]').each( (index, element) => + @el.find('.table-overview').find('[name="bulk"]').each( (index, element) -> ticket_id = $(element).val() for ticket_id_selected in ticketIDs if ticket_id_selected is ticket_id diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 12c3847f0..6b5e31055 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -378,7 +378,7 @@ class App.TicketZoom extends App.Controller autosaveStop: => @autosaveLast = {} - @clearInterval( 'autosave' ) + @clearInterval('autosave') autosaveStart: => if !@autosaveLast @@ -410,15 +410,15 @@ class App.TicketZoom extends App.Controller #console.log('modelDiff', modelDiff) # get diff of last save - changedBetweenLastSave = _.isEqual(currentParams, @autosaveLast ) + changedBetweenLastSave = _.isEqual(currentParams, @autosaveLast) if !changedBetweenLastSave #console.log('model DIFF ', modelDiff) @autosaveLast = clone(currentParams) - @markFormDiff( modelDiff ) + @markFormDiff(modelDiff) - @taskUpdateAll( modelDiff ) - @interval( update, 2400, 'autosave' ) + @taskUpdateAll(modelDiff) + @interval(update, 2400, 'autosave') markFormDiff: (diff = {}) => ticketForm = @$('.edit') @@ -593,7 +593,7 @@ class App.TicketZoom extends App.Controller @fetch( ticket.id, true ) ) - bookmark: (e) => + bookmark: (e) -> $(e.currentTarget).find('.bookmark.icon').toggleClass('filled') reset: (e) => diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.js.coffee index 79f730ce5..5b7461f16 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.js.coffee @@ -74,9 +74,9 @@ class App.TicketZoomArticleActions extends App.Controller recipients = [] if article.sender.name is 'Agent' if article.to - localRecipients = emailAddresses.parseAddressList(article.to) - if localRecipients - recipients = recipients.concat localRecipients + localRecipients = emailAddresses.parseAddressList(article.to) + if localRecipients + recipients = recipients.concat localRecipients else if article.from localRecipients = emailAddresses.parseAddressList(article.from) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_view.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_view.js.coffee index 798ec1755..601bd549c 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_view.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_view.js.coffee @@ -270,7 +270,7 @@ class ArticleViewItem extends App.Controller height: bubbleContent.attr('data-height') options: duration: 300 - complete: -> bubbleOvervlowContainer.addClass('hide'); + complete: -> bubbleOvervlowContainer.addClass('hide') isOrContains: (node, container) -> while node diff --git a/app/assets/javascripts/app/controllers/translation.js.coffee b/app/assets/javascripts/app/controllers/translation.js.coffee index 50e2779d7..9cca9a624 100644 --- a/app/assets/javascripts/app/controllers/translation.js.coffee +++ b/app/assets/javascripts/app/controllers/translation.js.coffee @@ -106,9 +106,9 @@ class Index extends App.ControllerContent ) hide = => - @hideAction() App.Event.trigger('i18n:translation_todo_reload') App.Event.trigger('i18n:translation_list_reload') + @hideAction() @loader.hide(1) locales = App.Locale.all() @@ -201,7 +201,7 @@ class TranslationToDo extends App.Controller url: @apiPath + '/translations' data: JSON.stringify(params) processData: false - success: (data, status, xhr) => + success: (data, status, xhr) -> App.Event.trigger('i18n:translation_list_reload') ) @@ -235,7 +235,7 @@ class TranslationToDo extends App.Controller url: @apiPath + '/translations' data: JSON.stringify(params) processData: false - success: (data, status, xhr) => + success: (data, status, xhr) -> App.Event.trigger('i18n:translation_list_reload') ) @@ -389,4 +389,4 @@ class TranslationList extends App.Controller reset.hide() reset.closest('tr').removeClass('warning') -App.Config.set( 'Translation', { prio: 1800, parent: '#system', name: 'Translations', target: '#system/translation', controller: Index, role: ['Admin'] }, 'NavBarAdmin' ) \ No newline at end of file +App.Config.set( 'Translation', { prio: 1800, parent: '#system', name: 'Translations', target: '#system/translation', controller: Index, role: ['Admin'] }, 'NavBarAdmin' ) diff --git a/app/assets/javascripts/app/controllers/user_profile.js.coffee b/app/assets/javascripts/app/controllers/user_profile.js.coffee index f5826e88b..775cce35d 100644 --- a/app/assets/javascripts/app/controllers/user_profile.js.coffee +++ b/app/assets/javascripts/app/controllers/user_profile.js.coffee @@ -38,7 +38,7 @@ class App.UserProfile extends App.Controller App.OnlineNotification.seen( 'User', @user_id ) @navupdate '#' - changed: => + changed: -> false render: (user) => @@ -110,7 +110,7 @@ class Object extends App.Controller }) # start action controller - showHistory = => + showHistory = -> new App.UserHistory( user_id: user.id ) editUser = => diff --git a/app/assets/javascripts/app/controllers/widget/notify.js.coffee b/app/assets/javascripts/app/controllers/widget/notify.js.coffee index 0b4562f07..3942bb6d4 100644 --- a/app/assets/javascripts/app/controllers/widget/notify.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/notify.js.coffee @@ -12,7 +12,7 @@ class App.Notify extends App.ControllerWidgetPermanent @log 'notify:removeall', @ @destroyAll() - @bind 'notifyDesktop', (data) => + @bind 'notifyDesktop', (data) -> if !data['icon'] data['icon'] = 'unknown' notify.createNotification( data.msg, data ) diff --git a/app/assets/javascripts/app/controllers/widget/ticket_list.js.coffee b/app/assets/javascripts/app/controllers/widget/ticket_list.js.coffee index 123a6d3c7..3ef107f66 100644 --- a/app/assets/javascripts/app/controllers/widget/ticket_list.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/ticket_list.js.coffee @@ -6,15 +6,15 @@ class App.TicketList extends App.Controller render: => - callbackTicketTitleAdd = (value, object, attribute, attributes, refObject) => + callbackTicketTitleAdd = (value, object, attribute, attributes, refObject) -> attribute.title = object.title value - callbackUserPopover = (value, object, attribute, attributes, refObject) => + callbackUserPopover = (value, object, attribute, attributes, refObject) -> attribute.class = 'user-popover' attribute.data = id: refObject.id value - callbackOrganizationPopover = (value, object, attribute, attributes, refObject) => + callbackOrganizationPopover = (value, object, attribute, attributes, refObject) -> attribute.class = 'organization-popover' attribute.data = id: refObject.id diff --git a/app/assets/javascripts/app/lib/app_init/log.js.coffee b/app/assets/javascripts/app/lib/app_init/log.js.coffee index 8073e99db..9983d6e4a 100644 --- a/app/assets/javascripts/app/lib/app_init/log.js.coffee +++ b/app/assets/javascripts/app/lib/app_init/log.js.coffee @@ -95,7 +95,7 @@ class _Singleton if !@moduleColorsMap[module] @moduleColorsMap[module]= @yieldColor() color = @moduleColorsMap[module] - colorString = "color: hsl(" + (color) + ",99%,40%); font-weight: bold"; + colorString = "color: hsl(" + (color) + ",99%,40%); font-weight: bold" logArgs = [prefix, colorString].concat(args) else logArgs = [prefix].concat(args) diff --git a/app/assets/javascripts/app/lib/app_post/audio.js.coffee b/app/assets/javascripts/app/lib/app_post/audio.js.coffee index 18df30b58..3d2e1fdaf 100644 --- a/app/assets/javascripts/app/lib/app_post/audio.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/audio.js.coffee @@ -6,7 +6,7 @@ class App.Audio canPlay = audio.canPlayType('audio/mp3') return if canPlay isnt 'maybe' and canPlay isnt 'probably' $(audio).prop( 'src', url ) - audio.load(); - audio.preload = "auto"; - audio.volume = volume; + audio.load() + audio.preload = 'auto' + audio.volume = volume audio.play() diff --git a/app/assets/javascripts/app/lib/app_post/auth.js.coffee b/app/assets/javascripts/app/lib/app_post/auth.js.coffee index 751288a58..e615da150 100644 --- a/app/assets/javascripts/app/lib/app_post/auth.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/auth.js.coffee @@ -88,7 +88,7 @@ class App.Auth App.Event.trigger( 'auth:logout' ) App.Event.trigger( 'ui:rerender' ) - return false; + return false # clear local store if type isnt 'check' diff --git a/app/assets/javascripts/app/lib/app_post/clipboard.js.coffee b/app/assets/javascripts/app/lib/app_post/clipboard.js.coffee index df246a2f6..47d2a2678 100644 --- a/app/assets/javascripts/app/lib/app_post/clipboard.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/clipboard.js.coffee @@ -62,7 +62,7 @@ class _Singleton # get cross browser selected string _getSelected: -> - text = ''; + text = '' if window.getSelection text = window.getSelection() else if document.getSelection diff --git a/app/assets/javascripts/app/lib/app_post/collection.js.coffee b/app/assets/javascripts/app/lib/app_post/collection.js.coffee index 70cf042a8..9ca84fad6 100644 --- a/app/assets/javascripts/app/lib/app_post/collection.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/collection.js.coffee @@ -61,10 +61,10 @@ class _collectionSingleton extends Spine.Module @load( data ) resetCollections: (data) -> - # load assets - for type, collection of data - @log 'debug', 'resetCollection:trigger', type, collection - @reset( localStorage: data.localStorage, type: type, data: collection ) + # load assets + for type, collection of data + @log 'debug', 'resetCollection:trigger', type, collection + @reset( localStorage: data.localStorage, type: type, data: collection ) reset: (params) -> diff --git a/app/assets/javascripts/app/lib/app_post/image_service.js.coffee b/app/assets/javascripts/app/lib/app_post/image_service.js.coffee index b0a685049..4c638e94a 100644 --- a/app/assets/javascripts/app/lib/app_post/image_service.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/image_service.js.coffee @@ -12,11 +12,11 @@ class App.ImageService else @resize( dataURL, x, y, 2, 'image/png', 0.7, callback ) - @resize: ( dataURL, x = 'auto', y = 'auto', sizeFactor = 1, type, quallity, callback) => + @resize: ( dataURL, x = 'auto', y = 'auto', sizeFactor = 1, type, quallity, callback) -> # load image from data url imageObject = new Image() - imageObject.onload = => + imageObject.onload = -> imageWidth = imageObject.width imageHeight = imageObject.height if y is 'auto' && x is 'auto' diff --git a/app/assets/javascripts/app/lib/app_post/pretty_date.js.coffee b/app/assets/javascripts/app/lib/app_post/pretty_date.js.coffee index a39e6ad25..988abe815 100644 --- a/app/assets/javascripts/app/lib/app_post/pretty_date.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/pretty_date.js.coffee @@ -1,7 +1,7 @@ class App.PrettyDate # human readable time - @humanTime: ( time, escalation, long = true ) => + @humanTime: ( time, escalation, long = true ) -> return '' if !time current = new Date() created = new Date(time) diff --git a/app/assets/javascripts/app/lib/app_post/utils.js.coffee b/app/assets/javascripts/app/lib/app_post/utils.js.coffee index 8e2ad5eb1..b302b3b6f 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.js.coffee @@ -84,7 +84,7 @@ class App.Utils ascii = @textCleanup(ascii) ascii = @wrap(ascii, max) $.trim( ascii ) - .replace /^(.*)$/mg, (match) => + .replace /^(.*)$/mg, (match) -> if match '> ' + match else @@ -538,7 +538,7 @@ class App.Utils false # human readable file size - @humanFileSize: (size) => + @humanFileSize: (size) -> if size > ( 1024 * 1024 ) size = Math.round( size / ( 1024 * 1024 ) ) + ' MB' else if size > 1024 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 7f40dafdb..7cca34ed6 100644 --- a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee @@ -276,31 +276,31 @@ class _webSocketSingleton extends App.Controller _receiveMessage: (data = []) => - # go through all blocks - for item in data + # go through all blocks + for item in data - # set timestamp to get spool messages later - if item['spool'] - @lastSpoolMessage = Math.round( +new Date()/1000 ) + # set timestamp to get spool messages later + if item['spool'] + @lastSpoolMessage = Math.round( +new Date()/1000 ) - # reset reconnect loop - if item['action'] is 'pong' - @pong() + # reset reconnect loop + if item['action'] is 'pong' + @pong() - # fill collection - if item['collection'] - @log 'debug', "onmessage collection:" + item['collection'] - App.Store.write( item['collection'], item['data'] ) + # fill collection + if item['collection'] + @log 'debug', "onmessage collection:" + item['collection'] + App.Store.write( item['collection'], item['data'] ) - # fire event - if item['event'] - if typeof item['event'] is 'object' - for event in item['event'] - @log 'debug', "onmessage event:" + event - App.Event.trigger( event, item['data'] ) - else - @log 'debug', "onmessage event:" + item['event'] - App.Event.trigger( item['event'], item['data'] ) + # fire event + if item['event'] + if typeof item['event'] is 'object' + for event in item['event'] + @log 'debug', "onmessage event:" + event + App.Event.trigger( event, item['data'] ) + else + @log 'debug', "onmessage event:" + item['event'] + App.Event.trigger( item['event'], item['data'] ) _ajaxInit: (data = {}) => diff --git a/app/assets/javascripts/app/models/_application_model.js.coffee b/app/assets/javascripts/app/models/_application_model.js.coffee index 784ac3e1e..f1a6f6fed 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -30,7 +30,7 @@ class App.Model extends Spine.Model name = @firstname if @lastname if name - name = name + ' ' + name = name + ' ' name = name + @lastname return name if @email @@ -47,7 +47,7 @@ class App.Model extends Spine.Model name = @firstname if @lastname if name - name = name + ' ' + name = name + ' ' name = name + @lastname if @organization if typeof @organization is 'object' @@ -290,7 +290,7 @@ class App.Model extends Spine.Model if _.isEmpty @FULL_CALLBACK[ data.id ] delete @FULL_CALLBACK[ data.id ] - error: (xhr, statusText, error) => + error: (xhr, statusText, error) -> console.log(statusText, error) ) subscribeId @@ -518,7 +518,7 @@ class App.Model extends Spine.Model # execute callbacks callback(data.stream) - error: (xhr, statusText, error) => + error: (xhr, statusText, error) -> console.log(statusText, error) )