Browse Source

[WebUI] Add missed declarations

tags/1.7.8
Alexander Moisseev 5 years ago
parent
commit
9819f6a164
2 changed files with 8 additions and 7 deletions
  1. 2
    2
      interface/js/app/history.js
  2. 6
    5
      interface/js/app/stats.js

+ 2
- 2
interface/js/app/history.js View File

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


+ 6
- 5
interface/js/app/stats.js View File

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

Loading…
Cancel
Save