Browse Source

[Minor] Use consistent brace style for blocks (1tbs)

tags/1.7.9
Alexander Moisseev 5 years ago
parent
commit
ab72e30124

+ 1
- 1
.eslintrc.json View File

@@ -8,6 +8,7 @@
},
"rules": {
"array-bracket-newline": ["error", "consistent"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "off",
"capitalized-comments": "off",
"comma-dangle": ["error", "only-multiline"],
@@ -49,7 +50,6 @@
// Temporarily disabled rules
"array-callback-return": "off",
"array-element-newline": "off",
"brace-style": "off",
"callback-return": "off",
"consistent-return": "off",
"consistent-this": "off",

+ 1
- 2
interface/js/app/graph.js View File

@@ -241,8 +241,7 @@ define(["jquery", "d3evolution", "footable"],
});
updateWidgets(data);
});
}
else {
} else {
updateWidgets(neighbours_data[0]);
}
},

+ 3
- 6
interface/js/app/history.js View File

@@ -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",

+ 7
- 14
interface/js/app/rspamd.js View File

@@ -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");
}
}

+ 1
- 2
interface/js/app/stats.js View File

@@ -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);
}

+ 2
- 4
interface/js/app/symbols.js View File

@@ -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);
}
});

+ 3
- 6
interface/js/app/upload.js View File

@@ -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>" +

Loading…
Cancel
Save