Hi,
maybe the following link will help you to solve number 1. Neither I know if this is
documented somewhere, nor if this is the best solution and/or will work in future versions
of VisualEditor.
For your second point (I'm not sure, if I understand that correctly) you could take a
look at some extensions, that doing it already, like Syntaxhighlight[1], LanguageTool[2]
or other examples[3].
[1]
https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/tre…
[2]
https://github.com/wikimedia/mediawiki-extensions-LanguageTool/tree/master/…
[3]
https://github.com/search?q=%40wikimedia+VisualEditorPluginModules&type…
Best,
Florian
Freundliche Grüße
Florian Schmidt
-----Original-Nachricht-----
Betreff: [Wikitech-l] Tutorials / HowTos for VisualEditor
Datum: Wed, 26 Aug 2015 08:31:13 +0200
Von: Robert Vogel <vogel(a)hallowelt.com>
An: "wikitech-l(a)lists.wikimedia.org" <wikitech-l(a)lists.wikimedia.org>
Hi everybody!
I want to write an extension for the VisualEditor (great work by the way) and I need a
little help. I've browsed through various documentation [1-4](and more) and already
learned that using RL module 'ext.visualEditor.desktopArticleTarget.init' and
'mw.lib.ve.addPlugin' method is the way to go. Unfortunately my attempts to hook
into the user interface by binding on events provided by the components (like
'save' from 've.ui.MWSaveDialog' or 've.init.mw.Target') have not
been successful yet. Maybe you could give me a little push into the right direction.
Are there any HowTos or Tutorials for VisualEditor that cover topics like
1. Adding buttons to the toolbar
2. Accessing the data model (e.g. retrieve all set categories from the Parsoid DOM)
3. Extending/replacing a single tool (e.g. the GalleryInspector)
4. Binding on components events (e.g. the 'save' event, to analyze content
and maybe abort saving)
Points 1 and 2 get more or less explained by the docs I've found. But 3 and 4 are very
unclear to me. Some hints would be appreciated!
[1]
https://www.mediawiki.org/wiki/VisualEditor_gadgets#Gadget_-_Registering_VE…
[2]
https://en.wikipedia.org/wiki/User:%D7%A2%D7%A8%D7%9F/veReplace.js
[3]
https://doc.wikimedia.org/VisualEditor/master
[4]
https://www.mediawiki.org/wiki/OOjs_UI/Toolbars
Greetings,
Robert Vogel
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l