From f23868334112ca67ac840b42c8c45e009211c5df Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Wed, 15 May 2013 15:13:38 -0700 Subject: [PATCH] Content for Template Dialog Initial commit of page content. Change-Id: Iffdf4f4179c6f3b04611d4bd9548e7cf23188856 --- .../ve/ui/dialogs/ve.ui.MWTemplateDialog.js | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/ve/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve/ui/dialogs/ve.ui.MWTemplateDialog.js index 6205aa23e2..da13424a82 100644 --- a/modules/ve/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -85,7 +85,7 @@ ve.ui.MWTemplateDialog.prototype.initialize = function () { * @method */ ve.ui.MWTemplateDialog.prototype.onOpen = function () { - var param; + var param, pageName, fieldset, textInput; // Parent method ve.ui.PagedDialog.prototype.onOpen.call( this ); @@ -93,14 +93,29 @@ ve.ui.MWTemplateDialog.prototype.onOpen = function () { // Add template page this.addPage( 'template', this.templateData.title, 'template' ); - // Add page for each parameter + // Loop through parameters for ( param in this.templateData.params ) { + pageName = 'parameter_' + param, + + // Create pages this.addPage( - 'parameter_' + param, + pageName, this.templateData.params[param].label.en, // TODO: use proper language instead of hardcoded 'en' 'parameter', 1 ); + + // Create content + fieldset = new ve.ui.FieldsetLayout( { + '$$': this.$$, 'label': 'Parameter', 'icon': 'template' + } ); + textInput = new ve.ui.TextInputWidget( { + '$$': this.$$, 'multiline': true + } ); + textInput.$input.css('height', 100); + + fieldset.$.append( textInput.$ ); + this.pages[pageName].$.append( fieldset.$ ); } };