Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(client): set up body classes
Elian Doran688d19747211
diff --git a/apps/client/src/desktop.html b/apps/client/src/desktop.htmlindex 2d03c2ce1a..d4b7b190ca 100644--- a/apps/client/src/desktop.html+++ b/apps/client/src/desktop.html@@ -30,6 +30,7 @@await setupGlob();loadStylesheets();loadIcons();+ setBodyAttributes();await loadScripts();}@@ -74,6 +75,26 @@document.head.appendChild(styleEl);}+ function setBodyAttributes() {+ const { device, headingStyle, layoutOrientation, platform, isElectron, hasNativeTitleBar, hasBackgroundEffects, currentLocale } = window.glob;+ const classesToSet = [+ device,+ `heading-style-${headingStyle}`,+ `layout-${layoutOrientation}`,+ `platform-${platform}`,+ isElectron && "isElectron",+ hasNativeTitleBar && "native-titlebar",+ hasBackgroundEffects && "background-effects"+ ].filter(Boolean);++ for (const classToSet of classesToSet) {+ document.body.classList.add(classToSet);+ }++ document.body.lang = currentLocale.id;+ document.body.dir = currentLocale.rtl ? "rtl" : "ltr";+ }+async function loadScripts() {const assetPath = glob.assetPath;await import(`./${assetPath}/runtime.js`);diff --git a/apps/server/src/assets/views/desktop.ejs b/apps/server/src/assets/views/desktop.ejsindex fd79d957db..44e6ee0ff0 100644--- a/apps/server/src/assets/views/desktop.ejs+++ b/apps/server/src/assets/views/desktop.ejs@@ -1,8 +1,6 @@<!DOCTYPE html><html lang="en"><body- class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %> <%= hasBackgroundEffects ? 'background-effects' : '' %>"- lang="<%= currentLocale.id %>" dir="<%= currentLocale.rtl ? 'rtl' : 'ltr' %>"><link href="<%= assetPath %>/stylesheets/ckeditor-theme.css" rel="stylesheet">