jshint, glitches

This commit is contained in:
gorhill 2014-07-06 21:52:16 -04:00
parent 4097dbf4c7
commit 2e4b96157c
6 changed files with 17 additions and 10 deletions

View file

@ -291,7 +291,7 @@ var getPageDetails = function(µb, tabId) {
});
}
return r;
}
};
var hasher = new YaMD5();
if ( µb.userSettings.logBlockedRequests ) {
r.blockedRequests = prepareRequests(pageStore.blockedRequests, hasher);

View file

@ -19,6 +19,8 @@
Home: https://github.com/gorhill/uBlock
*/
/* global chrome, messaging, uDom */
/******************************************************************************/
/******************************************************************************/
@ -36,7 +38,7 @@ messaging.start('popup.js');
/******************************************************************************/
formatNumber = function(count) {
var formatNumber = function(count) {
if ( typeof count !== 'number' ) {
return '';
}
@ -70,7 +72,7 @@ var renderStats = function() {
uDom('#gotoLog').toggleClass(
'enabled',
stats.logBlockedRequests || stats.logAllowedRequests
stats.netFilteringSwitch && (stats.logBlockedRequests || stats.logAllowedRequests)
);
var blocked = stats.pageBlockedRequestCount;

View file

@ -209,7 +209,8 @@ var renderPageSelector = function(targetTabId) {
for ( var i = 0; i < pageSelectors.length; i++ ) {
chrome.tabs.get(parseInt(pageSelectors[i], 10), onTabReceived);
}
if ( selectedTabId ) {
uDom('#requests').toggleClass('empty', pageSelectors.length === 0);
if ( pageSelectors.length > 0 ) {
renderPageDetails(selectedTabId);
}
};

View file

@ -145,7 +145,7 @@ DOMList.prototype.subset = function(i, l) {
var n = l !== undefined ? l : 1;
var j = Math.min(i + n, this.nodes.length);
if ( i < j ) {
r.nodes = this.nodes.slice(i, j)
r.nodes = this.nodes.slice(i, j);
}
return r;
};
@ -167,7 +167,7 @@ DOMList.prototype.node = function(i) {
DOMList.prototype.parent = function() {
var r = new DOMList();
if ( this.nodes.length ) {
addNodeToList(r, this.nodes[0].parentNode)
addNodeToList(r, this.nodes[0].parentNode);
}
return r;
};
@ -180,7 +180,7 @@ DOMList.prototype.find = function(selector) {
var nl;
for ( var i = 0; i < n; i++ ) {
nl = this.nodes[i].querySelectorAll(selector);
addNodeListToList(r, nl)
addNodeListToList(r, nl);
}
return r;
};
@ -416,7 +416,7 @@ DOMList.prototype.toggleClass = function(className, targetState) {
for ( var i = 0; i < n; i++ ) {
node = this.nodes[i];
currentState = re.test(node.className);
newState = !!targetState;
newState = targetState;
if ( newState === undefined ) {
newState = !currentState;
}

View file

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extName__",
"short_name": "µBlock",
"version": "0.1.3.4",
"version": "0.1.4.0",
"description": "__MSG_extShortDesc__",
"icons": {
"16": "img/icon_16.png",

View file

@ -23,6 +23,7 @@ ul {
select {
padding: 2px 0;
font-size: 14px;
min-width: 20em;
}
#requests {
margin: 2em 0 0 0;
@ -31,13 +32,16 @@ select {
#requests.logEnabled {
display: block;
}
table {
#requests table {
margin: 1em 0;
border: 1px solid gray;
font: 12px mono;
border-collapse: collapse;
min-width: 600px;
}
#requests.empty table {
display: none;
}
td, th {
border: 1px solid #aaa;
padding: 6px 6px;