From 9819f6a164133a8d8774265bb323e12bf8ce7300 Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Sun, 8 Jul 2018 12:01:18 +0300 Subject: [WebUI] Add missed declarations --- interface/js/app/history.js | 4 ++-- interface/js/app/stats.js | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'interface/js') diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 4a8cddb0c..be2471c57 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -39,13 +39,13 @@ define(["jquery", "footable", "humanize"], var htmlEscaper = /[&<>"'/`=]/g; var symbolDescriptions = {}; - EscapeHTML = function (string) { + var EscapeHTML = function (string) { return ("" + string).replace(htmlEscaper, function (match) { return htmlEscapes[match]; }); }; - escape_HTML_array = function (arr) { + var escape_HTML_array = function (arr) { arr.forEach(function (d, i) { arr[i] = EscapeHTML(d); }); }; diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js index c75b20441..a074d47f8 100644 --- a/interface/js/app/stats.js +++ b/interface/js/app/stats.js @@ -27,12 +27,13 @@ define(["jquery", "d3pie", "humanize"], // @ ms to date function msToTime(seconds) { /* eslint-disable no-bitwise */ - years = seconds / 31536000 >> 0; // 3600*24*365 - months = seconds % 31536000 / 2628000 >> 0; // 3600*24*365/12 - days = seconds % 31536000 % 2628000 / 86400 >> 0; // 24*3600 - hours = seconds % 31536000 % 2628000 % 86400 / 3600 >> 0; - minutes = seconds % 31536000 % 2628000 % 86400 % 3600 / 60 >> 0; + var years = seconds / 31536000 >> 0; // 3600*24*365 + var months = seconds % 31536000 / 2628000 >> 0; // 3600*24*365/12 + var days = seconds % 31536000 % 2628000 / 86400 >> 0; // 24*3600 + var hours = seconds % 31536000 % 2628000 % 86400 / 3600 >> 0; + var minutes = seconds % 31536000 % 2628000 % 86400 % 3600 / 60 >> 0; /* eslint-enable no-bitwise */ + var out; if (years > 0) { if (months > 0) { out = years + "yr " + months + "mth"; -- cgit v1.2.3