Hi!

There is `mw.hook` [1], but is has only very few hook-points. AFAIK there is no 
easy way to bind on the "save" event of VisualEditor (I assume you are 
targeting VE, not WikiEditor, aren't you?)


I have implemented something similar, by creating a "VisualEditorPluginModule" 
[2][3] and within that I registered a custom SaveDialog [4].


I have also asked on the Wikimedia Develper Support Forms [5] some time ago, 
but did not get an answer yet.


[1] https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook

[2] 
https://www.mediawiki.org/wiki/Extension:VisualEditor#Complete_list_of_configuration_options

[3] https://www.mediawiki.org/wiki/Manual:Extension_registration#Attributes

[4] https://doc.wikimedia.org/VisualEditor/master/#!/api/ve.ui.MWSaveDialog

[5] 
https://discourse-mediawiki.wmflabs.org/t/how-to-register-to-visualeditor-sub-component-event/688


--

Robert


________________________________
Von: MediaWiki-l <[email protected]> im Auftrag von Jay 
prakash <[email protected]>
Gesendet: Montag, 12. November 2018 08:07
An: MediaWiki announcements and site admin list
Betreff: [MediaWiki-l] MediaWiki's Hooks in Javascript?

Hello everyone,
               Sorry for my silly Question. But I want to know that
MediaWiki's javascript has Hooks functionality like PHP has $wgHooks[
'PageContentSaveComplete'].

I want to run my code when the user submits their edit.

Thanks in Advance :)
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l Mailing List - 
Wikimedia<https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
lists.wikimedia.org
MediaWiki-l MediaWiki announcements and site admin list. This is a multilingual 
list for help/support with running/configuring MediaWiki. It is intended for 
people who are running wikis with the MediaWiki software and for announcements 
of new versions, bug fixes, and security issues.


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to