Added colors to pad diff

This commit is contained in:
Peter 'Pita' Martischka 2013-01-27 16:45:09 +00:00
parent dcfb1b2ea4
commit 07a267be7a
6 changed files with 89 additions and 21 deletions

View file

@ -618,7 +618,6 @@ exports.createDiff = function(padID, startRev, endRev, callback){
try {
var padDiff = new PadDiff(pad, startRev, endRev);
} catch(e) {
// console.warn(e.stack);
return callback({stop:e.message});
}
var html, authors;

View file

@ -24,6 +24,10 @@ var db = require("./DB").db;
var async = require("async");
var randomString = require('ep_etherpad-lite/static/js/pad_utils').randomString;
exports.getColorPalette = function(){
return ["#ffc7c7", "#fff1c7", "#e3ffc7", "#c7ffd5", "#c7ffff", "#c7d5ff", "#e3c7ff", "#ffc7f1", "#ff8f8f", "#ffe38f", "#c7ff8f", "#8fffab", "#8fffff", "#8fabff", "#c78fff", "#ff8fe3", "#d97979", "#d9c179", "#a9d979", "#79d991", "#79d9d9", "#7991d9", "#a979d9", "#d979c1", "#d9a9a9", "#d9cda9", "#c1d9a9", "#a9d9b5", "#a9d9d9", "#a9b5d9", "#c1a9d9", "#d9a9cd", "#4c9c82", "#12d1ad", "#2d8e80", "#7485c3", "#a091c7", "#3185ab", "#6818b4", "#e6e76d", "#a42c64", "#f386e5", "#4ecc0c", "#c0c236", "#693224", "#b5de6a", "#9b88fd", "#358f9b", "#496d2f", "#e267fe", "#d23056", "#1a1a64", "#5aa335", "#d722bb", "#86dc6c", "#b5a714", "#955b6a", "#9f2985", "#4b81c8", "#3d6a5b", "#434e16", "#d16084", "#af6a0e", "#8c8bd8"];
};
/**
* Checks if the author exists
*/

View file

@ -227,7 +227,8 @@ Pad.prototype.getAllAuthorColors = function getAllAuthorColors(callback){
if(err){
return callback(err);
}
returnTable[author]=colorPalette[colorId];
//colorId might be a hex color or an number out of the palette
returnTable[author]=colorPalette[colorId] || colorId;
callback();
});