mediawiki-extensions-Templa.../modules/ext.templateDataGenerator.editPage.js
Moriel Schottlender b313bbe485 Refactor TemplateData Editor
Refactor and rewrite the templatedata editor to make it more flexible and
adaptable to new types. Separating the model from the gui, and adding new and
improved unit tests.

Also added features:
* Map depracated param types into current types.
* Retrieve template code from top template page if we are in a subpage.
* Mark parameters that do not appear in the template code.
* Add parameter types and a more flexible way to add and adjust the types.
* Add a link to TemplateData documentation from the main edit page.
* Add support for paramOrder; order the parameters according to the given array.
* Make the template parameter table sortable so users can change the paraOrder.

Bug: 59745
Bug: 65951
Bug: 66920
Bug: 67310
Bug: 67621
Change-Id: I65a76c2b772ef76c5dbbe71dd433c881c097b202
2014-08-30 15:18:05 -07:00

21 lines
539 B
JavaScript

( function ( $, mw ) {
/**
* TemplateData Generator button fixture
* The button will appear on Template namespaces only, above the edit textbox
*
* @author Moriel Schottlender
*/
'use strict';
$( function () {
var $textbox = $( '#wpTextbox1' );
// Check if there's an editor textarea and if we're in the proper namespace
if ( $textbox.length && mw.config.get( 'wgCanonicalNamespace' ) === 'Template' ) {
mw.libs.templateDataGenerator.init( $( '#mw-content-text' ), $textbox );
}
} );
}( jQuery, mediaWiki ) );