Fix syntax coloring, modernize toolbar UI, and clean up CSS
- Fix Monarch tokenizer loading: await initLinter() before editor creation so loadScript() doesn't clobber window.define during lazy tokenizer init - Fix JSX/TSX coloring: use file URIs with proper extensions (.jsx/.tsx) so Monaco enables JSX tokenization via the TypeScript language service - Modernize toolbar: move settings to gear popover, replace text buttons with SVG icons, consolidate toggle checkboxes into compact group - Clean up CSS: remove duplicate toggle classes, dead selectors, orphaned rules
This commit is contained in:
@@ -290,8 +290,10 @@ function applyLayout(layout) {
|
||||
}
|
||||
|
||||
async function init() {
|
||||
// Load Emmet before editors so completion providers are registered
|
||||
// Load ALL CDN scripts before editor creation so window.define
|
||||
// (Monaco's RequireJS) is never clobbered during Monarch tokenizer init
|
||||
await initEmmet();
|
||||
await initLinter();
|
||||
|
||||
// Register custom Monaco themes before creating editors
|
||||
registerCustomThemes();
|
||||
@@ -312,7 +314,6 @@ async function init() {
|
||||
initPerformance();
|
||||
initResizer();
|
||||
initKeybindings();
|
||||
initLinter();
|
||||
|
||||
// Auto-run checkbox
|
||||
const autoRunCb = $('#auto-run-checkbox');
|
||||
@@ -571,6 +572,18 @@ async function init() {
|
||||
$('#shortcuts-modal-close').addEventListener('click', () => scModal.classList.add('hidden'));
|
||||
scModal.addEventListener('click', (e) => { if (e.target === scModal) scModal.classList.add('hidden'); });
|
||||
|
||||
// Settings popover toggle
|
||||
const settingsPopover = $('#settings-popover');
|
||||
$('#btn-settings').addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
settingsPopover.classList.toggle('hidden');
|
||||
});
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!settingsPopover.classList.contains('hidden') && !e.target.closest('.settings-popover-wrap')) {
|
||||
settingsPopover.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
// Load fiddle from URL if present
|
||||
loadFromUrl();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user