import color-blind color scheme into logger

This commit is contained in:
gorhill 2015-04-23 18:46:14 -04:00
parent 361d2ac1a2
commit 87a14ff339
3 changed files with 21 additions and 8 deletions

View file

@ -58,11 +58,14 @@ input:focus {
#content table tr.blocked { #content table tr.blocked {
background-color: rgba(192, 0, 0, 0.1) background-color: rgba(192, 0, 0, 0.1)
} }
body.colorBlind #content table tr.blocked {
background-color: rgba(0, 19, 110, 0.1)
}
#content table tr.allowed { #content table tr.allowed {
background-color: rgba(0, 160, 0, 0.1) background-color: rgba(0, 160, 0, 0.1)
} }
#content table tr.allowed.mirrored { body.colorBlind #content table tr.allowed {
background-color: rgba(255, 255, 0, 0.3) background-color: rgba(255, 194, 57, 0.1)
} }
#content table tr.maindoc { #content table tr.maindoc {
background-color: #eee; background-color: #eee;
@ -103,6 +106,12 @@ body:not(.filterOff) #content table tr.hidden {
#content table tr.blocked td:nth-of-type(4) b { #content table tr.blocked td:nth-of-type(4) b {
background-color: rgba(192, 0, 0, 0.2); background-color: rgba(192, 0, 0, 0.2);
} }
body.colorBlind #content table tr.blocked td:nth-of-type(4) b {
background-color: rgba(0, 19, 110, 0.2);
}
#content table tr.allowed td:nth-of-type(4) b { #content table tr.allowed td:nth-of-type(4) b {
background-color: rgba(0, 160, 0, 0.2); background-color: rgba(0, 160, 0, 0.2);
} }
body.colorBlind #content table tr.allowed td:nth-of-type(4) b {
background-color: rgba(255, 194, 57, 0.2);
}

View file

@ -151,7 +151,10 @@ var renderLogEntry = function(entry) {
/******************************************************************************/ /******************************************************************************/
var renderLogBuffer = function(buffer) { var renderLogBuffer = function(response) {
body.classList.toggle('colorBlind', response.colorBlind);
var buffer = response.entries;
if ( buffer.length === 0 ) { if ( buffer.length === 0 ) {
return; return;
} }
@ -205,10 +208,8 @@ var truncateLog = function(size) {
/******************************************************************************/ /******************************************************************************/
var onBufferRead = function(buffer) { var onBufferRead = function(response) {
if ( Array.isArray(buffer) ) { renderLogBuffer(response);
renderLogBuffer(buffer);
}
setTimeout(readLogBuffer, 1000); setTimeout(readLogBuffer, 1000);
}; };

View file

@ -1248,7 +1248,10 @@ var onMessage = function(request, sender, callback) {
switch ( request.what ) { switch ( request.what ) {
case 'readLogBuffer': case 'readLogBuffer':
response = µb.logger.readAll(request.tabId); response = {
colorBlind: µb.userSettings.colorBlindFriendly,
entries: µb.logger.readAll(request.tabId)
};
break; break;
default: default: