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-24 00:22:45 +00:00
|
|
|
* @extends ve.ui.ActionDialog
|
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
|
|
|
// Parent constructor
|
2014-04-24 00:22:45 +00:00
|
|
|
ve.ui.MWBetaWelcomeDialog.super.call( this, config );
|
2013-08-01 20:18:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-04-24 00:22:45 +00:00
|
|
|
OO.inheritClass( ve.ui.MWBetaWelcomeDialog, ve.ui.ActionDialog );
|
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
|
|
|
/**
|
2014-04-24 00:22:45 +00:00
|
|
|
* @inheritdoc
|
2013-11-05 00:29:50 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWBetaWelcomeDialog.prototype.getTitle = function () {
|
2014-04-24 00:22:45 +00:00
|
|
|
// Send the MediaWiki username along with the message for {{GENDER:}} i18n support
|
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
|
|
|
};
|
|
|
|
|
2014-04-24 00:22:45 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWBetaWelcomeDialog.prototype.getApplyButtonLabel = function () {
|
|
|
|
return ve.msg( 'visualeditor-dialog-beta-welcome-action-continue' );
|
|
|
|
};
|
|
|
|
|
2013-08-01 20:18:33 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWBetaWelcomeDialog.prototype.initialize = function () {
|
|
|
|
// Parent method
|
2014-04-24 00:22:45 +00:00
|
|
|
ve.ui.MWBetaWelcomeDialog.super.prototype.initialize.call( this );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
// Properties
|
2014-04-24 00:22:45 +00:00
|
|
|
this.contentPanel = new OO.ui.PanelLayout( {
|
2013-11-01 19:45:59 +00:00
|
|
|
'$': this.$,
|
2013-09-03 20:54:15 +00:00
|
|
|
'scrollable': true,
|
2014-04-24 00:22:45 +00:00
|
|
|
'padded': true,
|
|
|
|
'classes': [ 've-ui-mwBetaWelcomeDialog-content' ],
|
|
|
|
'text': ve.msg( 'visualeditor-dialog-beta-welcome-content', $( '#ca-edit' ).text() )
|
2013-09-03 20:54:15 +00:00
|
|
|
} );
|
2013-08-01 20:18:33 +00:00
|
|
|
|
|
|
|
// Initialization
|
2014-04-24 00:22:45 +00:00
|
|
|
this.panels.addItems( [ this.contentPanel ] );
|
2013-08-01 20:18:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
2014-04-21 22:31:21 +00:00
|
|
|
ve.ui.windowFactory.register( ve.ui.MWBetaWelcomeDialog );
|