1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

actually, voided rows are important for diagnosis

This commit is contained in:
gorhill 2015-05-10 12:25:26 -04:00
parent 2edeb9c3e8
commit c3284a2b93
3 changed files with 34 additions and 4 deletions

View File

@ -157,7 +157,10 @@ body.compactView #content td {
font: 1em FontAwesome;
}
#content table tr.tab:not(.canMtx) {
opacity: 0.2;
opacity: 0.3;
}
#content table tr.tab:not(.canMtx):hover {
opacity: 0.7;
}
#content table tr.tab:not(.canMtx) > td:nth-of-type(2):before {
content: '\f00d';

View File

@ -343,7 +343,8 @@ var onLogBufferRead = function(response) {
// Neuter rows for which a tab does not exist anymore
// TODO: sort to avoid using indexOf
var rowVoided = false;
var autoDeleteVoidRows = vAPI.localStorage.getItem('loggerAutoDeleteVoidRows');
var rowVoided = false, trs;
for ( var tabId in allTabIds ) {
if ( allTabIds.hasOwnProperty(tabId) === false ) {
continue;
@ -351,16 +352,28 @@ var onLogBufferRead = function(response) {
if ( response.tabIds.hasOwnProperty(tabId) ) {
continue;
}
toJunkyard(uDom('.tab_' + tabId));
trs = uDom('.tab_' + tabId);
if ( autoDeleteVoidRows ) {
toJunkyard(trs);
} else {
trs.removeClass('canMtx');
rowVoided = true;
}
if ( tabId === popupManager.tabId ) {
popupManager.toggleOff();
}
rowVoided = true;
}
allTabIds = response.tabIds;
renderLogEntries(response);
if ( rowVoided ) {
uDom('#clean').toggleClass(
'disabled',
tbody.querySelector('tr.tab:not(.canMtx)') === null
);
}
// Synchronize toolbar with content of log
uDom('#clear').toggleClass(
'disabled',
@ -550,6 +563,18 @@ var clearBuffer = function() {
trJunkyard.push(tbody.removeChild(tr));
}
uDom('#clear').addClass('disabled');
uDom('#clean').addClass('disabled');
};
/******************************************************************************/
var cleanBuffer = function() {
var rows = uDom('#content tr.tab:not(.canMtx)').remove();
var i = rows.length;
while ( i-- ) {
trJunkyard.push(rows.nodeAt(i));
}
uDom('#clean').addClass('disabled');
};
/******************************************************************************/
@ -677,6 +702,7 @@ uDom.onLoad(function() {
readLogBuffer();
uDom('#compactViewToggler').on('click', toggleCompactView);
uDom('#clean').on('click', cleanBuffer);
uDom('#clear').on('click', clearBuffer);
uDom('#maxEntries').on('change', onMaxEntriesChanged);
uDom('#content table').on('click', 'tr.canMtx > td:nth-of-type(2)', popupManager.toggleOn);

View File

@ -10,6 +10,7 @@
<div id="toolbar">
<span id="compactViewToggler" class="button fa"></span>
<span id="clean" class="button fa disabled">&#xf00d;</span>
<span id="clear" class="button fa disabled">&#xf12d;</span>
<span id="filterButton" class="button fa">&#xf0b0;</span><input id="filterInput" type="text" placeholder="logFilterPrompt">
<input id="maxEntries" type="text" size="5" title="logMaxEntriesTip">