mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add colour swatches to debug when hex colour matched
This commit is contained in:
parent
a03ccd7b59
commit
5b4019dd3d
@ -106,8 +106,10 @@ RED.utils = (function() {
|
|||||||
$('<pre class="debug-message-type-string"></pre>').text(obj).appendTo(row);
|
$('<pre class="debug-message-type-string"></pre>').text(obj).appendTo(row);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('<span class="debug-message-type-string debug-message-object-header"></span>').html('"'+formatString(sanitize(obj))+'"').appendTo(entryObj);
|
e = $('<span class="debug-message-type-string debug-message-object-header"></span>').html('"'+formatString(sanitize(obj))+'"').appendTo(entryObj);
|
||||||
|
if (/^#[0-9a-f]{6}$/i.test(obj)) {
|
||||||
|
$('<span class="debug-message-type-string-swatch"></span>').css('backgroundColor',obj).appendTo(e);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (typeof obj === 'number') {
|
} else if (typeof obj === 'number') {
|
||||||
e = $('<span class="debug-message-type-number"></span>').text(""+obj).appendTo(entryObj);
|
e = $('<span class="debug-message-type-number"></span>').text(""+obj).appendTo(entryObj);
|
||||||
|
@ -183,3 +183,11 @@
|
|||||||
.debug-message-buffer-string > .debug-message-array-rows {
|
.debug-message-buffer-string > .debug-message-array-rows {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.debug-message-type-string-swatch {
|
||||||
|
display: inline-block;
|
||||||
|
width: 1.1em;
|
||||||
|
height: 0.9em;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-radius: 3px;
|
||||||
|
margin: 0 4px;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user