1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-02 00:42:45 +01:00

Adjust visual of cosmetic exception filters in logger

The invariant prefixes `##` and `#@#` are now hidden,
allowing to reveal more of the filter itself when the
logger view is narrow.
This commit is contained in:
Raymond Hill 2019-05-17 11:45:07 -04:00
parent 0ca44b847c
commit 9bfbbfec84
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 24 additions and 3 deletions

View File

@ -326,8 +326,14 @@ body[dir="rtl"] #vwRenderer .logEntry > div > span:first-child {
#vwRenderer .logEntry > div.messageRealm[data-type="tabLoad"] > span:nth-of-type(2) {
text-align: center;
}
#vwRenderer .logEntry > div.cosmeticRealm.isException > span:nth-of-type(2) {
text-decoration: line-through;
#vwRenderer .logEntry > div.cosmeticRealm > span:nth-of-type(2) > span:first-of-type {
display: none;
}
#vwRenderer .logEntry > div.cosmeticRealm > span:nth-of-type(2) > span:last-of-type {
pointer-events: none;
}
#vwRenderer .logEntry > div.cosmeticRealm.isException > span:nth-of-type(2) > span:last-of-type {
text-decoration: line-through rgba(0,0,255,0.7);
}
#vwRenderer .logEntry > div > span:nth-of-type(3) {
font: 12px monospace;

View File

@ -567,6 +567,19 @@ const viewPort = (function() {
updateLayout();
const renderFilterToSpan = function(span, filter) {
if ( filter.charCodeAt(0) !== 0x23 /* '#' */ ) { return false; }
const match = /^#@?#/.exec(filter);
if ( match === null ) { return false; }
let child = document.createElement('span');
child.textContent = match[0];
span.appendChild(child);
child = document.createElement('span');
child.textContent = filter.slice(match[0].length);
span.appendChild(child);
return true;
};
const renderToDiv = function(vwEntry, i) {
if ( i >= filteredLoggerEntries.length ) {
vwEntry.logEntry = undefined;
@ -632,7 +645,9 @@ const viewPort = (function() {
}
}
span = div.children[1];
if ( renderFilterToSpan(span, cells[1]) === false ) {
span.textContent = cells[1];
}
// Event
if ( cells[2] === '--' ) {