You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

easymde-test.ts 828B

123456789101112131415161718192021222324252627282930
  1. // Create new instance
  2. const editor = new EasyMDE({
  3. autoDownloadFontAwesome: false,
  4. element: document.getElementById('mdEditor')!,
  5. hideIcons: ['side-by-side', 'fullscreen'],
  6. shortcuts: {
  7. drawTable: 'Cmd-Alt-T',
  8. toggleFullScreen: null
  9. },
  10. spellChecker: false,
  11. onToggleFullScreen: (full: boolean) => {
  12. console.log('FullscreenToggled', full);
  13. },
  14. theme: 'someOtherTheme',
  15. });
  16. // Editor functions
  17. const value = editor.value() as string;
  18. editor.value(value.toUpperCase());
  19. const sbs = editor.isSideBySideActive() as boolean;
  20. const fullscreen = editor.isFullscreenActive() as boolean;
  21. // Access to codemirror object
  22. editor.codemirror.setOption('readOnly', true);
  23. // Static properties
  24. EasyMDE.toggleItalic = (editor: EasyMDE) => {
  25. console.log('SomeButtonOverride');
  26. };