if (Object.prototype.hasOwnProperty.call(tables, "history") &&
version === prevVersion) {
tables.history.rows.load(items);
- if (version) { // Non-legacy
- // Is there a way to get an event when all rows are loaded?
- rspamd.waitForRowsDisplayed("history", items.length, function () {
- rspamd.drawTooltips();
- });
- }
} else {
rspamd.destroyTable("history");
// Is there a way to get an event when the table is destroyed?
var timer_id = [];
var locale = null;
var selData = null; // Graph's dataset selector state
- var symbolDescriptions = {};
NProgress.configure({
minimum: 0.01,
}, (id === "#autoRefresh") ? 0 : 1000);
}
- function drawTooltips() {
- // Update symbol description tooltips
- $.each(symbolDescriptions, function (key, description) {
- $("abbr[data-sym-key=" + key + "]").tooltip({
- placement: "bottom",
- html: true,
- title: description
- });
- });
- }
-
function getPassword() {
return sessionStorage.getItem("Password");
}
tabClick("#" + $("#navBar > ul > .nav-item > .nav-link.active").attr("id"));
});
+ $("body").tooltip({
+ selector: ".symbol-default abbr[title]",
+ placement: "left",
+ html: true
+ });
+
// Radio buttons
$(document).on("click", "input:radio[name=\"clusterName\"]", function () {
if (!this.disabled) {
// Scan and History shared functions
- ui.drawTooltips = drawTooltips;
ui.unix_time_format = unix_time_format;
ui.set_page_size = set_page_size;
var cell_val = sort_symbols(ui.symbols[table][i], compare_function);
row.cells[symbolsCol].val(cell_val, false, true);
});
- drawTooltips();
}
$("#selSymOrder_" + table).unbind().change(function () {
filtering: FooTable.actionFilter
},
on: {
- "ready.ft.table": drawTooltips,
- "after.ft.sorting": drawTooltips,
- "after.ft.paging": drawTooltips,
- "after.ft.filtering": drawTooltips,
"expand.ft.row": function (e, ft, row) {
setTimeout(function () {
var detail_row = row.$el.next();
}
rspamd.preprocess_item(rspamd, item);
- Object.keys(item.symbols).forEach(function (key) {
- var sym = item.symbols[key];
+ Object.values(item.symbols).forEach(function (sym) {
sym.str = '<span class="symbol-default ' + get_symbol_class(sym.name, sym.score) + '"><strong>';
if (sym.description) {
- sym.str += '<abbr data-sym-key="' + key + '">' +
- sym.name + "</abbr></strong> (" + sym.score + ")</span>";
- // Store description for tooltip
- symbolDescriptions[key] = sym.description;
+ sym.str += '<abbr title="' + sym.description + '">' + sym.name + "</abbr>";
} else {
- sym.str += sym.name + "</strong> (" + sym.score + ")</span>";
+ sym.str += sym.name;
}
+ sym.str += "</strong> (" + sym.score + ")</span>";
if (sym.options) {
sym.str += " [" + sym.options.join(",") + "]";