From dfeef5e2d61c67df2a1323f7d5d9b3bbd318e712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 7 Mar 2012 23:04:19 +0100 Subject: [PATCH] Formatting of CoffeeScript --- file/js/TimWolla.WCF.Chat.coffee | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 97e79ce..54e909b 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -63,7 +63,7 @@ consoleMock ?= # Search all matching users for user in $ '.timsChatUser' - username = $(user).data('username'); + username = $(user).data 'username' if username.indexOf(firstChars) is 0 users.push username @@ -198,7 +198,7 @@ consoleMock ?= $('#timsChatTopic').text data.topic $('#timsChatTopic').wcfBlindIn() if $('#timsChatTopic').text().trim() isnt '' and $('#timsChatTopic').is(':hidden') - $('.timsChatMessage').addClass('unloaded', 800); + $('.timsChatMessage').addClass 'unloaded', 800 @handleMessages data.messages document.title = @titleTemplate.fetch data , @) @@ -243,7 +243,7 @@ consoleMock ?= top: '+=' + top left: '+=' + left , 1e3 - , 1.5e3); + , 1.5e3) ### # Loads new messages. ### @@ -273,13 +273,13 @@ consoleMock ?= # Disable scrolling automagically when user manually scrolled unless @oldScrollTop is null if $('.timsChatMessageContainer').scrollTop() < @oldScrollTop - if $('#timsChatAutoscroll').data('status') is 1 + if $('#timsChatAutoscroll').data 'status' is 1 $('#timsChatAutoscroll').click() $('#timsChatAutoscroll').parent().addClass('default').fadeOut('slow').fadeIn('slow') # Insert the messages for message in messages - continue if $.wcfIsset 'timsChatMessage'+message.messageID # Prevent problems with race condition + continue if $.wcfIsset 'timsChatMessage' + message.messageID # Prevent problems with race condition @events.newMessage.fire message output = @messageTemplate.fetch message @@ -304,7 +304,7 @@ consoleMock ?= foundUsers = { } for user in users id = 'timsChatUser-'+user.userID - element = $('#'+id) + element = $ '#'+id # Move the user to the correct position if element[0] @@ -370,7 +370,7 @@ consoleMock ?= # @param object message ### notify: (message) -> - return if @isActive or $('#timsChatNotify').data('status') is 0 + return if @isActive or $('#timsChatNotify').data 'status' is 0 @newMessageCount++ document.title = '(' + @newMessageCount + ') ' + @titleTemplate.fetch @@ -379,8 +379,8 @@ consoleMock ?= # Desktop Notifications if typeof window.webkitNotifications isnt 'undefined' if window.webkitNotifications.checkPermission() is 0 - title = WCF.Language.get('wcf.chat.newMessages') - icon = WCF.Icon.get('timwolla.wcf.chat.chat') + title = WCF.Language.get 'wcf.chat.newMessages' + icon = WCF.Icon.get 'timwolla.wcf.chat.chat' content = message.username + message.separator + ' ' + message.message notification = window.webkitNotifications.createNotification icon, title, content notification.show() @@ -400,7 +400,7 @@ consoleMock ?= success: $.proxy((data, textStatus, jqXHR) -> $('#timsChatRoomList li').remove() $('#toggleRooms a').removeClass 'ajaxLoad' - $('#toggleRooms .wcf-badge').text(data.length); + $('#toggleRooms .wcf-badge').text data.length for room in data li = $ '
  • ' @@ -433,7 +433,7 @@ consoleMock ?= $.ajax $('#timsChatForm').attr('action'), data: text: text - smilies: $('#timsChatSmilies').data('status') + smilies: $('#timsChatSmilies').data 'status' type: 'POST', beforeSend: (jqXHR) -> $('#timsChatInput').addClass 'ajaxLoad' @@ -450,13 +450,13 @@ consoleMock ?= toggleSidebarContents: (target) -> return if target.parents('li').hasClass 'active' - if target.parents('li').attr('id') is 'toggleUsers' + if target.parents('li').attr 'id' is 'toggleUsers' $('#toggleUsers').addClass 'active' $('#toggleRooms').removeClass 'active' $('#timsChatRoomList').hide() $('#timsChatUserList').show() - else if target.parents('li').attr('id') is 'toggleRooms' + else if target.parents('li').attr 'id' is 'toggleRooms' $('#toggleRooms').addClass 'active' $('#toggleUsers').removeClass 'active'