On 27 August 2015 at 06:54, [email protected] <
[email protected]> wrote:

> A VE save could be recognized with the postEdit hook[1] in JavaScript:
>
> mw.hook( 'postEdit' ).add(
>     // your function
> );
>
> Remember, that this hook is also fired after a "normal" save (via the
> Wikitext editor)[2].
>
> [1]
> https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/44ad7574639be7e096d43784eb3942388e779eff/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js#L713-L717
> [2]
> https://github.com/wikimedia/mediawiki/blob/b79196778ed7c4f49ae09bee9ba16f861a6e3760/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js#L66-L75


​Yeah, but that's even later​ than the server-side mid-save PHP hook. :-)



> -----Original-Nachricht-----
> Betreff: Re: [Wikitech-l] Tutorials / HowTos for VisualEditor
> Datum: Thu, 27 Aug 2015 15:30:27 +0200
> Von: Daren Welsh <[email protected]>
> An: Wikimedia developers <[email protected]>
>
> I'm also interested in this kind of information. Right now I'm specifically
> interested in what I can use as an equivalent to a hook for when a user
> saves a page revision using VE. I'm working on an extension that logs user
> actions (and does more with that information). I have figured out how to
> play off of hooks to determine a page view or a "traditional" page save,
> but I'm lost when it comes to VE.
>

​Probably simplest just do it server-side hooked onto the page save, with a
special rule if the revision is tagged 'visualeditor'​?

​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