I would like to open the composer from my plugin. But I cannot use the composing a new pre-filled topic via URL method, because I don’t want to change the route.
I’ve tried the method explained here, but it doesn’t seem to work. I’ve tried to send the composer:opened event to other objects (router, application route, application controller, composer controller) but without any success.
I’ve been more successful with the method described here, using this kind of code:
container.lookup('controller:composer').open({
action: Composer.CREATE_TOPIC,
draftKey: 'new_topic'
})
The composer opens correctly, but:
- the preview pane doesn’t seem to work
- I get the following errors in the console:
Uncaught SyntaxError: Unexpected token < markdown-it-bundle.js:1
Error: Could not find module pretty-text/engines/discourse-markdown/helpers discourse/lib/text:40
at missingModule (discourse-loader:134)
at require (discourse-loader:149)
at setup (pretty-text/engines/discourse-markdown-it:242)
at buildOptions (pretty-text/pretty-text:100)
at getOpts (discourse/lib/text:25)
at cook (discourse/lib/text:30)
at eval (discourse/lib/text:38)
at tryCatch (ember:50180)
at invokeCallback (ember:50195)
at publish (ember:50163)
Any idea?