Page MenuHomePhabricator

Provide an API to hook into new reply editor
Open, Needs TriagePublic

Description

I love the new discussion tool and would love to hook into it. I'm using an autocorrect for the main VisualEditor. So adding dashes, arrows, Polish quotes etc. All this is still useful when replying.

So technically I need some activation hook similar to this:

	mw.hook('ve.activationComplete').add(function () {
		...
	});

And also need to have access to VE commandRegistry, VE Surface and VE sequenceRegistry.

		//create and register the command
		ve.ui.commandRegistry.register(...);
		//let the surface know that there is a new command that can be executed
		ve.init.target.getSurface().commands.push(name);
		//create and register the sequence
		ve.ui.sequenceRegistry.register(...);

Full code of the gadget can be found here:
https://github.com/Eccenux/veAutocorrect/blob/master/veAutocorrect.js