markdown editor

This commit is contained in:
Jan Prochazka
2021-03-11 14:57:12 +01:00
parent cedb740fb0
commit c2c54856ff
5 changed files with 156 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ import ConnectionModal from '../modals/ConnectionModal.svelte';
import { showModal } from '../modals/modalTools';
import newQuery from '../query/newQuery';
import saveTabFile, { saveTabEnabledStore } from '../utility/saveTabFile';
import openNewTab from '../utility/openNewTab';
function themeCommand(theme: ThemeDefinition) {
return {
@@ -66,11 +67,39 @@ registerCommand({
onClick: () => newQuery(),
});
registerCommand({
id: 'new.shell',
category: 'New',
icon: 'img shell',
name: 'JavaScript Shell',
onClick: () => {
openNewTab({
title: 'Shell #',
icon: 'img shell',
tabComponent: 'ShellTab',
});
},
});
registerCommand({
id: 'new.markdown',
category: 'New',
icon: 'img markdown',
name: 'Markdown page',
onClick: () => {
openNewTab({
title: 'Page #',
icon: 'img markdown',
tabComponent: 'MarkdownEditorTab',
});
},
});
export function registerFileCommands({
idPrefix,
category,
editorStore,
editorStatusStore,
editorStatusStore = undefined,
folder,
format,
fileExtension,