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 :)
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_confi...
[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-su...
--
Robert
________________________________ Von: MediaWiki-l mediawiki-l-bounces@lists.wikimedia.org im Auftrag von Jay prakash 0freerunning@gmail.com 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 - Wikimediahttps://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.
Thank a lot Robert Vogel, But I am targeting WikiEditor.
On Mon, Nov 12, 2018 at 1:00 PM Robert Vogel vogel@hallowelt.com wrote:
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_confi...
[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-su...
--
Robert
Von: MediaWiki-l mediawiki-l-bounces@lists.wikimedia.org im Auftrag von Jay prakash 0freerunning@gmail.com 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%3E 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
Ah, WikiEditor. Well, in this case you may just bind to the `submit` event of the form-element. Unfortunately "Extension:WikiEditor" does not provide any client-side hook points. At least as far as I know.
--
Robert
________________________________ Von: MediaWiki-l mediawiki-l-bounces@lists.wikimedia.org im Auftrag von Jay prakash 0freerunning@gmail.com Gesendet: Montag, 12. November 2018 14:04 An: MediaWiki announcements and site admin list Betreff: Re: [MediaWiki-l] MediaWiki's Hooks in Javascript?
Thank a lot Robert Vogel, But I am targeting WikiEditor.
On Mon, Nov 12, 2018 at 1:00 PM Robert Vogel vogel@hallowelt.com wrote:
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
MediaWiki core - Documentationhttps://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook doc.wikimedia.org Registry and firing of events. MediaWiki has various interface components that are extended, enhanced or manipulated in some other way by extensions, gadgets and even in core itself.
[2] https://www.mediawiki.org/wiki/Extension:VisualEditor#Complete_list_of_confi...
[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-su...
--
Robert
Von: MediaWiki-l mediawiki-l-bounces@lists.wikimedia.org im Auftrag von Jay prakash 0freerunning@gmail.com 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%3E 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
_______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org