aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-12-10 19:16:21 +0600
committerGitHub <noreply@github.com>2024-12-10 19:16:21 +0600
commit35bb4b244d64b2c3ffd4fa6345d1349e4b5564be (patch)
treed354bc6f38d286bd6d5e8626d8e251af8a090e8e
parent4c978e0512acc7793a88ea9fa0388e847d9faff5 (diff)
parentb7da3792b8abd47bf262f9fdc3bb89f6b424ac77 (diff)
downloadrspamd-35bb4b244d64b2c3ffd4fa6345d1349e4b5564be.tar.gz
rspamd-35bb4b244d64b2c3ffd4fa6345d1349e4b5564be.zip
Merge pull request #5241 from moisseev/webui
[WebUI] Rework symbol description display on hover
-rw-r--r--interface/css/rspamd.css13
-rw-r--r--interface/js/app/libft.js16
2 files changed, 20 insertions, 9 deletions
diff --git a/interface/css/rspamd.css b/interface/css/rspamd.css
index e7c1e91b8..896f92008 100644
--- a/interface/css/rspamd.css
+++ b/interface/css/rspamd.css
@@ -265,6 +265,19 @@ table#symbolsTable input[type="number"] {
background-color: #cddbff;
}
+/* For symbol description display on hover/focus */
+.symbol-default.has-description:not(:focus) strong {
+ text-decoration: underline dotted;
+}
+.symbol-description {
+ display: none;
+ color: #484848;
+}
+.symbol-default:hover .symbol-description,
+.symbol-default:focus .symbol-description {
+ display: unset;
+}
+
.map-link {
display: block;
color: #0088cc;
diff --git a/interface/js/app/libft.js b/interface/js/app/libft.js
index 84ee2667e..7106516a2 100644
--- a/interface/js/app/libft.js
+++ b/interface/js/app/libft.js
@@ -573,17 +573,15 @@ define(["jquery", "app/common", "footable"],
ui.preprocess_item(item);
Object.values(item.symbols).forEach((sym) => {
- sym.str = '<span class="symbol-default ' + get_symbol_class(sym.name, sym.score) + '"><strong>';
-
- if (sym.description) {
- sym.str += '<abbr title="' + sym.description + '">' + sym.name + "</abbr>";
- } else {
- sym.str += sym.name;
- }
- sym.str += "</strong> (" + sym.score + ")</span>";
+ sym.str = `
+<span class="symbol-default ${get_symbol_class(sym.name, sym.score)} ${sym.description ? "has-description" : ""}" tabindex="0">
+ <strong>${sym.name}</strong>
+ ${sym.description ? `<span class="symbol-description"> • ${sym.description}</span>` : ""}
+ (${sym.score})
+</span>`;
if (sym.options) {
- sym.str += " [" + sym.options.join(",") + "]";
+ sym.str += ` [${sym.options.join(",")}]`;
}
});
unsorted_symbols.push(item.symbols);