2013-05-15 18:44:32 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor user interface MWTemplateDialog class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Document dialog.
|
|
|
|
*
|
|
|
|
* @class
|
2013-05-15 20:39:34 +00:00
|
|
|
* @extends ve.ui.PagedDialog
|
2013-05-15 18:44:32 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.ui.Surface} surface
|
|
|
|
*/
|
|
|
|
ve.ui.MWTemplateDialog = function VeUiMWTemplateDialog( surface ) {
|
|
|
|
// Parent constructor
|
2013-05-15 20:39:34 +00:00
|
|
|
ve.ui.PagedDialog.call( this, surface );
|
2013-05-15 18:44:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-05-15 20:39:34 +00:00
|
|
|
ve.inheritClass( ve.ui.MWTemplateDialog, ve.ui.PagedDialog );
|
2013-05-15 18:44:32 +00:00
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.ui.MWTemplateDialog.static.titleMessage = 'visualeditor-dialog-template-title';
|
|
|
|
|
|
|
|
ve.ui.MWTemplateDialog.static.icon = 'template';
|
|
|
|
|
|
|
|
ve.ui.MWTemplateDialog.static.modelClasses = [ ve.dm.MWTemplateNode ];
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle frame ready events.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.ui.MWTemplateDialog.prototype.initialize = function () {
|
|
|
|
// Call parent method
|
2013-05-15 20:39:34 +00:00
|
|
|
ve.ui.PagedDialog.prototype.initialize.call( this );
|
|
|
|
|
|
|
|
this.addPage( 'param1', 'Parameter 1', 'template' )
|
|
|
|
.addPage( 'param2', 'Parameter 2', 'template' );
|
|
|
|
|
2013-05-15 18:44:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle frame ready events.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.ui.MWTemplateDialog.prototype.onOpen = function () {
|
|
|
|
// Parent method
|
|
|
|
ve.ui.Dialog.prototype.onOpen.call( this );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle frame ready events.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {string} action Action that caused the window to be closed
|
|
|
|
*/
|
|
|
|
ve.ui.MWTemplateDialog.prototype.onClose = function () {
|
|
|
|
// Parent method
|
|
|
|
ve.ui.Dialog.prototype.onOpen.call( this );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ui.dialogFactory.register( 'mwTemplate', ve.ui.MWTemplateDialog );
|
|
|
|
|
|
|
|
ve.ui.viewRegistry.register( 'mwTemplate', ve.ui.MWTemplateDialog );
|