From 454c726297bbe5dd81af705766730f8490f43d65 Mon Sep 17 00:00:00 2001 From: xadyz1 Date: Sun, 26 Jul 2026 22:00:39 +0100 Subject: [PATCH] style: replace emojis with SVGs in widgets and activity log --- frontend/js/views/activity.js | 27 ++++++++++++++++++--------- frontend/js/views/widgets.js | 22 +++++++++++----------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/frontend/js/views/activity.js b/frontend/js/views/activity.js index 42c770d..870afe5 100644 --- a/frontend/js/views/activity.js +++ b/frontend/js/views/activity.js @@ -72,15 +72,24 @@ export async function render(container) { } function getActionIcon(action) { - if (!action) return '📄'; - if (action.includes('DELETE')) return '🗑'; - if (action.includes('POST') && action.includes('content')) return '📤'; - if (action.includes('POST') && action.includes('provision')) return '🔗'; - if (action.includes('POST') && action.includes('assignment')) return '📋'; - if (action.includes('alert')) return '🔔'; - if (action.includes('PUT')) return '✎'; - if (action.includes('POST')) return '➕'; - return '📄'; + const svgText = ''; + const svgTrash = ''; + const svgEdit = ''; + const svgPlus = ''; + const svgBell = ''; + const svgLink = ''; + const svgUpload = ''; + const svgClip = ''; + + if (!action) return svgText; + if (action.includes('DELETE')) return svgTrash; + if (action.includes('POST') && action.includes('content')) return svgUpload; + if (action.includes('POST') && action.includes('provision')) return svgLink; + if (action.includes('POST') && action.includes('assignment')) return svgClip; + if (action.includes('alert')) return svgBell; + if (action.includes('PUT')) return svgEdit; + if (action.includes('POST')) return svgPlus; + return svgText; } // Action verbs are user-visible; translate them through t() so they switch diff --git a/frontend/js/views/widgets.js b/frontend/js/views/widgets.js index 1c1430e..1b19977 100644 --- a/frontend/js/views/widgets.js +++ b/frontend/js/views/widgets.js @@ -8,17 +8,17 @@ const API = (url, opts = {}) => fetch('/api' + url, { headers: { 'Content-Type': // language with the rest of the UI. const WIDGET_TYPES = ['clock', 'weather', 'rss', 'text', 'webpage', 'social', 'directory-board', 'directory-search', 'transition', 'crypto', 'world-clock']; const WIDGET_ICONS = { - clock: '🕓', - weather: '⛅', - rss: '📰', - text: '📝', - webpage: '🌐', - social: '💬', - 'directory-board': '🏢', - 'directory-search': '🔍', - transition: '🎬', - crypto: '₿', - 'world-clock': '🌎', + 'clock': '', + 'weather': '', + 'rss': '', + 'text': '', + 'webpage': '', + 'social': '', + 'transition': '', + 'directory-board': '', + 'directory-search': '', + 'crypto': '', + 'world-clock': '' }; const widgetTypeName = (id) => { const n = t(`widget.type.${id.replace(/-/g, '_')}.name`); return n && !n.includes('widget.type') ? n : (id === 'crypto' ? 'Live Crypto' : (id === 'world-clock' ? 'World Clock' : id)); }; const widgetTypeDesc = (id) => { const n = t(`widget.type.${id.replace(/-/g, '_')}.desc`); return n && !n.includes('widget.type') ? n : (id === 'crypto' ? 'Live cryptocurrency ticker' : (id === 'world-clock' ? 'Minimal multi-timezone clock' : '')); };