2022-04-21 19:14:52 +00:00
|
|
|
/**
|
|
|
|
* VisualEditor UserInterface MWTabberDialog class.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.MWExtensionPreviewDialog
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
|
|
|
ve.ui.MWTabberDialog = function VeUiMWTabberDialog() {
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.MWTabberDialog.super.apply( this, arguments );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWTabberDialog, ve.ui.MWExtensionPreviewDialog );
|
|
|
|
|
|
|
|
/* Static properties */
|
|
|
|
|
|
|
|
ve.ui.MWTabberDialog.static.name = 'mwTabber';
|
|
|
|
|
|
|
|
ve.ui.MWTabberDialog.static.title =
|
|
|
|
OO.ui.deferMsg( 'tabberneue-visualeditor-mwtabberdialog-title' );
|
|
|
|
|
|
|
|
ve.ui.MWTabberDialog.static.modelClasses = [ ve.dm.MWTabberNode ];
|
|
|
|
|
|
|
|
ve.ui.MWTabberDialog.static.dir = 'ltr';
|
|
|
|
|
|
|
|
ve.ui.MWTabberDialog.static.size = 'larger';
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWTabberDialog.prototype.initialize = function () {
|
2022-04-23 00:00:32 +00:00
|
|
|
// Parent method
|
|
|
|
ve.ui.MWTabberDialog.super.prototype.initialize.call( this );
|
2022-04-21 19:14:52 +00:00
|
|
|
|
2022-04-23 00:00:32 +00:00
|
|
|
this.input = new ve.ui.MWAceEditorWidget( {
|
|
|
|
rows: 10,
|
|
|
|
maxRows: 25,
|
|
|
|
autosize: true
|
|
|
|
} )
|
|
|
|
.setLanguage( 'mediawiki' )
|
|
|
|
.toggleLineNumbers( false );
|
2022-04-21 19:14:52 +00:00
|
|
|
|
2022-04-23 00:00:32 +00:00
|
|
|
this.input.connect( this, { resize: 'updateSize' } );
|
2022-04-21 19:14:52 +00:00
|
|
|
|
2023-07-05 21:43:41 +00:00
|
|
|
const inputField = new OO.ui.FieldLayout( this.input, {
|
2022-04-23 00:00:32 +00:00
|
|
|
align: 'top'
|
|
|
|
} );
|
2022-04-21 19:14:52 +00:00
|
|
|
|
2023-07-05 21:43:41 +00:00
|
|
|
const panel = new OO.ui.PanelLayout( {
|
2022-04-23 00:00:32 +00:00
|
|
|
expanded: false,
|
|
|
|
padded: true
|
|
|
|
} );
|
2022-04-21 19:14:52 +00:00
|
|
|
|
2022-04-23 00:00:32 +00:00
|
|
|
panel.$element.append( inputField.$element );
|
2022-04-21 19:14:52 +00:00
|
|
|
|
2022-04-23 00:00:32 +00:00
|
|
|
this.$body
|
|
|
|
.addClass( 've-ui-mwTabberDialog-content' )
|
|
|
|
.append( panel.$element );
|
2022-04-21 19:14:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ui.windowFactory.register( ve.ui.MWTabberDialog );
|