- Add comprehensive documentation in botbook/ with 12 chapters - Add botapp/ Tauri desktop application - Add botdevice/ IoT device support - Add botlib/ shared library crate - Add botmodels/ Python ML models service - Add botplugin/ browser extension - Add botserver/ reorganized server code - Add bottemplates/ bot templates - Add bottest/ integration tests - Add botui/ web UI server - Add CI/CD workflows in .forgejo/workflows/ - Add AGENTS.md and PROD.md documentation - Add dependency management scripts (DEPENDENCIES.sh/ps1) - Remove legacy src/ structure and migrations - Clean up temporary and backup files
28 lines
1 KiB
JavaScript
28 lines
1 KiB
JavaScript
/* Editor page JavaScript */
|
|
|
|
// Show save notification
|
|
function showSaveNotification(event) {
|
|
const notification = document.getElementById('notification');
|
|
if (event.detail.successful) {
|
|
notification.textContent = '✓ File saved';
|
|
notification.className = 'notification success show';
|
|
document.getElementById('dirty-indicator').style.display = 'none';
|
|
} else {
|
|
notification.textContent = '✗ Save failed';
|
|
notification.className = 'notification error show';
|
|
}
|
|
setTimeout(() => notification.classList.remove('show'), 3000);
|
|
}
|
|
|
|
// Mark as dirty on edit
|
|
document.getElementById('text-editor')?.addEventListener('input', function() {
|
|
document.getElementById('dirty-indicator').style.display = 'inline-block';
|
|
});
|
|
|
|
// Keyboard shortcuts using htmx triggers
|
|
document.addEventListener('keydown', function(e) {
|
|
if ((e.ctrlKey || e.metaKey) && e.key === 's') {
|
|
e.preventDefault();
|
|
htmx.trigger(document.querySelector('[hx-post="/api/editor/save"]'), 'click');
|
|
}
|
|
});
|