mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
24 lines
No EOL
995 B
CoffeeScript
24 lines
No EOL
995 B
CoffeeScript
define [
|
|
"base"
|
|
"ide/colors/ColorManager"
|
|
], (App, ColorManager) ->
|
|
App.controller "ChatMessageController", ["$scope", "ide", ($scope, ide) ->
|
|
hslColorConfigs =
|
|
borderSaturation: window.uiConfig?.chatMessageBorderSaturation or "70%"
|
|
borderLightness : window.uiConfig?.chatMessageBorderLightness or "70%"
|
|
bgSaturation : window.uiConfig?.chatMessageBgSaturation or "60%"
|
|
bgLightness : window.uiConfig?.chatMessageBgLightness or "97%"
|
|
|
|
hue = (user) ->
|
|
if !user?
|
|
return 0
|
|
else
|
|
return ColorManager.getHueForUserId(user.id)
|
|
|
|
$scope.getMessageStyle = (user) ->
|
|
"border-color" : "hsl(#{ hue(user) }, #{ hslColorConfigs.borderSaturation }, #{ hslColorConfigs.borderLightness })"
|
|
"background-color" : "hsl(#{ hue(user) }, #{ hslColorConfigs.bgSaturation }, #{ hslColorConfigs.bgLightness })"
|
|
|
|
$scope.getArrowStyle = (user) ->
|
|
"border-color" : "hsl(#{ hue(user) }, #{ hslColorConfigs.borderSaturation }, #{ hslColorConfigs.borderLightness })"
|
|
] |