2013-09-23 23:04:36 +00:00
|
|
|
/*global mw */
|
2013-08-01 20:18:33 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor user interface MWBetaWelcomeDialog class.
|
|
|
|
*
|
2014-01-05 12:05:05 +00:00
|
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
2013-08-01 20:18:33 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dialog for inserting MediaWiki media objects.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.MWDialog
|
|
|
|
*
|
|
|
|
* @constructor
|
2013-11-05 00:29:50 +00:00
|
|
|
* @param {ve.ui.WindowSet} windowSet Window set this dialog is part of
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-01 20:18:33 +00:00
|
|
|
*/
|
2013-10-09 19:59:03 +00:00
|
|
|
ve.ui.MWBetaWelcomeDialog = function VeUiMWBetaWelcomeDialog( windowSet, config ) {
|
2013-08-01 20:18:33 +00:00
|
|
|
// Configuration initialization
|
2013-09-20 07:09:06 +00:00
|
|
|
config = ve.extendObject( { 'small': true, 'footless': false }, config );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
// Parent constructor
|
2013-10-09 19:59:03 +00:00
|
|
|
ve.ui.MWDialog.call( this, windowSet, config );
|
2013-08-01 20:18:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWBetaWelcomeDialog, ve.ui.MWDialog );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.MWBetaWelcomeDialog.static.name = 'betaWelcome';
|
|
|
|
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWBetaWelcomeDialog.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-dialog-beta-welcome-title' );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
ve.ui.MWBetaWelcomeDialog.static.icon = 'help';
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
2013-11-05 00:29:50 +00:00
|
|
|
/**
|
|
|
|
* Get the title of the window.
|
|
|
|
*
|
|
|
|
* Send the MediaWiki username along with the message for {{GENDER:}} i18n support
|
|
|
|
* @returns {string} Window title
|
|
|
|
*/
|
|
|
|
ve.ui.MWBetaWelcomeDialog.prototype.getTitle = function () {
|
2014-02-12 21:45:37 +00:00
|
|
|
return ve.msg( this.constructor.static.title, mw.user );
|
2013-11-05 00:29:50 +00:00
|
|
|
};
|
|
|
|
|
2013-08-01 20:18:33 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWBetaWelcomeDialog.prototype.initialize = function () {
|
|
|
|
// Parent method
|
|
|
|
ve.ui.MWDialog.prototype.initialize.call( this );
|
|
|
|
|
|
|
|
// Properties
|
2013-10-09 20:09:59 +00:00
|
|
|
this.contentLayout = new OO.ui.PanelLayout( {
|
2013-11-01 19:45:59 +00:00
|
|
|
'$': this.$,
|
2013-09-03 20:54:15 +00:00
|
|
|
'scrollable': true,
|
|
|
|
'padded': true
|
|
|
|
} );
|
2014-01-17 14:24:12 +00:00
|
|
|
this.continueButton = new OO.ui.ButtonWidget( {
|
2013-11-01 19:45:59 +00:00
|
|
|
'$': this.$,
|
2013-08-01 20:18:33 +00:00
|
|
|
'label': ve.msg( 'visualeditor-dialog-beta-welcome-action-continue' ),
|
|
|
|
'flags': ['primary']
|
|
|
|
} );
|
|
|
|
|
|
|
|
// Events
|
2013-11-05 00:29:50 +00:00
|
|
|
this.continueButton.connect( this, { 'click': [ 'close', { 'action': 'close' } ] } );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
// Initialization
|
2013-11-01 19:45:59 +00:00
|
|
|
this.contentLayout.$element
|
2013-09-03 20:54:15 +00:00
|
|
|
.addClass( 've-ui-mwBetaWelcomeDialog-content' )
|
|
|
|
.text( ve.msg( 'visualeditor-dialog-beta-welcome-content', $( '#ca-edit' ).text() ) );
|
2013-11-01 19:45:59 +00:00
|
|
|
this.$body.append( this.contentLayout.$element );
|
|
|
|
this.$foot.append( this.continueButton.$element );
|
2013-08-01 20:18:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.dialogFactory.register( ve.ui.MWBetaWelcomeDialog );
|