Page MenuHomePhabricator

Fire mw.hook() event as soon as edit page rearrangement has been completed
Closed, ResolvedPublic

Description

When ext.proofreadpage.page.edit.js in rEPRP terminated its job, some event should be launched like:

mw.hook( "ext.gadget.proofread.page.ready" ).fire( something? );

This might help various ”asynchronous execution“ problems mentioned in T119324#2070849 as well.

Event Timeline

That's definitely a good idea! Let's add it to the TODO list.

Change 740324 had a related patch set uploaded (by Inductiveload; author: Inductiveload):

[mediawiki/extensions/ProofreadPage@master] OSD: Add a ready hook for scripts

https://gerrit.wikimedia.org/r/740324

Change 740324 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] OSD: Add a ready hook for scripts

https://gerrit.wikimedia.org/r/740324

Change 740778 had a related patch set uploaded (by Inductiveload; author: Inductiveload):

[mediawiki/extensions/ProofreadPage@wmf/1.38.0-wmf.9] OSD: Add a ready hook for scripts

https://gerrit.wikimedia.org/r/740778

Change 740778 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@wmf/1.38.0-wmf.9] OSD: Add a ready hook for scripts

https://gerrit.wikimedia.org/r/740778

Mentioned in SAL (#wikimedia-operations) [2021-11-23T12:26:27Z] <lucaswerkmeister-wmde@deploy1002> Synchronized php-1.38.0-wmf.9/extensions/ProofreadPage/modules/page/ext.proofreadpage.page.edit.js: Backport: [[gerrit:740778|OSD: Add a ready hook for scripts (T180569)]] (duration: 00m 56s)

Inductiveload claimed this task.
Inductiveload subscribed.

This is now deployed: you can use it like this:

	mw.hook( 'ext.proofreadpage.osd-viewer-ready' ).add( function ( viewer ) {
	 	console.log( 'OSD viewer ready: ', viewer );
	} );