Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit fda70f9

Browse files
committed
refactored menu code to lower as much as possible qty of code paths
1 parent b8590b2 commit fda70f9

File tree

5 files changed

+294
-142
lines changed

5 files changed

+294
-142
lines changed

info.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,17 @@ <h3>Whitelists/blacklists</h3>
7777
<div id="lists">
7878
<div style="white-space:nowrap;"> <!-- begin template 'stats' -->
7979
<div>
80-
Whitelisted domains:<br>
81-
Blacklisted domains:
80+
Whitelisted hostnames:<br>
81+
Blacklisted hostnames:
8282
</div>
8383
<div>
8484
<span id="whitelistCount"></span><br>
8585
<span id="blacklistCount"></span>
8686
</div>
8787
<div style="margin:1em 0 0 0;display:block;text-align:left">
88-
Blacklists:<ul id="remoteBlacklists" style="margin:0;color:gray">
89-
<li id="remoteBlacklistDetails" style="display:none"><a href=""></a>&ensp;(fetched at <span class="downloadTime"></span> on <span class="downloadDate"></span>)</li>
88+
<span id="blacklistReadonlyCount">?</span> preset blacklisted hostnames from:
89+
<ul id="remoteBlacklists" style="margin:0;color:gray">
90+
<li id="remoteBlacklistDetails" style="display:none"><a href=""></a>
9091
</ul>
9192
</div>
9293
</div> <!-- end template 'stats' -->

js/info.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ function renderBlacklistDetails() {
132132
a = $('a', li);
133133
a.attr('href', keys[i]);
134134
a.text(keys[i]);
135-
date.setTime(blacklist.timeStamp);
136-
$('.downloadTime', li).text(date.toLocaleTimeString());
137-
$('.downloadDate', li).text(date.toLocaleDateString());
138135
ul.append(li);
139136
}
140137

@@ -187,7 +184,8 @@ function renderStats() {
187184
var allowedStats = requestStats.allowed;
188185
renderNumbers({
189186
'#whitelistCount': httpsb.temporaryScopes.scopes['*'].white.count,
190-
'#blacklistCount': httpsb.blacklistReadonly.count + httpsb.temporaryScopes.scopes['*'].black.count,
187+
'#blacklistCount': httpsb.temporaryScopes.scopes['*'].black.count,
188+
'#blacklistReadonlyCount': httpsb.blacklistReadonly.count,
191189
'#blockedAllCount': requestStats.blocked.all,
192190
'#blockedMainFrameCount': blockedStats.main_frame,
193191
'#blockedCookieCount': blockedStats.cookie,

0 commit comments

Comments
 (0)