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
|
|
|
|
*/
|
|
|
|
|
2014-04-04 17:42:13 +00:00
|
|
|
/*global mw */
|
|
|
|
|
2013-08-01 20:18:33 +00:00
|
|
|
/**
|
|
|
|
* Dialog for inserting MediaWiki media objects.
|
|
|
|
*
|
|
|
|
* @class
|
2014-04-04 17:42:13 +00:00
|
|
|
* @extends ve.ui.Dialog
|
2013-08-01 20:18:33 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-01 20:18:33 +00:00
|
|
|
*/
|
2014-04-04 17:42:13 +00:00
|
|
|
ve.ui.MWBetaWelcomeDialog = function VeUiMWBetaWelcomeDialog( config ) {
|
2013-08-01 20:18:33 +00:00
|
|
|
// Configuration initialization
|
2014-03-04 22:50:18 +00:00
|
|
|
config = ve.extendObject( { 'size': 'medium', 'footless': false }, config );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
// Parent constructor
|
2014-04-04 17:42:13 +00:00
|
|
|
ve.ui.Dialog.call( this, config );
|
2013-08-01 20:18:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-04-04 17:42:13 +00:00
|
|
|
OO.inheritClass( ve.ui.MWBetaWelcomeDialog, ve.ui.Dialog );
|
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
|
2014-04-04 17:42:13 +00:00
|
|
|
ve.ui.Dialog.prototype.initialize.call( this );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
// 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 */
|
|
|
|
|
2014-04-21 22:31:21 +00:00
|
|
|
ve.ui.windowFactory.register( ve.ui.MWBetaWelcomeDialog );
|