From 169bae6cc91c44b77c0717184e46436b19b3464a Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 6 Feb 2012 16:00:08 +0100 Subject: [PATCH 1/3] Tweak contrast factor for author colors in editor --- static/js/ace2_inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 977c5cdff..31d4dac94 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -238,7 +238,7 @@ function OUTER(gscope) } // Text color - var txtcolor = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.45) ? '#ffffff' : '#000000'; + var txtcolor = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5) ? '#ffffff' : '#000000'; var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector( getAuthorClassName(author))); From 9e769571fa3441b7f29c7623023906ecb0d1fd86 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 6 Feb 2012 16:00:42 +0100 Subject: [PATCH 2/3] Text contrast adjustment for timeslider --- static/js/broadcast.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/broadcast.js b/static/js/broadcast.js index 2aa0b5d06..020f47e7c 100644 --- a/static/js/broadcast.js +++ b/static/js/broadcast.js @@ -25,6 +25,7 @@ var domline = require('/domline_client').domline; var Changeset = require('/easysync2_client').Changeset; var AttribPool = require('/easysync2_client').AttribPool; var linestylefilter = require('/linestylefilter_client').linestylefilter; +var colorutils = require('/colorutils').colorutils; // These parameters were global, now they are injected. A reference to the // Timeslider controller would probably be more appropriate. @@ -757,7 +758,9 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro var bgcolor = typeof data.colorId == "number" ? clientVars.colorPalette[data.colorId] : data.colorId; if (bgcolor && dynamicCSS) { - dynamicCSS.selectorStyle('.' + linestylefilter.getAuthorClassName(author)).backgroundColor = bgcolor; + var selector = dynamicCSS.selectorStyle('.' + linestylefilter.getAuthorClassName(author)); + selector.backgroundColor = bgcolor + selector.color = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5) ? '#ffffff' : '#000000'; //see ace2_inner.js for the other part } authorData[author] = data; } From c130a48d89e28138cf3ede6dd3e4fa460f71d839 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 6 Feb 2012 16:16:31 +0100 Subject: [PATCH 3/3] Text contrast adjustment for chat time --- static/js/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/chat.js b/static/js/chat.js index e094f93df..9f0903cf5 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -106,7 +106,7 @@ var chat = (function() var authorName = msg.userName == null ? "unnamed" : padutils.escapeHtml(msg.userName); - var html = "

" + authorName + ":" + timeStr + " " + text + "

"; + var html = "

" + authorName + ":" + timeStr + " " + text + "

"; $("#chattext").append(html); //should we increment the counter??