code review: do not pollute global namespace

This commit is contained in:
gorhill 2015-03-09 19:19:08 -04:00
parent e7479dd4be
commit f362dff643
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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');