From 61308eaca28987bcfb0e924ff0509d86b4e7efda Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Thu, 5 Jul 2018 11:16:49 +0300 Subject: [PATCH] [Minor] JS: Add space before parentheses of anonymous functions --- interface/js/app/config.js | 12 +++++----- interface/js/app/graph.js | 8 +++---- interface/js/app/history.js | 44 ++++++++++++++++++------------------- interface/js/app/rspamd.js | 22 +++++++++---------- interface/js/app/stats.js | 6 ++--- interface/js/app/symbols.js | 24 ++++++++++---------- interface/js/app/upload.js | 4 ++-- interface/js/main.js | 4 ++-- 8 files changed, 62 insertions(+), 62 deletions(-) diff --git a/interface/js/app/config.js b/interface/js/app/config.js index 343545d73..02f54c7f0 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -23,7 +23,7 @@ */ define(["jquery"], - function($) { + function ($) { var interface = {}; function save_map_success(rspamd) { @@ -51,7 +51,7 @@ define(["jquery"], error: function (data) { save_map_error(rspamd, "local", null, null, data.statusText); }, - success: function() { save_map_success(rspamd); }, + success: function () { save_map_success(rspamd); }, }); } @@ -222,10 +222,10 @@ define(["jquery"], } } - $("#saveActionsBtn").on("click", function() { + $("#saveActionsBtn").on("click", function () { saveActions(rspamd.queryLocal); }); - $("#saveActionsClusterBtn").on("click", function() { + $("#saveActionsClusterBtn").on("click", function () { saveActions(rspamd.queryNeighbours); }); }, @@ -233,11 +233,11 @@ define(["jquery"], } // @upload edited actions - interface.setup = function(rspamd) { + interface.setup = function (rspamd) { // Modal form for maps $(document).on("click", "[data-toggle=\"modal\"]", function () { var item = $(this).data("item"); - getMapById(rspamd, item).done(function() { + getMapById(rspamd, item).done(function () { $("#modalTitle").html(item.uri); $("#" + item.map).first().show(); $("#modalDialog .progress").hide(); diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index 38c993059..f5258c5ab 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -24,7 +24,7 @@ */ define(["jquery", "d3evolution", "footable"], - function($, D3Evolution, unused) { + function ($, D3Evolution, unused) { var rrd_pie_config = { header: {}, size: { @@ -95,7 +95,7 @@ define(["jquery", "d3evolution", "footable"], interpolate: getSelector("selInterpolate"), convert: getSelector("selConvert"), })); - $("#selYScale").change(function() { + $("#selYScale").change(function () { graph.yScale(this.value); }); $("#selConvert").change(function () { @@ -169,7 +169,7 @@ define(["jquery", "d3evolution", "footable"], var interface = {}; var prevUnit = "msg/s"; - interface.draw = function(rspamd, graphs, neighbours, checked_server, type) { + interface.draw = function (rspamd, graphs, neighbours, checked_server, type) { function updateWidgets(data) { // Autoranging @@ -278,7 +278,7 @@ define(["jquery", "d3evolution", "footable"], }); }; - interface.setup = function() { + interface.setup = function () { // Handling mouse events on overlapping elements $("#rrd-pie").mouseover(function () { $("#rrd-pie").css("z-index", "200"); diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 2c4d87b03..6df033530 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -23,7 +23,7 @@ */ define(["jquery", "footable", "humanize"], - function($, _, Humanize) { + function ($, _, Humanize) { var interface = {}; var ft = {}; var htmlEscapes = { @@ -39,8 +39,8 @@ define(["jquery", "footable", "humanize"], var htmlEscaper = /[&<>"'/`=]/g; var symbolDescriptions = {}; - EscapeHTML = function(string) { - return ("" + string).replace(htmlEscaper, function(match) { + EscapeHTML = function (string) { + return ("" + string).replace(htmlEscaper, function (match) { return htmlEscapes[match]; }); }; @@ -62,7 +62,7 @@ define(["jquery", "footable", "humanize"], escape_HTML_array(item[prop]); break; case "symbols": - Object.keys(item.symbols).map(function(key) { + Object.keys(item.symbols).map(function (key) { var sym = item.symbols[key]; if (!sym.name) { sym.name = key; @@ -154,7 +154,7 @@ define(["jquery", "footable", "humanize"], } preprocess_item(item); - Object.keys(item.symbols).map(function(key) { + Object.keys(item.symbols).map(function (key) { var sym = item.symbols[key]; if (sym.description) { @@ -172,11 +172,11 @@ define(["jquery", "footable", "humanize"], item.symbols[key].str = str; }); item.symbols = Object.keys(item.symbols) - .map(function(key) { + .map(function (key) { return item.symbols[key]; }) .sort(compare) - .map(function(e) { return e.str; }) + .map(function (e) { return e.str; }) .join("
\n"); item.time = { "value": unix_time_format(item.unix_time), @@ -310,7 +310,7 @@ define(["jquery", "footable", "humanize"], "font-size": "11px", "maxWidth": 110 }, - "sortValue": function(val) { return Number(val.options.sortValue); } + "sortValue": function (val) { return Number(val.options.sortValue); } }, { "name": "symbols", "title": "Symbols", @@ -337,7 +337,7 @@ define(["jquery", "footable", "humanize"], "font-size": "11px", "maxWidth": 72 }, - "sortValue": function(val) { return Number(val.options.sortValue); } + "sortValue": function (val) { return Number(val.options.sortValue); } }, { "sorted": true, "direction": "DESC", @@ -346,7 +346,7 @@ define(["jquery", "footable", "humanize"], "style": { "font-size": "11px" }, - "sortValue": function(val) { return Number(val.options.sortValue); } + "sortValue": function (val) { return Number(val.options.sortValue); } }, { "name": "user", "title": "Authenticated user", @@ -397,7 +397,7 @@ define(["jquery", "footable", "humanize"], "font-size": "11px", "maxWidth": 110 }, - "sortValue": function(val) { return Number(val.options.sortValue); } + "sortValue": function (val) { return Number(val.options.sortValue); } }, { "name": "symbols", "title": "Symbols", @@ -425,7 +425,7 @@ define(["jquery", "footable", "humanize"], "font-size": "11px", "maxWidth": 80 }, - "sortValue": function(val) { return Number(val.options.sortValue); } + "sortValue": function (val) { return Number(val.options.sortValue); } }, { "sorted": true, "direction": "DESC", @@ -434,7 +434,7 @@ define(["jquery", "footable", "humanize"], "style": { "font-size": "11px" }, - "sortValue": function(val) { return Number(val.options.sortValue); } + "sortValue": function (val) { return Number(val.options.sortValue); } }, { "name": "user", "title": "Authenticated user", @@ -485,14 +485,14 @@ define(["jquery", "footable", "humanize"], interface.getHistory = function (rspamd, tables, neighbours, checked_server) { FooTable.actionFilter = FooTable.Filtering.extend({ - construct : function(instance) { + construct : function (instance) { this._super(instance); this.actions = ["reject", "add header", "greylist", "no action", "soft reject", "rewrite subject"]; this.def = "Any action"; this.$action = null; }, - $create : function() { + $create : function () { this._super(); var self = this, $form_grp = $("
", { "class" : "form-group" @@ -510,11 +510,11 @@ define(["jquery", "footable", "humanize"], text : self.def })).appendTo($form_grp); - $.each(self.actions, function(i, action) { + $.each(self.actions, function (i, action) { self.$action.append($("