overleaf/services/web/public/coffee/app/ide/chat/controllers/ChatMessageController.coffee

12 lines
357 B
CoffeeScript
Raw Normal View History

2014-07-02 10:56:09 -04:00
define [
"base"
], (App) ->
App.controller "ChatMessageController", ["$scope", "ide", ($scope, ide) ->
$scope.gravatarUrl = (user) ->
email = user.email.trim().toLowerCase()
hash = CryptoJS.MD5(email).toString()
return "//www.gravatar.com/avatar/#{hash}?d=mm&s=50"
$scope.hue = (user) ->
ide.onlineUsersManager.getHueForUserId(user.id)
]