From: Alexander Moisseev Date: Fri, 6 Jul 2018 06:57:07 +0000 (+0300) Subject: [Minor] JS: Remove redundant quotes X-Git-Tag: 1.7.8~26^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3c4028f4da8e84ffb54198d42637778a3becb69;p=thirdparty%2Frspamd.git [Minor] JS: Remove redundant quotes around object literal property names --- diff --git a/.eslintrc.json b/.eslintrc.json index 1805d192c9..4231abb4bf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -34,7 +34,7 @@ "prefer-arrow-callback": "off", "prefer-destructuring": "off", "prefer-template": "off", - // "quote-props" : ["error", "consistent-as-needed"], + "quote-props" : ["error", "consistent-as-needed"], "require-jsdoc": "off", "space-before-function-paren": ["error", { "anonymous": "always", @@ -84,7 +84,6 @@ "no-use-before-define": "off", "one-var-declaration-per-line": "off", "prefer-spread": "off", - "quote-props": "off", "sort-keys": "off", "sort-vars": "off", "strict": "off" diff --git a/interface/js/app/config.js b/interface/js/app/config.js index 02f54c7f06..4f910ae8e9 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -269,7 +269,7 @@ define(["jquery"], var id = $(form).attr("id"); var data = $("#" + id).find("textarea").val(); rspamd.queryNeighbours(action, save_map_success, save_map_error, "POST", { - "Map": id, + Map: id, }, { data: data, dataType: "text", diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index f5258c5ab7..9418c7cfbc 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -263,7 +263,7 @@ define(["jquery", "d3evolution", "footable"], url: neighbours[checked_server].url + "graph", jsonp: false, data: { - "type": type + type: type }, beforeSend: function (xhr) { xhr.setRequestHeader("Password", rspamd.getPassword()); diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 6df0335300..b6399894af 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -102,10 +102,10 @@ define(["jquery", "footable", "humanize"], } item.score = { - "options": { - "sortValue": item.score + options: { + sortValue: item.score }, - "value": score_content + value: score_content }; if (item.user == null) { @@ -179,18 +179,18 @@ define(["jquery", "footable", "humanize"], .map(function (e) { return e.str; }) .join("
\n"); item.time = { - "value": unix_time_format(item.unix_time), - "options": { - "sortValue": item.unix_time + value: unix_time_format(item.unix_time), + options: { + sortValue: item.unix_time } }; var scan_time = item.time_real.toFixed(3) + " / " + item.time_virtual.toFixed(3); item.scan_time = { - "options": { - "sortValue": item.time_real + options: { + sortValue: item.time_real }, - "value": scan_time + value: scan_time }; item.id = item["message-id"]; @@ -221,15 +221,15 @@ define(["jquery", "footable", "humanize"], item.time = unix_time_format(item.unix_time); preprocess_item(item); item.scan_time = { - "options": { - "sortValue": item.scan_time + options: { + sortValue: item.scan_time }, - "value": item.scan_time + value: item.scan_time }; item.time = { - "value": unix_time_format(item.unix_time), - "options": { - "sortValue": item.unix_time + value: unix_time_format(item.unix_time), + options: { + sortValue: item.unix_time } }; @@ -241,9 +241,9 @@ define(["jquery", "footable", "humanize"], function columns_v2() { return [{ - "name": "id", - "title": "ID", - "style": { + name: "id", + title: "ID", + style: { "font-size": "11px", "minWidth": 130, "overflow": "hidden", @@ -252,106 +252,106 @@ define(["jquery", "footable", "humanize"], "whiteSpace": "normal" } }, { - "name": "ip", - "title": "IP address", - "breakpoints": "xs sm md", - "style": { + name: "ip", + title: "IP address", + breakpoints: "xs sm md", + style: { "font-size": "11px", "minWidth": 88 } }, { - "name": "sender_mime", - "title": "[Envelope From] From", - "breakpoints": "xs sm md", - "style": { + name: "sender_mime", + title: "[Envelope From] From", + breakpoints: "xs sm md", + style: { "font-size": "11px", "minWidth": 100, "maxWidth": 200, "word-wrap": "break-word" } }, { - "name": "rcpt_mime_short", - "title": "[Envelope To] To/Cc/Bcc", - "breakpoints": "xs sm md", - "style": { + name: "rcpt_mime_short", + title: "[Envelope To] To/Cc/Bcc", + breakpoints: "xs sm md", + style: { "font-size": "11px", "minWidth": 100, "maxWidth": 200, "word-wrap": "break-word" } }, { - "name": "rcpt_mime", - "title": "[Envelope To] To/Cc/Bcc", - "breakpoints": "all", - "style": { + name: "rcpt_mime", + title: "[Envelope To] To/Cc/Bcc", + breakpoints: "all", + style: { "font-size": "11px", "word-wrap": "break-word" } }, { - "name": "subject", - "title": "Subject", - "breakpoints": "xs sm md", - "style": { + name: "subject", + title: "Subject", + breakpoints: "xs sm md", + style: { "font-size": "11px", "word-break": "break-all", "minWidth": 150 } }, { - "name": "action", - "title": "Action", - "style": { + name: "action", + title: "Action", + style: { "font-size": "11px", "minwidth": 82 } }, { - "name": "score", - "title": "Score", - "style": { + name: "score", + title: "Score", + style: { "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", - "breakpoints": "all", - "style": { + name: "symbols", + title: "Symbols", + breakpoints: "all", + style: { "font-size": "11px", "width": 550, "maxWidth": 550 } }, { - "name": "size", - "title": "Msg size", - "breakpoints": "xs sm md", - "style": { + name: "size", + title: "Msg size", + breakpoints: "xs sm md", + style: { "font-size": "11px", "minwidth": 50, }, - "formatter": Humanize.compactInteger + formatter: Humanize.compactInteger }, { - "name": "scan_time", - "title": "Scan time", - "breakpoints": "xs sm md", - "style": { + name: "scan_time", + title: "Scan time", + breakpoints: "xs sm md", + style: { "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", - "name": "time", - "title": "Time", - "style": { + sorted: true, + direction: "DESC", + name: "time", + title: "Time", + 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", - "breakpoints": "xs sm md", - "style": { + name: "user", + title: "Authenticated user", + breakpoints: "xs sm md", + style: { "font-size": "11px", "minWidth": 100, "maxWidth": 130, @@ -362,9 +362,9 @@ define(["jquery", "footable", "humanize"], function columns_legacy() { return [{ - "name": "id", - "title": "ID", - "style": { + name: "id", + title: "ID", + style: { "font-size": "11px", "width": 300, "maxWidth": 300, @@ -374,72 +374,72 @@ define(["jquery", "footable", "humanize"], "whiteSpace": "nowrap" } }, { - "name": "ip", - "title": "IP address", - "breakpoints": "xs sm", - "style": { + name: "ip", + title: "IP address", + breakpoints: "xs sm", + style: { "font-size": "11px", "width": 150, "maxWidth": 150 } }, { - "name": "action", - "title": "Action", - "style": { + name: "action", + title: "Action", + style: { "font-size": "11px", "width": 110, "maxWidth": 110 } }, { - "name": "score", - "title": "Score", - "style": { + name: "score", + title: "Score", + style: { "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", - "breakpoints": "all", - "style": { + name: "symbols", + title: "Symbols", + breakpoints: "all", + style: { "font-size": "11px", "width": 550, "maxWidth": 550 } }, { - "name": "size", - "title": "Message size", - "breakpoints": "xs sm", - "style": { + name: "size", + title: "Message size", + breakpoints: "xs sm", + style: { "font-size": "11px", "width": 120, "maxWidth": 120 }, - "formatter": Humanize.compactInteger + formatter: Humanize.compactInteger }, { - "name": "scan_time", - "title": "Scan time", - "breakpoints": "xs sm", - "style": { + name: "scan_time", + title: "Scan time", + breakpoints: "xs sm", + style: { "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", - "name": "time", - "title": "Time", - "style": { + sorted: true, + direction: "DESC", + name: "time", + title: "Time", + 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", - "breakpoints": "xs sm", - "style": { + name: "user", + title: "Authenticated user", + breakpoints: "xs sm", + style: { "font-size": "11px", "width": 200, "maxWidth": 200 @@ -448,13 +448,13 @@ define(["jquery", "footable", "humanize"], } var process_functions = { - "2": process_history_v2, - "legacy": process_history_legacy + 2: process_history_v2, + legacy: process_history_legacy }; var columns = { - "2": columns_v2, - "legacy": columns_legacy + 2: columns_v2, + legacy: columns_legacy }; function process_history_data(data) { @@ -495,14 +495,14 @@ define(["jquery", "footable", "humanize"], $create : function () { this._super(); var self = this, $form_grp = $("
", { - "class" : "form-group" + class : "form-group" }).append($("