2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-06-27 21:21:02 -06:00
easy-markdown-editor/types/easymde-test.ts

31 lines
828 B
TypeScript
Raw Normal View History

2019-01-17 11:12:40 +01:00
// Create new instance
const editor = new EasyMDE({
2019-01-16 21:32:41 +08:00
autoDownloadFontAwesome: false,
2019-02-27 13:54:57 +01:00
element: document.getElementById('mdEditor')!,
hideIcons: ['side-by-side', 'fullscreen'],
2019-01-16 21:32:41 +08:00
shortcuts: {
2019-02-27 13:54:57 +01:00
drawTable: 'Cmd-Alt-T',
2019-01-16 21:32:41 +08:00
toggleFullScreen: null
},
2019-01-17 11:12:40 +01:00
spellChecker: false,
2019-02-27 13:54:57 +01:00
onToggleFullScreen: (full: boolean) => {
console.log('FullscreenToggled', full);
},
2019-01-17 11:12:40 +01:00
theme: 'someOtherTheme',
2019-01-16 21:32:41 +08:00
});
2019-01-17 11:12:40 +01:00
// Editor functions
const value = editor.value() as string;
editor.value(value.toUpperCase());
const sbs = editor.isSideBySideActive() as boolean;
const fullscreen = editor.isFullscreenActive() as boolean;
// Access to codemirror object
editor.codemirror.setOption('readOnly', true);
// Static properties
2019-02-27 13:54:57 +01:00
EasyMDE.toggleItalic = (editor: EasyMDE) => {
console.log('SomeButtonOverride');
};