mirror of https://github.com/gorhill/uBlock.git
code review: do not pollute global namespace
This commit is contained in:
parent
e7479dd4be
commit
f362dff643
|
@ -68,6 +68,7 @@ var renderBlacklists = function() {
|
||||||
var listGroupTemplate = uDom('#templates .groupEntry');
|
var listGroupTemplate = uDom('#templates .groupEntry');
|
||||||
var listEntryTemplate = uDom('#templates .listEntry');
|
var listEntryTemplate = uDom('#templates .listEntry');
|
||||||
var listStatsTemplate = vAPI.i18n('3pListsOfBlockedHostsPerListStats');
|
var listStatsTemplate = vAPI.i18n('3pListsOfBlockedHostsPerListStats');
|
||||||
|
var renderElapsedTimeToString = vAPI.i18n.renderElapsedTimeToString;
|
||||||
|
|
||||||
// Assemble a pretty blacklist name if possible
|
// Assemble a pretty blacklist name if possible
|
||||||
var listNameFromListKey = function(listKey) {
|
var listNameFromListKey = function(listKey) {
|
||||||
|
@ -129,7 +130,7 @@ var renderBlacklists = function() {
|
||||||
if ( asset.cached ) {
|
if ( asset.cached ) {
|
||||||
elem = li.descendants('span.status.purge');
|
elem = li.descendants('span.status.purge');
|
||||||
elem.css('display', '');
|
elem.css('display', '');
|
||||||
elem.attr('title', renderElapsedTime(asset.lastModified));
|
elem.attr('title', renderElapsedTimeToString(asset.lastModified));
|
||||||
hasCachedContent = true;
|
hasCachedContent = true;
|
||||||
}
|
}
|
||||||
return li;
|
return li;
|
||||||
|
|
|
@ -51,7 +51,7 @@ uDom.onLoad(function() {
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var renderElapsedTime = function(tstamp) {
|
vAPI.i18n.renderElapsedTimeToString = function(tstamp) {
|
||||||
var value = (Date.now() - tstamp) / 60000;
|
var value = (Date.now() - tstamp) / 60000;
|
||||||
if ( value < 2 ) {
|
if ( value < 2 ) {
|
||||||
return vAPI.i18n('elapsedOneMinuteAgo');
|
return vAPI.i18n('elapsedOneMinuteAgo');
|
||||||
|
|
Loading…
Reference in New Issue