Jump to content

VisualEditor/Hooks

From mediawiki.org

Client hooks

[edit]

mw.hook

[edit]
Name Platform(s) When Users Usage
ve.skinTabSetupComplete Desktop The edit tab(s) have been setup and handlers bound GuidedTour globalsearch

codesearch

ve.activationStart Desktop The edit link was clicked and VE has started loading Hides sticky header in Vector2022 globalsearch

codesearch

ve.activate Desktop VE code has loaded, but not necessarily the document Planned for deprecation. globalsearch

codesearch

ve.wikitextInteractive Desktop A wikitext editor is ready for use, either the full 2017WTE, or the temporary editor 2017WTE shows while loading Extension:Linter, any wikitext gadget that wants to support 2017WTE globalsearch

codesearch

ve.activationComplete Desktop & mobile A surface is ready for editing. (nb also fires when switching to/from 2017WTE) Many globalsearch

codesearch

ve.toolbarSaveButton.stateChanged Desktop & mobile The main save button has been enabled/disabled GuidedTour globalsearch

codesearch

ve.saveDialog.stateChanged Desktop & mobile The save dialog has been opened or changed panel Edit summary gadgets and TemplateSandbox, the Wikipedia Adventure globalsearch

codesearch

ve.deactivate Desktop VE has started to close Planned for deprecation. globalsearch

codesearch

ve.deactivationComplete Desktop & mobile VE has finished closing. Doesn't fire if loading is aborted before the target is ready. Many globalsearch

codesearch

plugin registry

[edit]
Name Platform(s) When Users Usage
mw.libs.ve.addPlugin Desktop Runs after VE is loaded, but before it is initialized. Anyone trying to register a tool. globalsearch

codesearch

mw.libs.ve.targetLoader.addPlugin Desktop & mobile Runs after VE is loaded, but before it is initialized. Anyone trying to register a tool. globalsearch

codesearch

Server hooks

[edit]
Name Platform(s) Description Users Usage
VisualEditorBeforeEditorHook Desktop & mobile Executed before deciding if the editor is available on a certain page. FileImporter, Translate codesearch
VisualEditorApiVisualEditorEditPreSaveHook API Executed in calls to ApiVisualEditorEdit using action=save, before the save is attempted. GrowthExperiments codesearch
VisualEditorApiVisualEditorEditPostSaveHook API Executed in the ApiVisualEditorEdit after a action=save attempt. GrowthExperiments codesearch