CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Blocked by required conditions
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Blocked by required conditions
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Waiting to run
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Blocked by required conditions
- content-editor.js: extract the /save handler to scripts/cms-save.js - cms-logo-page.js: inline the ~280-line canvas editor script to scripts/cms-logo-client.js (page is now the HTML/CSS shell only) - cms-editor-client.js: move the keyboard-shortcut section to scripts/cms-editor-shortcuts.js, inlined after the main client All modules now under the hard limit; full pre-deploy suite green. Closes MITHOME-80
57 lines
2.8 KiB
JavaScript
57 lines
2.8 KiB
JavaScript
// Keyboard shortcuts for the Content Editor editor page. Inlined after the
|
|
// main client script; all referenced functions are global at that point.
|
|
// Ctrl/Cmd+S save · Ctrl/Cmd+P publish · Ctrl/Cmd+Shift+V versions · ? help
|
|
// Plain typing in inputs never triggers actions — the handler requires the
|
|
// modifier key (or, for '?', a non-editing target).
|
|
|
|
function showShortcutsOverlay() {
|
|
const existing = document.getElementById('shortcuts-overlay');
|
|
if (existing) { existing.remove(); return; }
|
|
const overlay = document.createElement('div');
|
|
overlay.id = 'shortcuts-overlay';
|
|
overlay.style.cssText = 'position:fixed;inset:0;background:rgba(15,17,23,.75);z-index:300;display:flex;align-items:center;justify-content:center;padding:24px;';
|
|
overlay.innerHTML = `
|
|
<div style="background:#1a2035;border:1px solid #2d3748;border-radius:14px;padding:28px 32px;max-width:420px;width:100%;font-size:14px;line-height:2;color:#e2e8f0;">
|
|
<h2 style="font-size:16px;color:#93c5fd;margin-bottom:12px;">⌨️ Gyorsbillentyűk</h2>
|
|
<div><kbd style="background:#0f1420;border:1px solid #2d3748;border-radius:5px;padding:2px 8px;font-family:monospace;">Ctrl/Cmd + S</kbd> — Mentés</div>
|
|
<div><kbd style="background:#0f1420;border:1px solid #2d3748;border-radius:5px;padding:2px 8px;font-family:monospace;">Ctrl/Cmd + P</kbd> — Publikálás</div>
|
|
<div><kbd style="background:#0f1420;border:1px solid #2d3748;border-radius:5px;padding:2px 8px;font-family:monospace;">Ctrl/Cmd + Shift + V</kbd> — Verziók</div>
|
|
<div><kbd style="background:#0f1420;border:1px solid #2d3748;border-radius:5px;padding:2px 8px;font-family:monospace;">?</kbd> — ez a súgó (Esc: bezárás)</div>
|
|
</div>`;
|
|
overlay.addEventListener('click', () => overlay.remove());
|
|
document.body.appendChild(overlay);
|
|
}
|
|
|
|
document.addEventListener('keydown', e => {
|
|
// Esc closes the shortcut overlay if open
|
|
if (e.key === 'Escape') {
|
|
const overlay = document.getElementById('shortcuts-overlay');
|
|
if (overlay) { overlay.remove(); e.preventDefault(); }
|
|
return;
|
|
}
|
|
const mod = e.ctrlKey || e.metaKey;
|
|
if (mod && !e.shiftKey && !e.altKey && (e.key === 's' || e.key === 'S')) {
|
|
e.preventDefault();
|
|
save();
|
|
return;
|
|
}
|
|
if (mod && !e.shiftKey && !e.altKey && (e.key === 'p' || e.key === 'P')) {
|
|
e.preventDefault();
|
|
publish();
|
|
return;
|
|
}
|
|
if (mod && e.shiftKey && (e.key === 'v' || e.key === 'V')) {
|
|
e.preventDefault();
|
|
window.open('/versions?file=' + encodeURIComponent(FILE), '_blank');
|
|
return;
|
|
}
|
|
if (!mod && !e.ctrlKey && !e.metaKey && !e.altKey && e.key === '?') {
|
|
const target = e.target;
|
|
const isEditing = target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable);
|
|
if (!isEditing) {
|
|
e.preventDefault();
|
|
showShortcutsOverlay();
|
|
}
|
|
}
|
|
});
|