mediawiki-extensions-Templa.../modules/ext.templateDataGenerator.editPage.js
Ed Sanders 822d0cd345 Rename module editPage→editTemplatePage, create minimal new editPage module
VisualEditorPluginModules loads whenever VE loads, so create a minimal
loader page to check if we are in the template namespace before loading
the rest of the TemplateData init code.

Bug: T208765
Change-Id: Id127eb4a2472a6ce9da7672f9237b182cf6be2eb
2018-11-24 00:14:03 +00:00

14 lines
406 B
JavaScript

/*!
* TemplateData Generator edit page init
*
* @author Moriel Schottlender
* @author Ed Sanders
*/
// We're on an edit page, but we don't know what namespace yet (e.g. when loaded by VisualEditorPluginModules)
if (
mw.config.get( 'wgCanonicalNamespace' ) === 'Template' &&
mw.config.get( 'wgPageContentModel' ) === 'wikitext'
) {
mw.loader.using( 'ext.templateDataGenerator.editTemplatePage' );
}