ui: add community overlay slots

This commit is contained in:
github-ops
2026-05-15 16:55:50 +00:00
parent 42312ff76f
commit 3eeac67634
8 changed files with 178 additions and 6 deletions
+22 -4
View File
@@ -193,6 +193,19 @@ async function loadCapabilities() {
}
}
async function renderOverlaySlots() {
if (!window.CrankOverlay || typeof window.CrankOverlay.render !== 'function') {
return;
}
await (window.whenWorkspacesReady ? window.whenWorkspacesReady() : Promise.resolve());
await window.CrankOverlay.render(document, {
workspace: window.getCurrentWorkspace ? window.getCurrentWorkspace() : null,
capabilities: settingsCapabilities,
locale: localStorage.getItem('crank_lang') || 'en',
});
}
function bindProfileSave() {
var button = document.getElementById('settings-profile-save-btn');
if (!button || button.dataset.bound === 'true') {
@@ -418,12 +431,17 @@ async function loadWorkspaceSettings() {
}
}
document.addEventListener('DOMContentLoaded', function () {
async function initSettingsPage() {
injectLanguageSwitcher();
bindSectionNavigation();
loadProfile();
loadCapabilities();
await loadProfile();
await loadCapabilities();
bindProfileSave();
bindPasswordSave();
loadWorkspaceSettings();
await loadWorkspaceSettings();
await renderOverlaySlots();
}
document.addEventListener('DOMContentLoaded', function () {
void initSettingsPage();
});