From acea97263b5a49b95971579914385d3d8ed46232 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Fri, 14 Jun 2013 10:30:03 -0700 Subject: [PATCH] Add group field to reference dialog Change-Id: Icf9ea348cd97bdb09ddf18769f53c01ea5a8b7ef --- VisualEditor.i18n.php | 4 +++ VisualEditor.php | 4 +++ .../ve/ui/dialogs/ve.ui.MWReferenceDialog.js | 28 +++++++++++++------ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php index fb27a8a14e..592126045c 100644 --- a/VisualEditor.i18n.php +++ b/VisualEditor.i18n.php @@ -49,6 +49,10 @@ $messages['en'] = array( 'visualeditor-dialog-meta-languages-readonlynote' => 'This is a list of articles in other languages that are linked to this one; they cannot yet be edited using the VisualEditor', 'visualeditor-dialog-meta-languages-section' => 'Languages', 'visualeditor-dialog-meta-title' => 'Page settings', + 'visualeditor-dialog-reference-content-section' => 'Reference content', + 'visualeditor-dialog-reference-options-section' => 'Options', + 'visualeditor-dialog-reference-options-name-label' => 'Re-use by this name', + 'visualeditor-dialog-reference-options-group-label' => 'Use this group', 'visualeditor-dialog-reference-title' => 'Reference', 'visualeditor-dialog-media-title' => 'Media settings', 'visualeditor-dialog-transclusion-title' => 'Transclusion', diff --git a/VisualEditor.php b/VisualEditor.php index 8c51159e68..ddf8bb1664 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -581,6 +581,10 @@ $wgResourceModules += array( ), 'messages' => array( // VE messages needed by code that is only in experimental mode + 'visualeditor-dialog-reference-content-section', + 'visualeditor-dialog-reference-options-section', + 'visualeditor-dialog-reference-options-name-label', + 'visualeditor-dialog-reference-options-group-label', 'visualeditor-dialog-reference-title', 'visualeditor-dialog-transclusion-title', 'visualeditor-dialogbutton-reference-tooltip', diff --git a/modules/ve/ui/dialogs/ve.ui.MWReferenceDialog.js b/modules/ve/ui/dialogs/ve.ui.MWReferenceDialog.js index e09073e084..e179f10923 100644 --- a/modules/ve/ui/dialogs/ve.ui.MWReferenceDialog.js +++ b/modules/ve/ui/dialogs/ve.ui.MWReferenceDialog.js @@ -69,25 +69,35 @@ ve.ui.MWReferenceDialog.prototype.initialize = function () { // Properties this.contentFieldset = new ve.ui.FieldsetLayout( { - // TODO: use message string - '$$': this.frame.$$, 'label': 'Content', 'icon': 'parameter' + '$$': this.frame.$$, + 'label': ve.msg( 'visualeditor-dialog-reference-content-section' ), + 'icon': 'reference' } ); - this.nameFieldset = new ve.ui.FieldsetLayout( { - // TODO: use message string - '$$': this.frame.$$, 'label': 'Name', 'icon': 'parameter' + this.optionsFieldset = new ve.ui.FieldsetLayout( { + '$$': this.frame.$$, + 'label': ve.msg( 'visualeditor-dialog-reference-options-section' ), + 'icon': 'settings' } ); this.nameInput = new ve.ui.TextInputWidget( { '$$': this.frame.$$ } ); this.nameLabel = new ve.ui.InputLabelWidget( { '$$': this.frame.$$, 'input': this.nameInput, - // TODO: use message string - 'label': 'Reuse this reference by this name' + 'label': ve.msg( 'visualeditor-dialog-reference-options-name-label' ) + } ); + + this.groupInput = new ve.ui.TextInputWidget( { '$$': this.frame.$$ } ); + this.groupLabel = new ve.ui.InputLabelWidget( { + '$$': this.frame.$$, + 'input': this.groupInput, + 'label': ve.msg( 'visualeditor-dialog-reference-options-group-label' ) } ); // Initialization this.$body.addClass( 've-ui-mwReferenceDialog-body' ); - this.$body.append( this.contentFieldset.$, this.nameFieldset.$ ); - this.nameFieldset.$.append( this.nameLabel.$, this.nameInput.$ ); + this.$body.append( this.contentFieldset.$, this.optionsFieldset.$ ); + this.optionsFieldset.$.append( + this.nameLabel.$, this.nameInput.$, this.groupLabel.$, this.groupInput.$ + ); }; /**