diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-07-15 17:26:12 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-07-15 17:26:12 +0300 |
commit | ab72e301244e22f10463bfbf744ad95da4f7e9f9 (patch) | |
tree | bd3c6fee12eb8d3237a25dc00e04827d7d9733bf /interface/js | |
parent | 5771b12d4e02543a2b3e96e095dbcf20f10e7588 (diff) | |
download | rspamd-ab72e301244e22f10463bfbf744ad95da4f7e9f9.tar.gz rspamd-ab72e301244e22f10463bfbf744ad95da4f7e9f9.zip |
[Minor] Use consistent brace style for blocks (1tbs)
Diffstat (limited to 'interface/js')
-rw-r--r-- | interface/js/app/graph.js | 3 | ||||
-rw-r--r-- | interface/js/app/history.js | 9 | ||||
-rw-r--r-- | interface/js/app/rspamd.js | 21 | ||||
-rw-r--r-- | interface/js/app/stats.js | 3 | ||||
-rw-r--r-- | interface/js/app/symbols.js | 6 | ||||
-rw-r--r-- | interface/js/app/upload.js | 9 |
6 files changed, 17 insertions, 34 deletions
diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index c7e0041ea..bb6431056 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -241,8 +241,7 @@ define(["jquery", "d3evolution", "footable"], }); updateWidgets(data); }); - } - else { + } else { updateWidgets(neighbours_data[0]); } }, diff --git a/interface/js/app/history.js b/interface/js/app/history.js index def170334..bfbc83874 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -578,8 +578,7 @@ define(["jquery", "footable", "humanize"], return e.rows; })); data.version = neighbours_data[0].version; - } - else { + } else { // Legacy version data = [].concat.apply([], neighbours_data); } @@ -616,8 +615,7 @@ define(["jquery", "footable", "humanize"], delete ft.history; } }); - } - else { + } else { $.ajax({ dataType: "json", url: neighbours[checked_server].url + "history", @@ -688,8 +686,7 @@ define(["jquery", "footable", "humanize"], ui.getHistory(rspamd, tables, neighbours, checked_server); ui.getErrors(rspamd, tables, neighbours, checked_server); }); - } - else { + } else { $.ajax({ dataType: "json", type: "GET", diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 97fd4ebb7..5d2fd682a 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -247,8 +247,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, $("#learning_nav").hide(); $("#resetHistory").attr("disabled", true); $("#errors-history").hide(); - } - else { + } else { ui.read_only = false; $("#learning_nav").show(); $("#resetHistory").removeAttr("disabled", true); @@ -293,8 +292,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, $("#learning_nav").hide(); $("#resetHistory").attr("disabled", true); $("#errors-history").hide(); - } - else { + } else { ui.read_only = false; $("#learning_nav").show(); $("#resetHistory").removeAttr("disabled", true); @@ -332,16 +330,14 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, success: function (data) { if (on_success) { on_success(data); - } - else { + } else { alertMessage("alert-success", "Data saved"); } }, error: function (jqXHR, textStatus, errorThrown) { if (on_error) { on_error("local", jqXHR, textStatus, errorThrown); - } - else { + } else { alertMessage("alert-error", "Cannot receive data: " + errorThrown); } } @@ -412,8 +408,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, if (neighbours_status.every(function (elt) { return elt.checked; })) { if (on_success) { on_success(neighbours_status); - } - else { + } else { alertMessage("alert-success", "Request completed"); } } @@ -424,8 +419,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, if (on_error) { on_error(neighbours_status[ind], jqXHR, textStatus, errorThrown); - } - else { + } else { alertMessage("alert-error", "Cannot receive data from " + neighbours_status[ind].host + ": " + errorThrown); } @@ -433,8 +427,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, function (elt) { return elt.checked; })) { if (on_success) { on_success(neighbours_status); - } - else { + } else { alertMessage("alert-success", "Request completed"); } } diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js index 65e6f2772..c41934200 100644 --- a/interface/js/app/stats.js +++ b/interface/js/app/stats.js @@ -126,8 +126,7 @@ define(["jquery", "d3pie", "humanize"], if (checked_server === key) { $("#clusterTable tbody [value=\"" + key + "\"]").prop("checked", true); $("#selSrv [value=\"" + key + "\"]").prop("selected", true); - } - else if (!val.status) { + } else if (!val.status) { $("#clusterTable tbody [value=\"" + key + "\"]").prop("disabled", true); $("#selSrv [value=\"" + key + "\"]").prop("disabled", true); } diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js index 71d577617..237a10d6a 100644 --- a/interface/js/app/symbols.js +++ b/interface/js/app/symbols.js @@ -52,8 +52,7 @@ define(["jquery", "footable"], data: JSON.stringify(values), dataType: "json", }); - } - else { + } else { $.ajax({ data: JSON.stringify(values), dataType: "json", @@ -148,8 +147,7 @@ define(["jquery", "footable"], if (exp > 0) { item.frequency = item.frequency.toFixed(2) + "e-" + exp; - } - else { + } else { item.frequency = item.frequency.toFixed(2); } }); diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js index 3fcfc3aad..064cadc56 100644 --- a/interface/js/app/upload.js +++ b/interface/js/app/upload.js @@ -96,19 +96,16 @@ define(["jquery"], if (json.action === "clean" || "no action") { action = "label-success"; - } - else if (json.action === "rewrite subject" || "add header" || "probable spam") { + } else if (json.action === "rewrite subject" || "add header" || "probable spam") { action = "label-warning"; - } - else if (json.action === "spam") { + } else if (json.action === "spam") { action = "label-danger"; } var score = ""; if (json.score <= json.required_score) { score = "label-success"; - } - else if (json.score >= json.required_score) { + } else if (json.score >= json.required_score) { score = "label-danger"; } $("<tbody id=\"tmpBody\"><tr>" + |