Frontend optimizations: SVG icons, remove updateFileIcons, unify rendering, scope translatePage
- Replace Font Awesome CDN with inline SVG system (icons.js + MutationObserver) - Remove updateFileIcons() (~140 lines) - redundant with backend icon_class + MutationObserver - Migrate favorites.js and recent.js to use shared ui.renderFolders/renderFiles (eliminate ~260 lines of duplicate rendering + per-item event listeners) - Add view-mode aware click delegation for favorites/recent views - Fix _createFileCard to apply icon_special_class - Add translateElement(root) for scoped i18n translation - Replace full-page translatePage() calls with scoped translateElement() or inline t() - Remove redundant translatePage() calls in shared.js and auth.js - Remove Alpine.js from Service Worker cache
This commit is contained in:
+1
-7
@@ -13,13 +13,7 @@ function checkAuthentication() {
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
// ── i18n ──
|
||||
if (window.i18n && window.i18n.init) {
|
||||
await window.i18n.init();
|
||||
setTimeout(() => {
|
||||
if (window.i18n.translatePage) window.i18n.translatePage();
|
||||
}, 500);
|
||||
}
|
||||
// ── i18n ── (translatePage is called automatically by i18n.js on init)
|
||||
|
||||
function t(key, fallback) {
|
||||
return (window.i18n && window.i18n.t) ? window.i18n.t(key, fallback) : fallback;
|
||||
|
||||
Reference in New Issue
Block a user