From: Alexander Moisseev Date: Mon, 2 Jul 2018 10:26:52 +0000 (+0300) Subject: [WebUI] Stop using "const" declaration X-Git-Tag: 1.7.7~3^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d649c1329fde549ce52f4195db90083c8c7fe834;p=rspamd.git [WebUI] Stop using "const" declaration as it is not compatible with ES5 --- diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index 9ae6a9297..20fa36f53 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -175,7 +175,7 @@ function($, D3Evolution, unused) { // Autoranging var scaleFactor = 1; var unit = "msg/s"; - const yMax = d3.max(d3.merge(data), function (d) { return d.y; }); + var yMax = d3.max(d3.merge(data), function (d) { return d.y; }); if (yMax < 1) { scaleFactor = 60; unit = "msg/min"; diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 3c62983ad..fbae27959 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -115,7 +115,7 @@ function($, _, Humanize) { function process_history_v2(data) { // Display no more than rcpt_lim recipients - const rcpt_lim = 3; + var rcpt_lim = 3; var items = []; function getSelector(id) { @@ -133,7 +133,7 @@ function($, _, Humanize) { $.each(data.rows, function (i, item) { function more(p) { - const l = item[p].length; + var l = item[p].length; return (l > rcpt_lim) ? " … (" + l + ")" : ""; } function format_rcpt(smtp, mime) { @@ -556,7 +556,7 @@ function($, _, Humanize) { if (checked_server === "All SERVERS") { rspamd.queryNeighbours("history", function (req_data) { function differentVersions() { - const dv = neighbours_data.some(function (e) { + var dv = neighbours_data.some(function (e) { return e.version !== neighbours_data[0].version; }); if (dv) { diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 1b90cb27e..120f746c4 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -165,7 +165,7 @@ define(['jquery', 'd3pie', 'visibility', 'app/stats', 'app/graph', 'app/config', } function alertMessage(alertClass, alertText) { - const a = $('
' + + var a = $('
' + '' + '' + alertText + ''); $('.notification-area').append(a);