diff --git a/docs/public/editor/editor.js b/docs/public/editor/editor.js index 876cd57e3c..2f7a33d413 100644 --- a/docs/public/editor/editor.js +++ b/docs/public/editor/editor.js @@ -38,7 +38,6 @@ const editorMount = $('editorMount'); const outputPlaceholder = $('outputPlaceholder'); const outputMount = $('outputMount'); const outputContainer = $('outputContainer'); -const compileBtn = $('compileBtn'); const statusBadge = $('statusBadge'); const statusText = $('statusText'); const statusDot = $('statusDot'); @@ -48,7 +47,6 @@ const errorText = $('errorText'); const warningBanner = $('warningBanner'); const warningText = $('warningText'); const themeToggle = $('themeToggle'); -const toggleTrack = $('toggleTrack'); const divider = $('divider'); const panelEditor = $('panelEditor'); const panelOutput = $('panelOutput'); @@ -60,7 +58,6 @@ const panels = $('panels'); let compiler = null; let isReady = false; let isCompiling = false; -let autoCompile = true; let compileTimer = null; let currentYaml = ''; @@ -115,7 +112,7 @@ const editorView = new EditorView({ run: () => { doCompile(); return true; } }]), EditorView.updateListener.of(update => { - if (update.docChanged && autoCompile && isReady) { + if (update.docChanged && isReady) { scheduleCompile(); } }), @@ -155,13 +152,6 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) } }); -// --------------------------------------------------------------- -// Keyboard shortcut hint (Mac vs other) -// --------------------------------------------------------------- -const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; -document.querySelectorAll('.kbd-hint-mac').forEach(el => el.style.display = isMac ? 'inline' : 'none'); -document.querySelectorAll('.kbd-hint-other').forEach(el => el.style.display = isMac ? 'none' : 'inline'); - // --------------------------------------------------------------- // Status (uses Primer Label component) // --------------------------------------------------------------- @@ -187,18 +177,6 @@ function setStatus(status, text) { } } -// --------------------------------------------------------------- -// Auto-compile toggle -// --------------------------------------------------------------- -$('autoCompileToggle').addEventListener('click', () => { - autoCompile = !autoCompile; - if (autoCompile) { - toggleTrack.classList.add('active'); - } else { - toggleTrack.classList.remove('active'); - } -}); - // --------------------------------------------------------------- // Compile // --------------------------------------------------------------- @@ -226,7 +204,6 @@ async function doCompile() { isCompiling = true; setStatus('compiling', 'Compiling...'); - compileBtn.disabled = true; // Hide old banners errorBanner.classList.add('d-none'); @@ -262,12 +239,9 @@ async function doCompile() { errorBanner.classList.remove('d-none'); } finally { isCompiling = false; - compileBtn.disabled = !isReady; } } -compileBtn.addEventListener('click', doCompile); - // --------------------------------------------------------------- // Banner close // --------------------------------------------------------------- @@ -359,13 +333,10 @@ async function init() { await compiler.ready; isReady = true; setStatus('ready', 'Ready'); - compileBtn.disabled = false; loadingOverlay.classList.add('hidden'); - // Auto-compile the default content - if (autoCompile) { - doCompile(); - } + // Compile the default content + doCompile(); } catch (err) { setStatus('error', 'Failed to load'); loadingOverlay.querySelector('.f4').textContent = 'Failed to load compiler'; diff --git a/docs/public/editor/index.html b/docs/public/editor/index.html index 981e57a697..bf14fdc320 100644 --- a/docs/public/editor/index.html +++ b/docs/public/editor/index.html @@ -115,42 +115,12 @@ 50% { opacity: 0.35; } } -/* Toggle switch (no Primer equivalent in CSS-only) */ -.toggle-track { - position: relative; - width: 34px; - height: 20px; - border-radius: 10px; - background: var(--bgColor-neutral-muted, var(--color-neutral-muted, #afb8c1)); - transition: background 180ms ease; - flex-shrink: 0; - cursor: pointer; -} -.toggle-track.active { - background: var(--fgColor-accent, var(--color-accent-fg)); -} -.toggle-knob { - position: absolute; - top: 2px; - left: 2px; - width: 16px; - height: 16px; - background: #fff; - border-radius: 50%; - transition: transform 180ms ease; - box-shadow: 0 1px 3px rgba(0,0,0,0.2); -} -.toggle-track.active .toggle-knob { - transform: translateX(14px); -} - /* Responsive */ @media (max-width: 767px) { .panels-container { flex-direction: column !important; } .divider { width: 100%; height: 4px; cursor: row-resize; } .header-bar { gap: 8px !important; padding: 8px 12px !important; flex-wrap: wrap; height: auto !important; min-height: 48px !important; } .header-separator { display: none !important; } - .auto-compile-label-text { display: none; } } @@ -181,20 +151,6 @@