On 27 August 2015 at 05:59, Robert Vogel <[email protected]> wrote:

> Hi!
>
> James, Florian, thank you for your responses! This will be very useful for
> me.
>
> I didn't have the time to look through all of Florian's links, so maybe
> it's somewhere in there, but, James, can you give me a hint how to register
> a tool with visual editor?
> What is the recommended time/callback to call the
> 've.ui.toolFactory.register' method? mw.loader.using(<some-RL-module>)?
>

​Yes, use ext.visualEditor.desktopArticleTarget.init for that.

If your code is 'real' and not just a gadget you can get loaded by
registering as a "VisualEditorPluginModule" (see e.g. how the Math
extension does this in extension.json:
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMath/b0dce0fe46dd053d937338d5aefd6bf20ce9d285/extension.json#L103
and
the wikihiero extension does this using the old PHP method:
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2Fwikihiero/e7cb93e52993ae1ba40d30c52dd4313670d36fd7/wikihiero.php#L95
).



> Regarding the 'save' event question: I want to check if a category is set
> and if it is not, show a message window to the user _before_ he/she can
> save. I've already implemented a serverside check and the API returns an
> error if no category is set. But this API error message cannot be
> styled/customized and it gets displayed _after_ the user clicked "save".
>

​Interesting idea.

​We've got vague plans for a system of pre-save
suggestions/reminders/warnings/errors, but we've not started designing it
yet, so there's nothing into which to register, sorry.​​​


> But of course I will open a Phabricator task if that is the better place
> for such a discussion.
>

​Please do.

Yours,
-- 
James D. Forrester
Lead Product Manager, Editing
Wikimedia Foundation, Inc.

[email protected] | @jdforrester
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to