@@ -145,7 +145,7 @@ define(["jquery"], | |||
var $tbody = $("<tbody>"); | |||
$.each(data, function (i, item) { | |||
var label = ((item.editable === false || rspamd.read_only)) | |||
var label = (item.editable === false || rspamd.read_only) | |||
? "<span class=\"label label-default\">Read</span>" | |||
: "<span class=\"label label-default\">Read</span> <span class=\"label label-success\">Write</span>"; | |||
var $tr = $("<tr>"); | |||
@@ -179,7 +179,7 @@ define(["jquery"], | |||
success: function (data) { | |||
var disabled = ""; | |||
var text = data[0].data; | |||
if ((item.editable === false || rspamd.read_only)) { | |||
if (item.editable === false || rspamd.read_only) { | |||
disabled = "disabled=\"disabled\""; | |||
} | |||
@@ -244,7 +244,7 @@ define(["jquery", "d3evolution", "footable"], | |||
action.map(function (d, i) { | |||
return { | |||
x: d.x, | |||
y: ((res[j][i].y === null) ? d.y : res[j][i].y + d.y) | |||
y: (res[j][i].y === null) ? d.y : res[j][i].y + d.y | |||
}; | |||
}) | |||
); |
@@ -45,7 +45,7 @@ define(["jquery", "footable", "humanize"], | |||
var symbolDescriptions = {}; | |||
var escapeHTML = function (string) { | |||
return (String(string)).replace(htmlEscaper, function (match) { | |||
return String(string).replace(htmlEscaper, function (match) { | |||
return htmlEscapes[match]; | |||
}); | |||
}; | |||
@@ -83,7 +83,7 @@ define(["jquery", "footable", "humanize"], | |||
}); | |||
break; | |||
default: | |||
if (typeof (item[prop]) === "string") { | |||
if (typeof item[prop] === "string") { | |||
item[prop] = escapeHTML(item[prop]); | |||
} | |||
} |
@@ -210,7 +210,7 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config, | |||
function errorMessage() { | |||
alertMessage("alert-error", neighbours_status[ind].name + " > " + | |||
(o.errorMessage ? o.errorMessage : "Request failed") + | |||
(errorThrown ? (": " + errorThrown) : "")); | |||
(errorThrown ? ": " + errorThrown : "")); | |||
} | |||
if (o.error) { | |||
o.error(neighbours_status[ind], |
@@ -59,8 +59,8 @@ define(["jquery", "footable"], | |||
}); | |||
} | |||
function decimalStep(number) { | |||
var digits = ((Number(number)).toFixed(20)).replace(/^-?\d*\.?|0+$/g, "").length; | |||
return (digits === 0 || digits > 4) ? 0.1 : 1.0 / (Math.pow(10, digits)); | |||
var digits = Number(number).toFixed(20).replace(/^-?\d*\.?|0+$/g, "").length; | |||
return (digits === 0 || digits > 4) ? 0.1 : 1.0 / Math.pow(10, digits); | |||
} | |||
function process_symbols_data(data) { | |||
var items = []; |