Applied coffee lint.

This commit is contained in:
Martin Edenhofer 2015-11-23 14:13:15 +01:00
parent df90a8f9d6
commit 8cefc82d8a
23 changed files with 83 additions and 81 deletions

View file

@ -555,10 +555,10 @@ class App.Controller extends Spine.Controller
renderScreenUnauthorized: (data) ->
@html App.view('generic/error/unauthorized')(data)
metaTaskUpdate: =>
metaTaskUpdate: ->
App.Delay.set(
-> App.Event.trigger 'task:render'
250
450
'meta-task-update'
)
@ -638,7 +638,7 @@ class App.ControllerModalNice extends App.Controller
@$('.modal-dialog').replaceWith(modal)
@post()
post: =>
post: ->
# nothing
render: =>

View file

@ -269,7 +269,7 @@ class App.ControllerGenericDestroyConfirm extends App.ControllerModalNice
buttonClass: 'btn--danger'
head: 'Confirm'
content: =>
content: ->
App.i18n.translateContent('Sure to delete this object?')
onSubmit: =>
@ -422,14 +422,14 @@ class App.ControllerNavSidbar extends App.ControllerContent
executeController: (selectedItem) =>
# in case of rerendering
if @activeController && @activeController.render
@activeController.render()
return
# in case of rerendering
if @activeController && @activeController.render
@activeController.render()
return
@activeController = new selectedItem.controller(
el: @$('.main')
)
@activeController = new selectedItem.controller(
el: @$('.main')
)
class App.GenericHistory extends App.ControllerModalNice
buttonClose: true

View file

@ -426,9 +426,9 @@ class App.ControllerTable extends App.Controller
@adjustHeaderWidths()
@tableHead.each (i, el) =>
el.style.width = @headers[i].displayWidth + "px"
el.style.width = @headers[i].displayWidth + 'px'
stopPropagation: (event) =>
stopPropagation: (event) ->
event.stopPropagation()
onColResizeMousedown: (event) =>

View file

@ -16,7 +16,7 @@ class Index extends App.ControllerContent
#@interval(@load, 60000)
#@load()
load: =>
load: ->
# @startLoading()
# @ajax(
# id: 'twitter_index'
@ -55,7 +55,7 @@ class Index extends App.ControllerContent
shown: true
button: 'Connect'
cancel: true
onSubmit: () =>
onSubmit: =>
@html App.view('twitter/list')()
modal.close()
@ -87,7 +87,7 @@ class Index extends App.ControllerContent
# large: true
# )
delete: (e) =>
delete: (e) ->
# e.preventDefault()
# id = $(e.target).closest('.action').data('id')
# item = App.Twitter.find(id)

View file

@ -156,7 +156,7 @@ class ImageCropper extends App.ControllerModalNice
'.imageCropper-image': 'image'
'.imageCropper-holder': 'holder'
content: =>
content: ->
App.view('profile/imageCropper')()
post: =>
@ -242,7 +242,7 @@ class Camera extends App.ControllerModalNice
events:
'click .js-shoot:not(.is-disabled)': 'onShootClick'
content: =>
content: ->
App.view('profile/camera')()
post: =>

View file

@ -16,10 +16,10 @@ class App.UiElement.date
# apply date widgets
$.fn.datepicker.dates['custom'] =
days: [App.i18n.translateInline('Sunday'), App.i18n.translateInline('Monday'), App.i18n.translateInline('Tuesday'), App.i18n.translateInline('Wednesday'), App.i18n.translateInline('Thursday'), App.i18n.translateInline('Friday'), App.i18n.translateInline('Saturday'), App.i18n.translateInline('Sunday')],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
daysMin: [App.i18n.translateInline('Su'), App.i18n.translateInline('Mo'), App.i18n.translateInline('Tu'), App.i18n.translateInline('We'), App.i18n.translateInline('Th'), App.i18n.translateInline('Fr'), App.i18n.translateInline('Sa'), App.i18n.translateInline('Su')],
months: [App.i18n.translateInline('January'), App.i18n.translateInline('February'), App.i18n.translateInline('March'), App.i18n.translateInline('April'), App.i18n.translateInline('May'), App.i18n.translateInline('June'), App.i18n.translateInline('July'), App.i18n.translateInline('August'), App.i18n.translateInline('September'), App.i18n.translateInline('October'), App.i18n.translateInline('November'), App.i18n.translateInline('December')],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
today: App.i18n.translateInline('today'),
clear: App.i18n.translateInline('clear')
currentDate = undefined

View file

@ -16,10 +16,10 @@ class App.UiElement.datetime
# apply date widgets
$.fn.datepicker.dates['custom'] =
days: [App.i18n.translateInline('Sunday'), App.i18n.translateInline('Monday'), App.i18n.translateInline('Tuesday'), App.i18n.translateInline('Wednesday'), App.i18n.translateInline('Thursday'), App.i18n.translateInline('Friday'), App.i18n.translateInline('Saturday'), App.i18n.translateInline('Sunday')],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
daysMin: [App.i18n.translateInline('Su'), App.i18n.translateInline('Mo'), App.i18n.translateInline('Tu'), App.i18n.translateInline('We'), App.i18n.translateInline('Th'), App.i18n.translateInline('Fr'), App.i18n.translateInline('Sa'), App.i18n.translateInline('Su')],
months: [App.i18n.translateInline('January'), App.i18n.translateInline('February'), App.i18n.translateInline('March'), App.i18n.translateInline('April'), App.i18n.translateInline('May'), App.i18n.translateInline('June'), App.i18n.translateInline('July'), App.i18n.translateInline('August'), App.i18n.translateInline('September'), App.i18n.translateInline('October'), App.i18n.translateInline('November'), App.i18n.translateInline('December')],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
today: App.i18n.translateInline('today'),
clear: App.i18n.translateInline('clear')
currentDate = undefined

View file

@ -18,7 +18,7 @@ class App.UiElement.textarea
if attribute.upload
# add file uploader
u = =>
u = ->
# only add upload item if html element exists
if $('#' + fileUploaderId )[0]

View file

@ -246,7 +246,7 @@ class App.UiElement.ticket_selector
elementRow.find('.js-value').addClass('hide')
toggle()
elementRow.find('.js-preCondition select').bind('change', (e) =>
elementRow.find('.js-preCondition select').bind('change', (e) ->
toggle()
)

View file

@ -136,7 +136,7 @@ class App.CustomerChat extends App.Controller
addChat: (session) ->
return if @chatWindows[session.session_id]
chat = new chatWindow
chat = new ChatWindow
name: "#{session.created_at}"
session: session
removeCallback: @removeChat
@ -183,7 +183,7 @@ class CustomerChatRouter extends App.ControllerPermanent
persistent: true
)
class chatWindow extends App.Controller
class ChatWindow extends App.Controller
@extend Spine.Events
className: 'chat-window'
@ -283,8 +283,8 @@ class chatWindow extends App.Controller
@resetUnreadMessages()
onKeydown: (event) =>
TABKEY = 9;
ENTERKEY = 13;
TABKEY = 9
ENTERKEY = 13
if event.keyCode isnt TABKEY && event.keyCode isnt ENTERKEY
App.WebSocket.send(

View file

@ -843,7 +843,7 @@ class TicketZoomRef extends App.ControllerContent
@$('.js-datepicker').datepicker
todayHighlight: true
startDate: new Date().toLocaleDateString("en-US") # returns 9/25/2015
startDate: new Date().toLocaleDateString('en-US') # returns 9/25/2015
container: @$('.js-datepicker').parent()
@$('.js-timepicker').timepicker()
@ -938,7 +938,7 @@ class TicketZoomRef extends App.ControllerContent
# selection.anchorNode = element in which the selection started
# selection.focusNode = element in which the selection ended
#
#
# check if the start node is inside of the article or the article itself
startNode = @$(selection.anchorNode)
@ -966,7 +966,7 @@ class TicketZoomRef extends App.ControllerContent
$(document).unbind 'click.buttonDropdown'
performTicketMacro: (event) =>
console.log "perform action", @$(event.currentTarget).text()
console.log 'perform action', @$(event.currentTarget).text()
@closeDropdown()
onActionMouseEnter: (event) =>
@ -1675,60 +1675,60 @@ class App.CustomerChatRef extends App.Controller
questions: [
{
question: "Der dümmste Bauer hat die dicksten ..?"
answers: ["Kartoffeln"]
question: 'Der dümmste Bauer hat die dicksten ..?'
answers: ['Kartoffeln']
},
{
question: "Welchen Wein besang einst Udo Jürgens?"
answers: ["griechisch"]
question: 'Welchen Wein besang einst Udo Jürgens?'
answers: ['griechisch']
},
{
question: "Was behandelt ein Logopäde?"
answers: ["Sprachstörung"]
question: 'Was behandelt ein Logopäde?'
answers: ['Sprachstörung']
},
{
question: "In welcher Stadt ist das Porsche Stammwerk?"
answers: ["Stuttgart"]
question: 'In welcher Stadt ist das Porsche Stammwerk?'
answers: ['Stuttgart']
},
{
question: "Wer erfand den legendären C64-Computer?"
answers: ["Commodore"]
question: 'Wer erfand den legendären C64-Computer?'
answers: ['Commodore']
},
{
question: 'Im Englischen steht "Lost And Found" für ..?'
answers: ["Fundbüro"]
answers: ['Fundbüro']
},
{
question: 'Welches Möbelstück ist und war besonders in Sigmund Freuds Arbeitszimmer bekannt?'
answers: ["Couch"]
answers: ['Couch']
},
{
question: 'Wenn es einem gut geht, lebt man "wie die Made im .."?'
answers: ["Speck"]
answers: ['Speck']
},
{
question: 'Von welcher Sportart handelt der US-amerikanische Film "Rocky"?'
answers: ["Boxen"]
answers: ['Boxen']
},
{
question: 'Wo soll man hingehen, wenn man sich weit entfernen soll? Dahin wo ..?'
answers: ["Pfeffer", "wächst"]
answers: ['Pfeffer', 'wächst']
},
{
question: 'Welches internationale Autokennzeichen hat Spanien?'
answers: ["ES"]
answers: ['ES']
},
{
question: 'Wenn man sich ärgert sagt man "Verdammt und .."?'
answers: ["zugenäht"]
answers: ['zugenäht']
},
{
question: 'Bei welchem Spiel muss man ohne zu zittern Stäbchen sammeln?'
answers: ["Mikado"]
answers: ['Mikado']
},
{
question: 'Wann wurde Znuny gegründet?'
answers: ["2012"]
answers: ['2012']
}
]
@ -1741,7 +1741,7 @@ class App.CustomerChatRef extends App.Controller
@answered = 0
@correct = 0
@wrong = 0
@maxChats = 4;
@maxChats = 4
@render()
@ -1772,7 +1772,7 @@ class App.CustomerChatRef extends App.Controller
counter: =>
@randomCounter(0,100)
switch: (state = undefined) =>
switch: (state = undefined) ->
# read state
if state is undefined
@ -1795,7 +1795,7 @@ class App.CustomerChatRef extends App.Controller
chat.addMessage text, if i % 2 then 'customer' else 'agent'
addChat: ->
chat = new chatWindowRef
chat = new ChatWindowRef
name: "Quizmaster-#{ ++@i }"
@on 'layout-has-changed', @propagateLayoutChange
@ -1811,12 +1811,12 @@ class App.CustomerChatRef extends App.Controller
initQuiz: ->
@chatWindows[0].addStatusMessage('To start the quiz type <strong>Start</strong>')
@chatWindows[0].bind "answer", @startQuiz
@chatWindows[0].bind 'answer', @startQuiz
startQuiz: (answer) =>
return false unless answer is "Start"
return false unless answer is 'Start'
@chatWindows[0].unbind "answer"
@chatWindows[0].unbind 'answer'
@nextQuestion()
@ -1824,7 +1824,7 @@ class App.CustomerChatRef extends App.Controller
if not @questions.length
@currentChat.addStatusMessage("Du hast #{ @correct } von #{ @totalQuestions } Fragen richtig beantwortet!")
for chat in @chatWindows
chat.unbind "answer"
chat.unbind 'answer'
if chat is not @currentChat
chat.goOffline()
return
@ -1832,7 +1832,7 @@ class App.CustomerChatRef extends App.Controller
if @chatWindows.length < @maxChats and Math.random() < 0.2
@addChat()
randomWindowId = @chatWindows.length-1
else
else
# maybe take a chat offline
if @chatWindows.length > 1 and Math.random() > 0.85
randomWindowId = Math.floor(Math.random()*@chatWindows.length)
@ -1850,9 +1850,9 @@ class App.CustomerChatRef extends App.Controller
messageDelay = 500
if newChat != @currentChat
@currentChat.unbind("answer") if @currentChat
@currentChat.unbind('answer') if @currentChat
@currentChat = newChat
@currentChat.bind "answer", @onQuestionAnswer
@currentChat.bind 'answer', @onQuestionAnswer
messageDelay = 1500
@currentChat.showWritingLoader()
@ -1899,7 +1899,7 @@ class CustomerChatRouter extends App.ControllerPermanent
#App.Config.set( 'CustomerChatRef', { controller: 'CustomerChatRef', authentication: true }, 'permanentTask' )
#App.Config.set( 'CustomerChatRef', { prio: 1200, parent: '', name: 'Customer Chat', target: '#layout_ref/customer_chat', key: 'CustomerChatRef', role: ['Agent'], class: 'chat' }, 'NavBar' )
class chatWindowRef extends Spine.Controller
class ChatWindowRef extends Spine.Controller
@extend Spine.Events
className: 'chat-window'
@ -1941,7 +1941,7 @@ class chatWindowRef extends Spine.Controller
# make sure animation will run
setTimeout (=> @el.addClass('is-open')), 0
# @addMessage 'Hello. My name is Roger, how can I help you?', 'agent'
# @addMessage 'Hello. My name is Roger, how can I help you?', 'agent'
onTransitionend: (event) =>
# chat window is done with animation - adjust scroll-bars
@ -1964,17 +1964,17 @@ class chatWindowRef extends Spine.Controller
@updateModified(false)
onKeydown: (event) =>
TABKEY = 9;
ENTERKEY = 13;
TABKEY = 9
ENTERKEY = 13
switch event.keyCode
switch event.keyCode
when TABKEY
allChatInputs = $('.js-customerChatInput').not('[disabled="disabled"]')
chatCount = allChatInputs.size()
index = allChatInputs.index(@input)
if chatCount > 1
switch index
switch index
when chatCount-1
if !event.shiftKey
# State: tab without shift on last input
@ -1998,7 +1998,7 @@ class chatWindowRef extends Spine.Controller
@addMessage @input.html(), 'agent'
@trigger "answer", @input.html()
@trigger 'answer', @input.html()
@input.html('')
@ -2012,7 +2012,7 @@ class chatWindowRef extends Spine.Controller
@addMessage(message, 'customer', !isFocused)
if !isFocused
@updateModified(true)
@updateModified(true)
@sound.message.play()
addMessage: (message, sender, isNew) =>
@ -2054,7 +2054,7 @@ class chatWindowRef extends Spine.Controller
@updateLastTimestamp label, time
@lastTimestamp = timestamp
else
@addTimestamp label, time
@addTimestamp label, time
@lastTimestamp = timestamp
@lastAddedType = 'timestamp'
@ -2124,7 +2124,7 @@ class TwitterConversationRef extends App.ControllerContent
updateLetterCount: (event) =>
textLength = @maxTextLength - @textarea.text().length - @signature.text().length - 2
className = switch
className = switch
when textLength < 0 then 'label-danger'
when textLength < @warningTextLength then 'label-warning'
else ''

View file

@ -82,7 +82,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
)
# bind on switch changes and execute it on controller
@$('.js-menu .js-switch').bind('change', (e) =>
@$('.js-menu .js-switch').bind('change', (e) ->
val = $(e.target).prop('checked')
key = $(e.target).closest('.menu-item').data('key')
return if !key

View file

@ -246,7 +246,7 @@ class Edit extends App.ControllerModalNice
content.find('[name=data_type]').on(
'change',
(e) =>
(e) ->
dataType = $( e.target ).val()
content.find('.js-middle > div').addClass('hide')
content.find(".js-#{dataType}").removeClass('hide')

View file

@ -294,7 +294,7 @@ class Download extends App.Controller
downloadBackendSelected: @params.downloadBackendSelected
)
processData: true
success: (data) =>
success: (data) ->
App.Collection.loadAssets(data.assets)
ticket_collection = []
if data.ticket_ids

View file

@ -121,7 +121,7 @@ class Remove extends App.ControllerModalNice
buttonClass: 'btn--danger'
head: 'Confirm'
content: =>
content: ->
App.i18n.translateContent('Tab has changed, you really want to close it?')
onSubmit: (e) =>

View file

@ -4,7 +4,7 @@ class App.TicketCustomer extends App.ControllerModalNice
buttonSubmit: true
head: 'Change Customer'
content: =>
content: ->
configure_attributes = [
{ name: 'customer_id', display: 'Customer', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organization/Company', minLengt: 2, disableCreateUser: true },
]

View file

@ -105,7 +105,7 @@ class Navbar extends App.Controller
if @vertical
$(window).on 'resize.navbar', @autoFoldTabs
navigateTo: (event) =>
navigateTo: (event) ->
location.hash = $(event.currentTarget).attr('data-target')
onDropdownShow: =>

View file

@ -126,9 +126,11 @@ class ArticleViewItem extends App.Controller
body = @article.body
if @article.preferences && @article.preferences.signature_detection
signatureDetected = '########SIGNATURE########'
# coffeelint: disable=no_unnecessary_double_quotes
body = body.split("\n")
body.splice(@article.preferences.signature_detection, 0, signatureDetected)
body = body.join("\n")
# coffeelint: enable=no_unnecessary_double_quotes
if signatureDetected
body = App.Utils.textCleanup(body)
@article['html'] = App.Utils.text2html(body)

View file

@ -19,7 +19,7 @@ class Index extends App.ControllerContent
@bind('i18n:translation_update_list', =>
@load('i18n:translation_update_list')
)
@bind('i18n:translation_update', =>
@bind('i18n:translation_update ui:rerender', =>
@load()
)

View file

@ -40,7 +40,7 @@ class App.Notify extends App.ControllerWidgetPermanent
text: data.msg
type: data.type
template: App.view('notify')
type: data.type
type: data.type
animation:
open: 'animated fadeInDown'
close: 'animated fadeOutDown'

View file

@ -200,5 +200,5 @@ class App.OnlineNotificationWidget extends App.Controller
resetHeight: ->
notificationsContainer = $('.js-notificationsContainer')
notificationsContainer.find('.popover-content').css('height', "auto")
notificationsContainer.find('.popover-content').css('height', 'auto')

View file

@ -36,7 +36,7 @@ class Widget extends App.Controller
element = $(e.target)
element.data 'before', element.text()
element
.on 'blur.translation', '.translation', (e) =>
.on 'blur.translation', '.translation', (e) ->
console.log('blur')
element = $(e.target)
source = element.attr('title')

View file

@ -103,7 +103,7 @@ class _taskManagerSingleton extends App.Controller
# sort by prio
@allTasks = _(@allTasks).sortBy( (task) ->
return task.prio;
return task.prio
)
return @allTasks