mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
c53685b865
Also removed a few redundant headings in class documentation comments. There is already an @class and it looks a bit odd in the generated pages: <h2>TextString</h2> <p>TextString</p> <p>This class provides a ...</p> Change-Id: Ie311c6993ed02e79272dbde71f6a1bc252ef3037
83 lines
2 KiB
JavaScript
83 lines
2 KiB
JavaScript
/*!
|
|
* VisualEditor user interface MetaDialog class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Document dialog.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
* @extends ve.ui.Dialog
|
|
*
|
|
* @constructor
|
|
* @param {ve.Surface} surface
|
|
*/
|
|
ve.ui.MetaDialog = function VeUiMetaDialog( surface ) {
|
|
// Parent constructor
|
|
ve.ui.Dialog.call( this, surface );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.MetaDialog, ve.ui.Dialog );
|
|
|
|
/* Static Properties */
|
|
|
|
/**
|
|
* Localized message for dialog title.
|
|
*
|
|
* @static
|
|
* @property {string}
|
|
*/
|
|
ve.ui.MetaDialog.static.titleMessage = 'visualeditor-dialog-meta-title';
|
|
|
|
ve.ui.MetaDialog.static.icon = 'settings';
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Handle frame ready events.
|
|
*
|
|
* @method
|
|
*/
|
|
ve.ui.MetaDialog.prototype.initialize = function () {
|
|
// Call parent method
|
|
ve.ui.Dialog.prototype.initialize.call( this );
|
|
|
|
// Properties
|
|
this.outlinePanel = new ve.ui.PanelLayout( { '$$': this.$$ } );
|
|
this.editorPanel = new ve.ui.EditorPanelLayout( {
|
|
'$$': this.$$, 'title': 'Categories', 'icon': 'categories'
|
|
} );
|
|
this.layout = new ve.ui.GridLayout(
|
|
[this.outlinePanel, this.editorPanel],
|
|
{ '$$': this.$$, 'widths': [1, 2] }
|
|
);
|
|
|
|
// HACK
|
|
this.outlineWidget = new ve.ui.OutlineWidget( { '$$': this.$$ } );
|
|
this.outlineWidget.addItems( [
|
|
new ve.ui.OutlineItemWidget(
|
|
'categories', { '$$': this.$$, 'icon': 'categories', 'label': 'Categories' }
|
|
),
|
|
new ve.ui.OutlineItemWidget(
|
|
'languages', { '$$': this.$$, 'icon': 'language', 'label': 'Languages' }
|
|
)
|
|
] );
|
|
this.outlineWidget.selectItem( this.outlineWidget.getClosestSelectableItem( 0 ) );
|
|
|
|
// Initialization
|
|
this.outlinePanel.$.addClass( 've-ui-metaDialog-outlinePanel' );
|
|
this.editorPanel.$.addClass( 've-ui-metaDialog-editorPanel' );
|
|
this.$body.append( this.layout.$ );
|
|
this.outlinePanel.$.append( this.outlineWidget.$ );
|
|
this.layout.update();
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.dialogFactory.register( 'meta', ve.ui.MetaDialog );
|