summaryrefslogtreecommitdiffstats
path: root/interface/js/app/upload.js
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-07-14 17:13:56 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-07-14 17:56:15 +0300
commitb816237c36989477a5ead4c0de6b94eeaef57902 (patch)
treedb8151254d3de68f5e4b79036f1ba506a199a6d9 /interface/js/app/upload.js
parent36ad4a3924ef58570eda1a19e03ec562298ed58a (diff)
downloadrspamd-b816237c36989477a5ead4c0de6b94eeaef57902.tar.gz
rspamd-b816237c36989477a5ead4c0de6b94eeaef57902.zip
[Minor] Do not shadow variables
Diffstat (limited to 'interface/js/app/upload.js')
-rw-r--r--interface/js/app/upload.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js
index fad074668..3fcfc3aad 100644
--- a/interface/js/app/upload.js
+++ b/interface/js/app/upload.js
@@ -56,9 +56,9 @@ define(["jquery"],
xhr.setRequestHeader(name, value);
});
},
- success: function (data) {
+ success: function (json) {
cleanTextUpload(source);
- if (data.success) {
+ if (json.success) {
rspamd.alertMessage("alert-success", "Data successfully uploaded");
}
},
@@ -89,38 +89,37 @@ define(["jquery"],
beforeSend: function (xhr) {
xhr.setRequestHeader("Password", rspamd.getPassword());
},
- success: function (input) {
- var data = input;
- if (data.action) {
+ success: function (json) {
+ if (json.action) {
rspamd.alertMessage("alert-success", "Data successfully scanned");
var action = "";
- if (data.action === "clean" || "no action") {
+ if (json.action === "clean" || "no action") {
action = "label-success";
}
- else if (data.action === "rewrite subject" || "add header" || "probable spam") {
+ else if (json.action === "rewrite subject" || "add header" || "probable spam") {
action = "label-warning";
}
- else if (data.action === "spam") {
+ else if (json.action === "spam") {
action = "label-danger";
}
var score = "";
- if (data.score <= data.required_score) {
+ if (json.score <= json.required_score) {
score = "label-success";
}
- else if (data.score >= data.required_score) {
+ else if (json.score >= json.required_score) {
score = "label-danger";
}
$("<tbody id=\"tmpBody\"><tr>" +
- "<td><span class=\"label " + action + "\">" + data.action + "</span></td>" +
- "<td><span class=\"label " + score + "\">" + data.score.toFixed(2) + "/" + data.required_score.toFixed(2) + "</span></td>" +
+ "<td><span class=\"label " + action + "\">" + json.action + "</span></td>" +
+ "<td><span class=\"label " + score + "\">" + json.score.toFixed(2) + "/" + json.required_score.toFixed(2) + "</span></td>" +
"</tr></tbody>")
.insertAfter("#scanOutput thead");
var sym_desc = {};
var nsym = 0;
- $.each(data.symbols, function (i, item) {
+ $.each(json.symbols, function (i, item) {
if (typeof item === "object") {
var sym_id = "sym_" + nsym;
if (item.description) {