]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] JS: Remove redundant quotes
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 6 Jul 2018 06:57:07 +0000 (09:57 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 6 Jul 2018 06:57:07 +0000 (09:57 +0300)
around object literal property names

.eslintrc.json
interface/js/app/config.js
interface/js/app/graph.js
interface/js/app/history.js
interface/js/app/rspamd.js
interface/js/app/stats.js
interface/js/app/symbols.js
interface/js/app/upload.js

index 1805d192c904f5bb5830d767d69dcacd33448d0b..4231abb4bfd24afb478fdbdb9da0295d6f8fc3c3 100644 (file)
@@ -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"
index 02f54c7f06cb00b1c4134bf21f2c49a3597a4116..4f910ae8e9786a790493af7a1c7eefc919949a94 100644 (file)
@@ -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",
index f5258c5ab73daa6d526a36570dd7c7b3c57ed59c..9418c7cfbcdcbbcddd0d368abe44689a1eea8ceb 100644 (file)
@@ -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());
index 6df0335300502233bd3c2508cb38f7768e6495e4..b6399894af3aed47dea95d3e052d2efd74bf7ada 100644 (file)
@@ -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("<br>\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 = $("<div/>", {
-                        "class" : "form-group"
+                        class : "form-group"
                     }).append($("<label/>", {
-                        "class" : "sr-only",
+                        class : "sr-only",
                         text : "Action"
                     })).prependTo(self.$form);
 
                     self.$action = $("<select/>", {
-                        "class" : "form-control"
+                        class : "form-control"
                     }).on("change", {
                         self : self
                     }, self._onStatusDropdownChanged).append(
@@ -546,9 +546,9 @@ define(["jquery", "footable", "humanize"],
             // Update symbol description tooltips
                 $.each(symbolDescriptions, function (key, description) {
                     $("abbr[data-sym-key=" + key + "]").tooltip({
-                        "placement": "bottom",
-                        "html": true,
-                        "title": description
+                        placement: "bottom",
+                        html: true,
+                        title: description
                     });
                 });
             };
@@ -585,25 +585,25 @@ define(["jquery", "footable", "humanize"],
 
                         var items = process_history_data(data);
                         ft.history = FooTable.init("#historyTable", {
-                            "columns": get_history_columns(data),
-                            "rows": items,
-                            "paging": {
-                                "enabled": true,
-                                "limit": 5,
-                                "size": 25
+                            columns: get_history_columns(data),
+                            rows: items,
+                            paging: {
+                                enabled: true,
+                                limit: 5,
+                                size: 25
                             },
-                            "filtering": {
-                                "enabled": true,
-                                "position": "left",
-                                "connectors": false
+                            filtering: {
+                                enabled: true,
+                                position: "left",
+                                connectors: false
                             },
-                            "sorting": {
-                                "enabled": true
+                            sorting: {
+                                enabled: true
                             },
-                            "components": {
-                                "filtering": FooTable.actionFilter
+                            components: {
+                                filtering: FooTable.actionFilter
                             },
-                            "on": {
+                            on: {
                                 "ready.ft.table": drawTooltips,
                                 "after.ft.sorting": drawTooltips,
                                 "after.ft.paging": drawTooltips,
@@ -630,25 +630,25 @@ define(["jquery", "footable", "humanize"],
                     success: function (data) {
                         var items = process_history_data(data);
                         ft.history = FooTable.init("#historyTable", {
-                            "columns": get_history_columns(data),
-                            "rows": items,
-                            "paging": {
-                                "enabled": true,
-                                "limit": 5,
-                                "size": 25
+                            columns: get_history_columns(data),
+                            rows: items,
+                            paging: {
+                                enabled: true,
+                                limit: 5,
+                                size: 25
                             },
-                            "filtering": {
-                                "enabled": true,
-                                "position": "left",
-                                "connectors": false
+                            filtering: {
+                                enabled: true,
+                                position: "left",
+                                connectors: false
                             },
-                            "sorting": {
-                                "enabled": true
+                            sorting: {
+                                enabled: true
                             },
-                            "components": {
-                                "filtering": FooTable.actionFilter
+                            components: {
+                                filtering: FooTable.actionFilter
                             },
-                            "on": {
+                            on: {
                                 "ready.ft.table": drawTooltips,
                                 "after.ft.sorting": drawTooltips,
                                 "after.ft.paging": drawTooltips,
@@ -717,27 +717,27 @@ define(["jquery", "footable", "humanize"],
                 );
             });
             ft.errors = FooTable.init("#errorsLog", {
-                "columns": [
-                    {"sorted": true, "direction": "DESC", "name":"ts", "title":"Time", "style":{"font-size":"11px", "width":300, "maxWidth":300}},
-                    {"name":"type", "title":"Worker type", "breakpoints":"xs sm", "style":{"font-size":"11px", "width":150, "maxWidth":150}},
-                    {"name":"pid", "title":"PID", "breakpoints":"xs sm", "style":{"font-size":"11px", "width":110, "maxWidth":110}},
-                    {"name":"module", "title":"Module", "style":{"font-size":"11px"}},
-                    {"name":"id", "title":"Internal ID", "style":{"font-size":"11px"}},
-                    {"name":"message", "title":"Message", "breakpoints":"xs sm", "style":{"font-size":"11px"}},
+                columns: [
+                    {sorted: true, direction: "DESC", name:"ts", title:"Time", style:{"font-size":"11px", "width":300, "maxWidth":300}},
+                    {name:"type", title:"Worker type", breakpoints:"xs sm", style:{"font-size":"11px", "width":150, "maxWidth":150}},
+                    {name:"pid", title:"PID", breakpoints:"xs sm", style:{"font-size":"11px", "width":110, "maxWidth":110}},
+                    {name:"module", title:"Module", style:{"font-size":"11px"}},
+                    {name:"id", title:"Internal ID", style:{"font-size":"11px"}},
+                    {name:"message", title:"Message", breakpoints:"xs sm", style:{"font-size":"11px"}},
                 ],
-                "rows": data,
-                "paging": {
-                    "enabled": true,
-                    "limit": 5,
-                    "size": 25
+                rows: data,
+                paging: {
+                    enabled: true,
+                    limit: 5,
+                    size: 25
                 },
-                "filtering": {
-                    "enabled": true,
-                    "position": "left",
-                    "connectors": false
+                filtering: {
+                    enabled: true,
+                    position: "left",
+                    connectors: false
                 },
-                "sorting": {
-                    "enabled": true
+                sorting: {
+                    enabled: true
                 }
             });
         }
index 0a69fca9974045b80a45d86219afda72c41cf71e..c60c5889d10055c7d99c9403443e99d5167f4e2a 100644 (file)
@@ -466,79 +466,79 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
         } else {
             obj = new d3pie(id,
                 $.extend({}, {
-                    "header": {
-                        "title": {
-                            "text": "Rspamd filter stats",
-                            "fontSize": 24,
-                            "font": "open sans"
+                    header: {
+                        title: {
+                            text: "Rspamd filter stats",
+                            fontSize: 24,
+                            font: "open sans"
                         },
-                        "subtitle": {
-                            "color": "#999999",
-                            "fontSize": 12,
-                            "font": "open sans"
+                        subtitle: {
+                            color: "#999999",
+                            fontSize: 12,
+                            font: "open sans"
                         },
-                        "titleSubtitlePadding": 9
+                        titleSubtitlePadding: 9
                     },
-                    "footer": {
-                        "color": "#999999",
-                        "fontSize": 10,
-                        "font": "open sans",
-                        "location": "bottom-left"
+                    footer: {
+                        color: "#999999",
+                        fontSize: 10,
+                        font: "open sans",
+                        location: "bottom-left"
                     },
-                    "size": {
-                        "canvasWidth": 600,
-                        "canvasHeight": 400,
-                        "pieInnerRadius": "20%",
-                        "pieOuterRadius": "85%"
+                    size: {
+                        canvasWidth: 600,
+                        canvasHeight: 400,
+                        pieInnerRadius: "20%",
+                        pieOuterRadius: "85%"
                     },
-                    "data": {
+                    data: {
                         // "sortOrder": "value-desc",
-                        "content": data.filter(function (elt) {
+                        content: data.filter(function (elt) {
                             return elt.value > 0;
                         })
                     },
-                    "labels": {
-                        "outer": {
-                            "hideWhenLessThanPercentage": 1,
-                            "pieDistance": 30
+                    labels: {
+                        outer: {
+                            hideWhenLessThanPercentage: 1,
+                            pieDistance: 30
                         },
-                        "inner": {
-                            "hideWhenLessThanPercentage": 4
+                        inner: {
+                            hideWhenLessThanPercentage: 4
                         },
-                        "mainLabel": {
-                            "fontSize": 14
+                        mainLabel: {
+                            fontSize: 14
                         },
-                        "percentage": {
-                            "color": "#eeeeee",
-                            "fontSize": 14,
-                            "decimalPlaces": 0
+                        percentage: {
+                            color: "#eeeeee",
+                            fontSize: 14,
+                            decimalPlaces: 0
                         },
-                        "lines": {
-                            "enabled": true
+                        lines: {
+                            enabled: true
                         },
-                        "truncation": {
-                            "enabled": true
+                        truncation: {
+                            enabled: true
                         }
                     },
-                    "tooltips": {
-                        "enabled": true,
-                        "type": "placeholder",
-                        "string": "{label}: {value} ({percentage}%)"
+                    tooltips: {
+                        enabled: true,
+                        type: "placeholder",
+                        string: "{label}: {value} ({percentage}%)"
                     },
-                    "effects": {
-                        "pullOutSegmentOnClick": {
-                            "effect": "back",
-                            "speed": 400,
-                            "size": 8
+                    effects: {
+                        pullOutSegmentOnClick: {
+                            effect: "back",
+                            speed: 400,
+                            size: 8
                         },
-                        "load": {
-                            "effect": "none"
+                        load: {
+                            effect: "none"
                         }
                     },
-                    "misc": {
-                        "gradient": {
-                            "enabled": true,
-                            "percentage": 100
+                    misc: {
+                        gradient: {
+                            enabled: true,
+                            percentage: 100
                         }
                     }
                 }, conf));
index c76f51945551e7666a7baf156adce4b27c0336ee..c75b204410015303458e67b63bb4b0ed0214f611 100644 (file)
@@ -143,30 +143,30 @@ define(["jquery", "d3pie", "humanize"],
             if (creds && creds[checked_server]) {
                 var data = creds[checked_server].data;
                 var new_data = [{
-                    "color" : "#66CC00",
-                    "label" : "Clean",
-                    "data" : data.clean,
-                    "value" : data.clean
+                    color : "#66CC00",
+                    label : "Clean",
+                    data : data.clean,
+                    value : data.clean
                 }, {
-                    "color" : "#BF8040",
-                    "label" : "Temporarily rejected",
-                    "data" : data.soft_reject,
-                    "value" : data.soft_reject
+                    color : "#BF8040",
+                    label : "Temporarily rejected",
+                    data : data.soft_reject,
+                    value : data.soft_reject
                 }, {
-                    "color" : "#FFAD00",
-                    "label" : "Probable spam",
-                    "data" : data.probable,
-                    "value" : data.probable
+                    color : "#FFAD00",
+                    label : "Probable spam",
+                    data : data.probable,
+                    value : data.probable
                 }, {
-                    "color" : "#436EEE",
-                    "label" : "Greylisted",
-                    "data" : data.greylist,
-                    "value" : data.greylist
+                    color : "#436EEE",
+                    label : "Greylisted",
+                    data : data.greylist,
+                    value : data.greylist
                 }, {
-                    "color" : "#FF0000",
-                    "label" : "Rejected",
-                    "data" : data.reject,
-                    "value" : data.reject
+                    color : "#FF0000",
+                    label : "Rejected",
+                    data : data.reject,
+                    value : data.reject
                 }];
 
                 return rspamd.drawPie(pie, "chart", new_data);
index f0bd71be9b9e6d412cc92bfee792ce41d928404b..8b8160913ee1413d55f4a32ce34f946eae70e951 100644 (file)
@@ -175,14 +175,14 @@ define(["jquery", "footable"],
                         $create : function () {
                             this._super();
                             var self = this, $form_grp = $("<div/>", {
-                                "class" : "form-group"
+                                class : "form-group"
                             }).append($("<label/>", {
-                                "class" : "sr-only",
+                                class : "sr-only",
                                 text : "Group"
                             })).prependTo(self.$form);
 
                             self.$group = $("<select/>", {
-                                "class" : "form-control"
+                                class : "form-control"
                             }).on("change", {
                                 self : self
                             }, self._onStatusDropdownChanged).append(
@@ -214,33 +214,33 @@ define(["jquery", "footable"],
                         }
                     });
                     ft.symbols = FooTable.init("#symbolsTable", {
-                        "columns": [
-                            {"sorted": true, "direction": "ASC", "name":"group", "title":"Group", "style":{"font-size":"11px"}},
-                            {"name":"symbol", "title":"Symbol", "style":{"font-size":"11px"}},
-                            {"name":"description", "title":"Description", "breakpoints":"xs sm", "style":{"font-size":"11px"}},
-                            {"name":"weight", "title":"Score", "style":{"font-size":"11px"}},
-                            {"name":"frequency", "title":"Frequency", "breakpoints":"xs sm", "style":{"font-size":"11px"}, "sortValue": function (value) { return Number(value).toFixed(2); }},
-                            {"name":"time", "title":"Avg. time", "breakpoints":"xs sm", "style":{"font-size":"11px"}},
-                            {"name":"save", "title":"Save", "style":{"font-size":"11px"}},
+                        columns: [
+                            {sorted: true, direction: "ASC", name:"group", title:"Group", style:{"font-size":"11px"}},
+                            {name:"symbol", title:"Symbol", style:{"font-size":"11px"}},
+                            {name:"description", title:"Description", breakpoints:"xs sm", style:{"font-size":"11px"}},
+                            {name:"weight", title:"Score", style:{"font-size":"11px"}},
+                            {name:"frequency", title:"Frequency", breakpoints:"xs sm", style:{"font-size":"11px"}, sortValue: function (value) { return Number(value).toFixed(2); }},
+                            {name:"time", title:"Avg. time", breakpoints:"xs sm", style:{"font-size":"11px"}},
+                            {name:"save", title:"Save", style:{"font-size":"11px"}},
                         ],
-                        "rows": items[0],
-                        "paging": {
-                            "enabled": true,
-                            "limit": 5,
-                            "size": 25
+                        rows: items[0],
+                        paging: {
+                            enabled: true,
+                            limit: 5,
+                            size: 25
                         },
-                        "filtering": {
-                            "enabled": true,
-                            "position": "left",
-                            "connectors": false
+                        filtering: {
+                            enabled: true,
+                            position: "left",
+                            connectors: false
                         },
-                        "sorting": {
-                            "enabled": true
+                        sorting: {
+                            enabled: true
                         },
                         components: {
                             filtering: FooTable.groupFilter
                         },
-                        "on": {
+                        on: {
                             "ready.ft.table": function () {
                                 if (rspamd.read_only) {
                                     $(".mb-disabled").attr("disabled", true);
index 655a5dfb2856c5cfb773144bbe724af7c6e1bf91..648ee3620a2076be786ab1f46e067c1df6b4528e 100644 (file)
@@ -140,8 +140,8 @@ define(["jquery"],
                         // Show tooltips
                         $.each(sym_desc, function (k, v) {
                             $("#" + k).tooltip({
-                                "placement": "bottom",
-                                "title": v
+                                placement: "bottom",
+                                title: v
                             });
                         });
                         $("html, body").animate({