From 06c77bafdea4f45c5134dec1328bfb22dbd1eb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 22 Jan 2012 14:48:11 +0100 Subject: [PATCH] Removing some inconsistencies --- file/js/TimWolla.WCF.Chat.coffee | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index b8257bf..771550f 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -19,7 +19,7 @@ TimWolla.WCF ?= {} newMessage: $.Callbacks() userMenu: $.Callbacks() init: () -> - console.log('[TimWolla.WCF.Chat] Initializing'); + console.log '[TimWolla.WCF.Chat] Initializing' @bindEvents() @events.newMessage.add $.proxy @notify, @ @@ -35,7 +35,8 @@ TimWolla.WCF ?= {} bindEvents: () -> @isActive = true $(window).focus $.proxy () -> - document.title = @titleTemplate.fetch({ title: $('#chatRoomList .activeMenuItem a').text() }) + document.title = @titleTemplate.fetch + title: $('#chatRoomList .activeMenuItem a').text() @newMessageCount = 0 @isActive = true , @ @@ -109,7 +110,7 @@ TimWolla.WCF ?= {} $('#topic').text data.topic $('#topic').wcfBlindIn() if $('#topic').text().trim() isnt '' and $('#topic').is(':hidden') - $('title').text @titleTemplate.fetch(data) + $('title').text @titleTemplate.fetch data @getMessages() , @) error: () -> @@ -250,11 +251,15 @@ TimWolla.WCF ?= {} return if (@isActive or $('#chatNotify').data('status') is 0) @newMessageCount++ - document.title = '(' + @newMessageCount + ') ' + @titleTemplate.fetch({ title: $('#chatRoomList .activeMenuItem a').text() }) + document.title = '(' + @newMessageCount + ') ' + @titleTemplate.fetch + title: $('#chatRoomList .activeMenuItem a').text() if typeof window.webkitNotifications isnt 'undefined' if window.webkitNotifications.checkPermission() is 0 - notification = window.webkitNotifications.createNotification WCF.Icon.get('timwolla.wcf.chat.chat'), WCF.Language.get('wcf.chat.newMessages'), message.username + ' ' + message.message + 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() setTimeout(() -> notification.cancel()