Applied coffeelint.

This commit is contained in:
Martin Edenhofer 2015-09-21 23:24:19 +02:00
parent e11a4f59f9
commit 85515e61be
9 changed files with 74 additions and 71 deletions

View file

@ -1,4 +1,4 @@
class App.clickCatcher extends Spine.Controller
class App.ClickCatcher extends Spine.Controller
# clickCatcher has no template because it's a plain <div>
className: 'clickCatcher'

View file

@ -267,7 +267,7 @@ class LayoutRefCommunicationReply extends App.ControllerContent
duration: duration
add_textarea_catcher: ->
@textareaCatcher = new App.clickCatcher
@textareaCatcher = new App.ClickCatcher
holder: @articleNewEdit.offsetParent()
callback: @close_textarea
zIndexScale: 4
@ -353,7 +353,7 @@ class LayoutRefCommunicationReply extends App.ControllerContent
# console.log "working of", file, "from", @uploadQueue
@fakeUpload file.name, file.size, @workOfUploadQueue
humanFileSize: (size) =>
humanFileSize: (size) ->
i = Math.floor( Math.log(size) / Math.log(1024) )
return ( size / Math.pow(1024, i) ).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]
@ -431,10 +431,10 @@ class ModalForm extends App.ControllerModal
@show()
onHide: =>
onHide: ->
window.history.back()
onSubmit: (e) =>
onSubmit: (e) ->
e.preventDefault()
params = App.ControllerForm.params( $(e.target).closest('form') )
console.log('params', params)
@ -452,7 +452,7 @@ class ModalText extends App.ControllerModal
render: ->
@show( App.view('layout_ref/content')() )
onHide: =>
onHide: ->
window.history.back()
App.Config.set( 'layout_ref/modal_text', ModalText, 'Routes' )
@ -755,7 +755,7 @@ class LocalModalRef extends App.ControllerContent
App.Config.set( 'layout_ref/local_modal', LocalModalRef, 'Routes' )
class loadingPlaceholderRef extends App.ControllerContent
class LoadingPlaceholderRef extends App.ControllerContent
constructor: ->
super
@ -764,9 +764,9 @@ class loadingPlaceholderRef extends App.ControllerContent
render: ->
@html App.view('layout_ref/loading_placeholder')()
App.Config.set( 'layout_ref/loading_placeholder', loadingPlaceholderRef, 'Routes' )
App.Config.set( 'layout_ref/loading_placeholder', LoadingPlaceholderRef, 'Routes' )
class insufficientRightsRef extends App.ControllerContent
class InsufficientRightsRef extends App.ControllerContent
constructor: ->
super
@ -775,10 +775,10 @@ class insufficientRightsRef extends App.ControllerContent
render: ->
@html App.view('layout_ref/insufficient_rights')()
App.Config.set( 'layout_ref/insufficient_rights', insufficientRightsRef, 'Routes' )
App.Config.set( 'layout_ref/insufficient_rights', InsufficientRightsRef, 'Routes' )
class errorRef extends App.ControllerContent
class ErrorRef extends App.ControllerContent
constructor: ->
super
@ -787,10 +787,10 @@ class errorRef extends App.ControllerContent
render: ->
@html App.view('layout_ref/error')()
App.Config.set( 'layout_ref/error', errorRef, 'Routes' )
App.Config.set( 'layout_ref/error', ErrorRef, 'Routes' )
class highlightRef extends App.ControllerContent
class HighlightRef extends App.ControllerContent
elements:
'.article-text': 'articles'
'.js-highlight-icon': 'highlightIcon'
@ -939,10 +939,10 @@ class highlightRef extends App.ControllerContent
@storeHighlights()
App.Config.set( 'layout_ref/highlight', highlightRef, 'Routes' )
App.Config.set( 'layout_ref/highlight', HighlightRef, 'Routes' )
class cluesRef extends App.ControllerContent
class CluesRef extends App.ControllerContent
clues: [
{
@ -1257,10 +1257,10 @@ class cluesRef extends App.ControllerContent
when 'click' then target.trigger('click')
when 'hover' then target.toggleClass('is-hovered')
App.Config.set( 'layout_ref/clues', cluesRef, 'Routes' )
App.Config.set( 'layout_ref/clues', CluesRef, 'Routes' )
class adminPlaceholderRef extends App.ControllerContent
class AdminPlaceholderRef extends App.ControllerContent
constructor: ->
super
@ -1269,9 +1269,9 @@ class adminPlaceholderRef extends App.ControllerContent
render: ->
@html App.view('layout_ref/admin_placeholder')()
App.Config.set( 'layout_ref/admin_placeholder', adminPlaceholderRef, 'Routes' )
App.Config.set( 'layout_ref/admin_placeholder', AdminPlaceholderRef, 'Routes' )
class userListRef extends App.ControllerContent
class UserListRef extends App.ControllerContent
constructor: ->
super
@ -1280,10 +1280,10 @@ class userListRef extends App.ControllerContent
render: ->
@html App.view('layout_ref/user_list')()
App.Config.set( 'layout_ref/user_list', userListRef, 'Routes' )
App.Config.set( 'layout_ref/user_list', UserListRef, 'Routes' )
class slaRef extends App.ControllerContent
class SlaRef extends App.ControllerContent
events:
'click .js-activateColumn': 'activateColumn'
@ -1303,7 +1303,7 @@ class slaRef extends App.ControllerContent
selectTimezone: (e) =>
@$('.js-timezone').text e.currentTarget.value
toggle: (e) =>
toggle: (e) ->
entry = $(e.currentTarget).closest('.action')
isInactive = entry.hasClass('is-inactive')
entry.toggleClass('is-inactive')
@ -1335,10 +1335,10 @@ class slaRef extends App.ControllerContent
@$('.js-time').timepicker
showMeridian: true # meridian = am/pm
App.Config.set( 'layout_ref/sla', slaRef, 'Routes' )
App.Config.set( 'layout_ref/sla', SlaRef, 'Routes' )
class schedulersRef extends App.ControllerContent
class SchedulersRef extends App.ControllerContent
events:
'click .select-value': 'select'
'click [data-type=new]': 'createNew'
@ -1351,7 +1351,7 @@ class schedulersRef extends App.ControllerContent
render: ->
@html App.view('layout_ref/schedulers')()
toggle: (e) =>
toggle: (e) ->
entry = $(e.currentTarget).closest('.action')
isInactive = entry.hasClass('is-inactive')
entry.toggleClass('is-inactive')
@ -1415,7 +1415,7 @@ class schedulersRef extends App.ControllerContent
else
return "#{ items.slice(0, -1).join(', ') } and #{ items[items.length-1] }"
App.Config.set( 'layout_ref/schedulers', schedulersRef, 'Routes' )
App.Config.set( 'layout_ref/schedulers', SchedulersRef, 'Routes' )
class InputsRef extends App.ControllerContent
@ -1457,7 +1457,7 @@ class InputsRef extends App.ControllerContent
App.Config.set( 'layout_ref/inputs', InputsRef, 'Routes' )
class calendarSubscriptionsRef extends App.ControllerContent
class CalendarSubscriptionsRef extends App.ControllerContent
elements:
'input[type=checkbox]': 'options'
@ -1530,7 +1530,7 @@ class calendarSubscriptionsRef extends App.ControllerContent
return "#{ items.slice(0, -1).join(', ') } and #{ items[items.length-1] }"
App.Config.set( 'layout_ref/calendar_subscriptions', calendarSubscriptionsRef, 'Routes' )
App.Config.set( 'layout_ref/calendar_subscriptions', CalendarSubscriptionsRef, 'Routes' )
class ButtonsRef extends App.ControllerContent
@ -1544,7 +1544,7 @@ class ButtonsRef extends App.ControllerContent
App.Config.set( 'layout_ref/buttons', ButtonsRef, 'Routes' )
class mergeCustomerRef extends App.ControllerContent
class MergeCustomerRef extends App.ControllerContent
mergeTarget:
firstname: 'Nicole',
@ -1591,7 +1591,7 @@ class mergeCustomerRef extends App.ControllerContent
onChange: ->
App.Config.set( 'layout_ref/merge_customer', mergeCustomerRef, 'Routes' )
App.Config.set( 'layout_ref/merge_customer', MergeCustomerRef, 'Routes' )
class PrimaryEmailRef extends App.ControllerContent

View file

@ -54,10 +54,15 @@ class App.TicketZoomArticleNew extends App.Controller
attributes: []
},
{
name: 'twitter'
name: 'twitter status'
icon: 'twitter'
attributes: []
},
{
name: 'twitter direct-message'
icon: 'twitter'
attributes: ['to']
},
{
name: 'phone'
icon: 'phone'
@ -213,7 +218,7 @@ class App.TicketZoomArticleNew extends App.Controller
data:
ticket: ticket
)
callback = (ticket) =>
callback = (ticket) ->
textModule.reload(
ticket: ticket
)
@ -256,7 +261,7 @@ class App.TicketZoomArticleNew extends App.Controller
speed: 300
easing: [ 0.34, 1.61, 0.7, 1 ]
@pickRecipientsCatcher = new App.clickCatcher
@pickRecipientsCatcher = new App.ClickCatcher
holder: @el.offsetParent()
callback: @hide_recipients
zIndexScale: 6
@ -304,7 +309,7 @@ class App.TicketZoomArticleNew extends App.Controller
showSelectableArticleType: =>
@el.find('.js-articleTypes').removeClass('is-hidden')
@selectTypeCatcher = new App.clickCatcher
@selectTypeCatcher = new App.ClickCatcher
holder: @el.offsetParent()
callback: @hideSelectableArticleType
zIndexScale: 6
@ -325,7 +330,7 @@ class App.TicketZoomArticleNew extends App.Controller
@type = type
@$('[name="type"]').val(type)
@articleNewEdit.attr('data-type', type)
typeIcon.find('use').attr 'xlink:href', '#icon-'+ @type
typeIcon.find('use').attr 'xlink:href', "#icon-#{@type}"
# show/hide attributes
for articleType in @articleTypes
@ -419,7 +424,7 @@ class App.TicketZoomArticleNew extends App.Controller
addTextareaCatcher: =>
if @articleNewEdit.is(':visible')
@textareaCatcher = new App.clickCatcher
@textareaCatcher = new App.ClickCatcher
holder: @articleNewEdit.offsetParent()
callback: @closeTextarea
zIndexScale: 4
@ -471,7 +476,7 @@ class App.TicketZoomArticleNew extends App.Controller
duration: 100
stagger: 50
drag: true
complete: (elements) => $(elements).addClass('is-hidden')
complete: (elements) -> $(elements).addClass('is-hidden')
onDragenter: (event) =>
# on the first event,
@ -508,7 +513,6 @@ class App.TicketZoomArticleNew extends App.Controller
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

View file

@ -9,7 +9,7 @@ class App.TicketZoomOverviewNavigator extends App.Controller
@bind 'ticket_overview_rebuild', (data) =>
execute = =>
@render()
@delay(execute, 600, 'overview-navigator')
@delay(execute, 1600, 'overview-navigator')
@render()

View file

@ -30,7 +30,6 @@ class App.TicketZoomSidebar extends App.Controller
el: el.find('.edit')
model: App.Ticket
screen: 'edit'
params: App.Ticket.find(ticket.id)
handlers: [
@ticketFormChanges
]
@ -44,7 +43,7 @@ class App.TicketZoomSidebar extends App.Controller
show(ticket)
@bind(
'ui::ticket::taskReset'
(data) =>
(data) ->
if data.ticket_id is ticket.id
show(ticket)
)
@ -120,7 +119,7 @@ class App.TicketZoomSidebar extends App.Controller
objects: 'Users'
container: @el.closest('.content')
)
showCustomer = (el) =>
showCustomer = (el) ->
new App.WidgetUser(
el: el
user_id: ticket.customer_id
@ -154,7 +153,7 @@ class App.TicketZoomSidebar extends App.Controller
objects: 'Organizations'
container: @el.closest('.content')
)
showOrganization = (el) =>
showOrganization = (el) ->
new App.WidgetOrganization(
el: el
organization_id: ticket.organization_id

View file

@ -109,7 +109,7 @@ class Widget extends App.ControllerWidgetPermanent
show: =>
@isShown = true
@el.find('#chat_toogle').html('&times;');
@el.find('#chat_toogle').html('&times;')
if @newMessage
@el.find('div.well').addClass('alert-success')
@delay( =>
@ -144,7 +144,7 @@ class Widget extends App.ControllerWidgetPermanent
@isShown = false
@el.find('#chat_content').hide(100)
@el.find('#chat_content').addClass('hide')
@el.find('#chat_toogle').html('&diams;');
@el.find('#chat_toogle').html('&diams;')
focusIn: =>
@focus = true

View file

@ -112,7 +112,7 @@ class App.OnlineNotificationWidget extends App.Controller
)
# add clickCatcher
@clickCatcher = new App.clickCatcher
@clickCatcher = new App.ClickCatcher
holder: @el.offsetParent()
callback: @hidePopover
zIndexScale: 4
@ -175,7 +175,7 @@ class App.OnlineNotificationWidget extends App.Controller
@updateContent()
@delay(
=> waitUntilOldPopoverIsRemoved()
-> waitUntilOldPopoverIsRemoved()
600
'popover'
)

View file

@ -23,7 +23,7 @@ class App.UserOrganizationAutocompletion extends App.Controller
open: =>
@clearDelay('close')
@el.addClass('open')
@catcher = new App.clickCatcher
@catcher = new App.ClickCatcher
holder: @el.offsetParent()
callback: @close
zIndexScale: 1
@ -59,7 +59,7 @@ class App.UserOrganizationAutocompletion extends App.Controller
if @callback
@callback(userId)
buildOrganizationItem: (organization) =>
buildOrganizationItem: (organization) ->
App.view('generic/user_search/item_organization')(
organization: organization
)
@ -72,12 +72,12 @@ class App.UserOrganizationAutocompletion extends App.Controller
user = App.User.fullLocal(userId)
organizationMemebers.append( @buildUserItem(user) )
buildUserItem: (user) =>
buildUserItem: (user) ->
App.view('generic/user_search/item_user')(
user: user
)
buildUserNew: =>
buildUserNew: ->
App.view('generic/user_search/new_user')()
build: =>

View file

@ -3,7 +3,7 @@ class App.EmailAddress extends App.Model
@extend Spine.Model.Ajax
@url: @apiPath + '/email_addresses'
@filterChannel: (options, type) =>
@filterChannel: (options, type) ->
return options if type isnt 'collection'
_.filter(
options