diff --git a/app/templates/base.html b/app/templates/base.html
index 882f67e..50bd190 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -226,7 +226,14 @@
-
+
@@ -338,6 +345,7 @@
currentView: 'home',
contextMenu: { visible: false, x: 0, y: 0, pageId: null, pageName: '' },
contextActions: {},
+ showNewPageMenu: false,
navigateTo(url) {
window.location.href = url;
@@ -393,6 +401,19 @@
.catch(err => { alert('Failed to create sub-page: ' + err.message); });
},
+ createEmptyPage() {
+ this.showNewPageMenu = false;
+ this.newPage('Private');
+ },
+ createDatabase() {
+ this.showNewPageMenu = false;
+ alert('Database creation: use a Gitea repo as a database. Navigate to a project board from the dashboard.');
+ },
+ createBoard() {
+ this.showNewPageMenu = false;
+ window.location.href = '/board/bruno/flowdeck';
+ },
+
toggleTheme() {
const html = document.documentElement;
const current = html.getAttribute('data-theme');
diff --git a/app/templates/page_editor.html b/app/templates/page_editor.html
index cc75a67..ed33fa4 100644
--- a/app/templates/page_editor.html
+++ b/app/templates/page_editor.html
@@ -36,10 +36,11 @@
Markdown
+ placeholder="Type '/' for commands, or start writing in Markdown...">
@@ -145,7 +146,43 @@
},
saveTitle(newTitle) {
fetch(`/board/api/pages/{{ page.id }}?title=${encodeURIComponent(newTitle)}`, { method: 'PUT' });
- }
+ },
+ handleSlash(e) {
+ if (e.key === '/' && !e.ctrlKey && !e.metaKey) {
+ const el = this.$refs.editor;
+ const cursor = el.selectionStart;
+ const lineStart = this.content.lastIndexOf('\n', cursor - 1) + 1;
+ const charsBefore = this.content.substring(lineStart, cursor);
+ // Only trigger at start of line or after whitespace
+ if (charsBefore.trim() === '') {
+ e.preventDefault();
+ this.content = this.content.substring(0, cursor) + '/';
+ // Simple menu: insert template after short delay
+ const cmd = prompt('Slash command:\n /h1 - Heading 1\n /h2 - Heading 2\n /h3 - Heading 3\n /bold - Bold\n /list - Bullet list\n /num - Numbered list\n /code - Code block\n /quote - Quote\n /todo - To-do list\n /table - Table\n /divider - Divider\n /link - Link\n /img - Image\n /date - Date');
+ if (!cmd) { this.content = this.content.substring(0, cursor); return; }
+ const templates = {
+ h1: '# ',
+ h2: '## ',
+ h3: '### ',
+ bold: '**bold text**',
+ list: '- ',
+ num: '1. ',
+ code: '```\ncode\n```',
+ quote: '> ',
+ todo: '- [ ] ',
+ table: '| Col 1 | Col 2 |\n|-------|-------|\n| | |',
+ divider: '---\n',
+ link: '[text](url)',
+ img: '',
+ date: new Date().toISOString().slice(0, 10),
+ };
+ const insert = templates[cmd.replace('/','')] || '';
+ const before = this.content.substring(0, cursor);
+ this.content = before + insert + this.content.substring(cursor + 1);
+ setTimeout(() => { el.focus(); el.selectionStart = el.selectionEnd = before.length + insert.length; }, 50);
+ }
+ }
+ },
};
}