From: Vsevolod Stakhov Date: Thu, 30 Jun 2016 16:46:44 +0000 (+0100) Subject: [Feature] Show symbols description in scan output X-Git-Tag: 1.3.0~206 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4317665c28b1714320979d4fde6c3fc82733d520;p=rspamd.git [Feature] Show symbols description in scan output --- 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 @@ '' + data.score.toFixed(2) + '/' + data.required_score.toFixed(2) + '' + '') .insertAfter('#scanOutput thead'); + var sym_desc = {}; + var nsym = 0; + $.each(data, function (i, item) { if (typeof item == 'object') { - items.push('
' + item.name + ': ' + item.score.toFixed(2) + '
'); + var sym_id = "sym_" + nsym; + if (item.description) { + sym_desc[sym_id] = item.description; + } + items.push('
' + item.name + ': ' + item.score.toFixed(2) + '
'); + nsym ++; } }); $('', { 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);