added a colorPicker

This commit is contained in:
Peter 'Pita' Martischka 2011-08-20 18:22:10 +01:00
parent 5d30c8b4a5
commit 9d37d91ce1
8 changed files with 594 additions and 51 deletions

View file

@ -471,26 +471,19 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options)
function tellAceAuthorInfo(userId, colorId, inactive)
{
if (colorId || (typeof colorId) == "number")
var cssColor = colorId;
if (inactive)
{
colorId = Number(colorId);
if (options && options.colorPalette && options.colorPalette[colorId])
{
var cssColor = options.colorPalette[colorId];
if (inactive)
{
editor.setAuthorInfo(userId, {
bgcolor: cssColor,
fade: 0.5
});
}
else
{
editor.setAuthorInfo(userId, {
bgcolor: cssColor
});
}
}
editor.setAuthorInfo(userId, {
bgcolor: cssColor,
fade: 0.5
});
}
else
{
editor.setAuthorInfo(userId, {
bgcolor: cssColor
});
}
}