aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app
diff options
context:
space:
mode:
Diffstat (limited to 'interface/js/app')
-rw-r--r--interface/js/app/config.js4
-rw-r--r--interface/js/app/graph.js4
-rw-r--r--interface/js/app/history.js15
-rw-r--r--interface/js/app/rspamd.js16
-rw-r--r--interface/js/app/stats.js11
-rw-r--r--interface/js/app/symbols.js2
6 files changed, 32 insertions, 20 deletions
diff --git a/interface/js/app/config.js b/interface/js/app/config.js
index fe9d27a16..a64e8f3ab 100644
--- a/interface/js/app/config.js
+++ b/interface/js/app/config.js
@@ -22,6 +22,8 @@
THE SOFTWARE.
*/
+/* global $span:true, $tbody:true */
+
define(["jquery"],
function ($) {
var interface = {};
@@ -240,7 +242,7 @@ define(["jquery"],
$("#modalTitle").html(item.uri);
$("#" + item.map).first().show();
$("#modalDialog .progress").hide();
- $("#modalDialog").modal(show = true, backdrop = true, keyboard = show);
+ $("#modalDialog").modal({backdrop: true, keyboard: "show", show: true});
if (item.editable === false) {
$("#modalSave").hide();
$("#modalSaveAll").hide();
diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js
index de90c4a73..6a63500fc 100644
--- a/interface/js/app/graph.js
+++ b/interface/js/app/graph.js
@@ -23,6 +23,8 @@
THE SOFTWARE.
*/
+/* global d3:false */
+
define(["jquery", "d3evolution", "footable"],
function ($, D3Evolution) {
var rrd_pie_config = {
@@ -205,7 +207,7 @@ define(["jquery", "d3evolution", "footable"],
drawRrdTable(rrd_summary, unit);
}
- if (graphs.graph === undefined) {
+ if (!graphs.graph) {
graphs.graph = initGraph();
}
diff --git a/interface/js/app/history.js b/interface/js/app/history.js
index e89108185..8147c39a1 100644
--- a/interface/js/app/history.js
+++ b/interface/js/app/history.js
@@ -22,6 +22,8 @@
THE SOFTWARE.
*/
+/* global FooTable:false */
+
define(["jquery", "footable", "humanize"],
function ($, _, Humanize) {
var interface = {};
@@ -39,13 +41,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); });
};
@@ -137,7 +139,8 @@ define(["jquery", "footable", "humanize"],
return (l > rcpt_lim) ? " … (" + l + ")" : "";
}
function format_rcpt(smtp, mime) {
- var full = shrt = "";
+ var full = "";
+ var shrt = "";
if (smtp) {
full = "[" + item.rcpt_smtp.join(", ") + "] ";
shrt = "[" + item.rcpt_smtp.slice(0, rcpt_lim).join(",&#8203;") + more("rcpt_smtp") + "]";
@@ -612,7 +615,7 @@ define(["jquery", "footable", "humanize"],
});
} else if (ft.history) {
ft.history.destroy();
- ft.history = undefined;
+ delete ft.history;
}
});
}
@@ -676,11 +679,11 @@ define(["jquery", "footable", "humanize"],
}
if (ft.history) {
ft.history.destroy();
- ft.history = undefined;
+ delete ft.history;
}
if (ft.errors) {
ft.errors.destroy();
- ft.errors = undefined;
+ delete ft.errors;
}
if (checked_server === "All SERVERS") {
rspamd.queryNeighbours("errors", function () {
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js
index c60c5889d..b935cf6c2 100644
--- a/interface/js/app/rspamd.js
+++ b/interface/js/app/rspamd.js
@@ -22,6 +22,9 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+
+/* global jQuery:false, Visibility:false */
+
define(["jquery", "d3pie", "visibility", "app/stats", "app/graph", "app/config",
"app/symbols", "app/history", "app/upload"],
function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
@@ -47,27 +50,27 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
function disconnect() {
if (graphs.chart) {
graphs.chart.destroy();
- graphs.chart = undefined;
+ delete graphs.chart;
}
if (graphs.rrd_pie) {
graphs.rrd_pie.destroy();
- graphs.rrd_pie = undefined;
+ delete graphs.rrd_pie;
}
if (graphs.graph) {
graphs.graph.destroy();
- graphs.graph = undefined;
+ delete graphs.graph;
}
if (tables.history) {
tables.history.destroy();
- tables.history = undefined;
+ delete tables.history;
}
if (tables.errors) {
tables.errors.destroy();
- tables.errors = undefined;
+ delete tables.errors;
}
if (tables.symbols) {
tables.symbols.destroy();
- tables.symbols = undefined;
+ delete tables.symbols;
}
stopTimers();
@@ -144,7 +147,6 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
$("#historyLog tbody").remove();
$("#errorsLog tbody").remove();
$("#symbolsTable tbody").remove();
- password = "";
}
function isLogged() {
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";
diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js
index 358deb0e5..a639127f4 100644
--- a/interface/js/app/symbols.js
+++ b/interface/js/app/symbols.js
@@ -22,6 +22,8 @@
THE SOFTWARE.
*/
+/* global FooTable:false */
+
define(["jquery", "footable"],
function ($) {
var interface = {};