}
graphs.graph.data(data);
- if (unit != prevUnit) {
+ if (unit !== prevUnit) {
graphs.graph.yAxisLabel("Message rate, " + unit);
prevUnit = unit;
}
});
break;
default:
- if (typeof (item[prop]) == "string") {
+ if (typeof (item[prop]) === "string") {
item[prop] = EscapeHTML(item[prop]);
}
}
$.each(data, function (i, item) {
var widget = "";
- if (i == "auth") {}
- else if (i == "error") {}
- else if (i == "version") {
+ if (i === "auth") {}
+ else if (i === "error") {}
+ else if (i === "version") {
widget = "<div class=\"left\"><strong>" + item + "</strong>" +
i + "</div>";
$(widget).appendTo(widgets);
- } else if (i == "uptime") {
+ } else if (i === "uptime") {
widget = "<div class=\"right\"><strong>" + msToTime(item) +
"</strong>" + i + "</div>";
$(widget).appendTo(widgets);
var titleAtt = Humanize.intComma(item) + " " + i;
widget = "<li class=\"stat-box\"><div class=\"widget\" title=\"" + titleAtt + "\"><strong>" +
Humanize.compactInteger(item) + "</strong>" + i + "</div></li>";
- if (i == "scanned") {
+ if (i === "scanned") {
stat_w[0] = widget;
- } else if (i == "clean") {
+ } else if (i === "clean") {
stat_w[1] = widget;
- } else if (i == "greylist") {
+ } else if (i === "greylist") {
stat_w[2] = widget;
- } else if (i == "probable") {
+ } else if (i === "probable") {
stat_w[3] = widget;
- } else if (i == "reject") {
+ } else if (i === "reject") {
stat_w[4] = widget;
- } else if (i == "learned") {
+ } else if (i === "learned") {
stat_w[5] = widget;
}
}
$("#selSrv").append($("<option value=\"" + key + "\">" + key + "</option>"));
- if (checked_server == key) {
+ if (checked_server === key) {
$("#clusterTable tbody [value=\"" + key + "\"]").prop("checked", true);
$("#selSrv [value=\"" + key + "\"]").prop("selected", true);
}
return Number(a) < Number(b);
}).reduce(function (f1, acc) {
return f1 + acc;
- }) / (freqs.length != 0 ? freqs.length : 1.0);
+ }) / (freqs.length !== 0 ? freqs.length : 1.0);
var mult = 1.0;
var exp = 0.0;
$(document).on("click", "#symbolsTable :button", function () {
var value = $(this).data("save");
if (!value) return;
- saveSymbols(rspamd, "./savesymbols", "symbolsTable", value == "cluster");
+ saveSymbols(rspamd, "./savesymbols", "symbolsTable", value === "cluster");
});
};
url = "learnspam";
} else if (source === "ham") {
url = "learnham";
- } else if (source == "fuzzy") {
+ } else if (source === "fuzzy") {
url = "fuzzyadd";
} else if (source === "scan") {
url = "scan";
var nsym = 0;
$.each(data.symbols, function (i, item) {
- if (typeof item == "object") {
+ if (typeof item === "object") {
var sym_id = "sym_" + nsym;
if (item.description) {
sym_desc[sym_id] = item.description;
var data;
var headers = {};
data = $("#" + source + "TextSource").val();
- if (source == "fuzzy") {
+ if (source === "fuzzy") {
// To access the proper
headers.flag = $("#fuzzyFlagText").val();
headers.weight = $("#fuzzyWeightText").val();
data = $("#" + source + "TextSource").val();
}
if (data.length > 0) {
- if (source == "scan") {
+ if (source === "scan") {
scanText(rspamd, data);
} else {
uploadText(rspamd, data, source, headers);