New gadget file: VisualEditor loader for Citation generator
 
Fix RefGenVeLoader: use mw.libs.ve.addPlugin queue (targetLoader is not defined at load time)
 
Line 3: Line 3:
  * Registers the Citation generator VisualEditor plugin once VE loads.
  * Registers the Citation generator VisualEditor plugin once VE loads.
  * The actual tool lives in the hidden ext.gadget.RefGenVe module.
  * The actual tool lives in the hidden ext.gadget.RefGenVe module.
*
* Uses mw.libs.ve.addPlugin (provided by
* ext.visualEditor.desktopArticleTarget.init): plugins are queued and
* loaded when the VE target initializes.
  * ===================================================================== */
  * ===================================================================== */
if ( mw.libs.ve && mw.libs.ve.targetLoader ) {
if ( mw.libs.ve && mw.libs.ve.addPlugin ) {
mw.libs.ve.targetLoader.addPlugin( 'ext.gadget.RefGenVe' );
mw.libs.ve.addPlugin( 'ext.gadget.RefGenVe' );
}
}

Latest revision as of 18:56, 15 October 2026

/* =====================================================================
 * Bharatpedia Gadget: RefGenVeLoader
 * Registers the Citation generator VisualEditor plugin once VE loads.
 * The actual tool lives in the hidden ext.gadget.RefGenVe module.
 *
 * Uses mw.libs.ve.addPlugin (provided by
 * ext.visualEditor.desktopArticleTarget.init): plugins are queued and
 * loaded when the VE target initializes.
 * ===================================================================== */
if ( mw.libs.ve && mw.libs.ve.addPlugin ) {
	mw.libs.ve.addPlugin( 'ext.gadget.RefGenVe' );
}