aboutsummaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-30 17:46:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-30 17:46:44 +0100
commit4317665c28b1714320979d4fde6c3fc82733d520 (patch)
tree98078734fa4d9c05c78f987277a51203407a90d1 /interface
parent6d82717e74e4ef03739268ed6f260587be7af66b (diff)
downloadrspamd-4317665c28b1714320979d4fde6c3fc82733d520.tar.gz
rspamd-4317665c28b1714320979d4fde6c3fc82733d520.zip
[Feature] Show symbols description in scan output
Diffstat (limited to 'interface')
-rw-r--r--interface/js/rspamd.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js
index f968e9444..fbb798b5f 100644
--- a/interface/js/rspamd.js
+++ b/interface/js/rspamd.js
@@ -902,15 +902,31 @@
'<td><span class="label ' + score + '">' + data.score.toFixed(2) + '/' + data.required_score.toFixed(2) + '</span></td>' +
'</tr></tbody>')
.insertAfter('#scanOutput thead');
+ var sym_desc = {};
+ var nsym = 0;
+
$.each(data, function (i, item) {
if (typeof item == 'object') {
- items.push('<div class="cell-overflow" tabindex="1">' + item.name + ': ' + item.score.toFixed(2) + '</div>');
+ var sym_id = "sym_" + nsym;
+ if (item.description) {
+ sym_desc[sym_id] = item.description;
+ }
+ items.push('<div class="cell-overflow" tabindex="1"><abbr id="' + sym_id +
+ '">' + item.name + '</abbr>: ' + item.score.toFixed(2) + '</div>');
+ nsym ++;
}
});
$('<td/>', { id: 'tmpSymbols', html: items.join('') }).appendTo('#scanResult');
$('#tmpSymbols').insertAfter('#tmpBody td:last').removeAttr('id');
$('#tmpBody').removeAttr('id');
$('#scanResult').show();
+ // Show tooltips
+ $.each(sym_desc, function(k, v) {
+ $('#' + k).tooltip({
+ "placement": "bottom",
+ "title": v
+ });
+ });
$('html, body').animate({
scrollTop: $('#scanResult').offset().top
}, 1000);