Add group field to reference dialog

Change-Id: Icf9ea348cd97bdb09ddf18769f53c01ea5a8b7ef
This commit is contained in:
Trevor Parscal 2013-06-14 10:30:03 -07:00
parent 0c16066eb3
commit acea97263b
3 changed files with 27 additions and 9 deletions

View file

@ -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',

View file

@ -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',

View file

@ -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.$
);
};
/**