Alexander Skvortsov
50da5ffd45
Handle editor-driven input events.
...
The mdarea extension's handleKey method only applies when input is accompanied by an actual key press, and won't register programmatic inputs via `app.composer.editor` methods. We add an additional listener for custom events, which are dispatched in `setValue`.
2021-03-08 16:09:18 -05:00
Alexander Skvortsov
09b14b980a
Attach oninput, inputListeners, onsubmit via mdarea extension
...
Recent versions of mdarea are quite powerful, and have internal state data structures. As a result, updating current editor value via `oninput` event listeners isn't reliable. Instead, we can use the mdarea extension API to handle keypresses exactly when markdownarea wants us to.
This also removes the `super` call from `build`, and directly creates/configures the applicable DOM elements. Since the mdarea editor driver's initialization is already quite different from BasicEditorDriver, it should fully own this step.
2021-02-27 16:05:25 -05:00
Alexander Skvortsov
aa62e69dab
MarkdownEditorDriver should be its own driver.
...
Splitting it out instead of hacking it onto BasicEditorDriver gives us more flexibility in customizing it for markdown area.
2021-02-27 15:37:19 -05:00
Alexander Skvortsov
3bdfbf9349
Editor driver support
2021-02-26 22:18:54 -05:00
Alexander Skvortsov
14adb2bed1
mdarea: disable inlines
...
This was accidentially introduced when updating for v1.0.0 of the mdarea library, and causes user inconvenience.
Fixes https://github.com/flarum/core/issues/2569
2021-01-25 19:57:43 -05:00
Alexander Skvortsov
ab63a55d60
Mithril 2 Update ( #19 )
...
Update for Mithril 2
2020-09-23 22:51:50 -04:00
Alexander Skvortsov
c0aa73f01a
Update mdarea to v1.0.1 ( #20 )
...
* Update mdarea to v1.0.1
2020-08-16 20:43:45 -04:00
Alexander Skvortsov
a232d8bcfc
Remove polyfills: we don't support IE anymore ( #18 )
...
* Remove polyfills: we don't support IE anymore
2020-08-16 16:32:19 -04:00
Matteo Contrini
8d84d1dea6
Change default URL value in link/image markdown button ( #11 )
...
* Change default URL value in link/image markdown button
2020-05-20 17:07:10 -04:00
David Sevilla Martin
db3a037c97
Add license code to index.js, and line to LICENSE
2019-09-09 20:21:58 -04:00
David Sevilla Martin
b04b82b3a5
Add copyright notice for markdown toolbar code taken from GitHub
...
Refs #8
2019-09-09 20:06:18 -04:00
David Sevilla Martin
8277b54651
Add image button ( flarum/core#1679 )
2019-08-11 16:06:30 -04:00
David Sevilla Martin
eb561e6343
Fix 'polyfills' incorrect spelling, add LICENSE text for startsWith polyfill
2019-08-03 09:14:24 -04:00
David Sevilla Martín
f4e250f514
Simplify some code in MarkdownButton component
2019-07-10 12:41:05 -04:00
David Sevilla Martín
50a4530cfc
Use custom JSX implementation of GitHub's markdown toolbar that works in IE 11
2019-07-10 12:30:35 -04:00
David Sevilla Martín
3726307f16
Add custom-elements pollyfill & markdown bar if Reflect API is present
...
Ref #1702
2019-04-10 18:13:09 -04:00
David Sevilla Martín
8f8714134b
Add harmony-reflect to fix issues with markdown bar in IE ( #6 )
2019-03-20 20:51:23 +01:00
Toby Zerner
f75f2214a6
Add custom elements polyfill
2018-11-14 06:43:45 +10:30
Toby Zerner
40438fd0a6
Add markdown toolbar buttons and textarea helper
2018-11-12 21:02:50 +10:30