Jump to content

Topic on Talk:2017 wikitext editor

Hooks for gadgtes and user scripts?

4
Nux (talkcontribs)

Current wiki-code editor has some scripts written for it. Might be as simple as a button that does something with currently selected wiki-code. Will you be making hooks and tutorials that will allow easy creation of a user-scripts?

I'm asking because I was just trying to extend VisualEditor and it took me something like 2 intense days of digging to be able to simply add a button. Even worse. I didn't really found a way to nicely hook into on some on-ready event. I had to overwrite (proxy) one of methods of existing classes (specifically I had to wirite a proxy for `ve.ui.FindAndReplaceDialog.prototype.onFindChange`).

VE docs are nice I give you that. But they lack recipes... Or maybe I missed them. Good thing docs are linked with source code. Helped a lot when I noticed this...

So to conclude - if you are going to replace current editor please add in-docs examples of hooking into the editor toolbar and such and please add hooks for user-scripts.

Simulo (talkcontribs)

I agree – I found it hard as well to understand how VE works and how I can attach scripts; it is nice to have the API documentation, however, without some introduction, examples or tutorial it is almost impossible to extend it or contribute to it.

Whatamidoing (WMF) (talkcontribs)

They have promised me that it will be easy to add buttons (and similar things), and that they will produce some documentation and example(s) about how to do so.

On the less-happy side, they have also promised that all of the scripts used with the 2010 wikitext editor will be incompatible, and they have not promised a specific date by which the docs will be published.  So I think this adds up to "good news for the future" rather than "good news for today".

Zache (talkcontribs)

There is VisualEditor/Gadgets where is some information for writing gadgets, but in example complete list of hooks are missing. Also some basic information like how to detect when user is switching to visual editing or to wikicode and what should do when that happens.

Reply to "Hooks for gadgtes and user scripts?"