Thank you all for your responses! I've opened up a task on Phabricator [1] to discuss about a "pre-save" system or public hooks in general.
[1] https://phabricator.wikimedia.org/T110644 -- Robert Vogel -----Ursprüngliche Nachricht----- Von: wikitech-l-boun...@lists.wikimedia.org [mailto:wikitech-l-boun...@lists.wikimedia.org] Im Auftrag von James Forrester Gesendet: Donnerstag, 27. August 2015 16:58 An: florian.schmidt.wel...@t-online.de; Wikimedia developers <wikitech-l@lists.wikimedia.org> Betreff: Re: [Wikitech-l] Tutorials / HowTos for VisualEditor On 27 August 2015 at 06:54, florian.schmidt.wel...@t-online.de < florian.schmidt.wel...@t-online.de> 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/44 > ad7574639be7e096d43784eb3942388e779eff/modules/ve-mw/init/targets/ve.i > nit.mw.DesktopArticleTarget.js#L713-L717 > [2] > https://github.com/wikimedia/mediawiki/blob/b79196778ed7c4f49ae09bee9b > a16f861a6e3760/resources/src/mediawiki.action/mediawiki.action.view.po > stEdit.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 <darenwe...@gmail.com> > An: Wikimedia developers <wikitech-l@lists.wikimedia.org> > > 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. jforres...@wikimedia.org | @jdforrester _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l