2013-08-03 14:17:16 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWExtensionInspector class.
|
|
|
|
*
|
2015-01-08 23:54:03 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2013-08-03 14:17:16 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-07-14 21:32:49 +00:00
|
|
|
* Inspector for editing generic MediaWiki extensions.
|
2013-08-03 14:17:16 +00:00
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @abstract
|
2015-03-23 15:09:49 +00:00
|
|
|
* @extends ve.ui.NodeInspector
|
2015-09-05 14:23:59 +00:00
|
|
|
* @mixins ve.ui.MWExtensionWindow
|
2013-08-03 14:17:16 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-03 14:17:16 +00:00
|
|
|
*/
|
2015-03-23 15:09:49 +00:00
|
|
|
ve.ui.MWExtensionInspector = function VeUiMWExtensionInspector() {
|
2013-08-03 14:17:16 +00:00
|
|
|
// Parent constructor
|
2015-03-23 15:09:49 +00:00
|
|
|
ve.ui.MWExtensionInspector.super.apply( this, arguments );
|
2015-09-05 14:23:59 +00:00
|
|
|
|
|
|
|
// Mixin constructors
|
|
|
|
ve.ui.MWExtensionWindow.call( this );
|
2013-08-03 14:17:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2015-03-23 15:09:49 +00:00
|
|
|
OO.inheritClass( ve.ui.MWExtensionInspector, ve.ui.NodeInspector );
|
2013-08-03 14:17:16 +00:00
|
|
|
|
2015-09-05 14:23:59 +00:00
|
|
|
OO.mixinClass( ve.ui.MWExtensionInspector, ve.ui.MWExtensionWindow );
|
2014-04-17 01:22:36 +00:00
|
|
|
|
2013-08-03 14:17:16 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
2015-09-05 14:23:59 +00:00
|
|
|
* @inheritdoc
|
2013-08-03 14:17:16 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWExtensionInspector.prototype.initialize = function () {
|
|
|
|
// Parent method
|
2014-05-31 04:47:08 +00:00
|
|
|
ve.ui.MWExtensionInspector.super.prototype.initialize.call( this );
|
2013-08-03 14:17:16 +00:00
|
|
|
|
2015-09-05 14:23:59 +00:00
|
|
|
// Mixin method
|
|
|
|
ve.ui.MWExtensionWindow.prototype.initialize.call( this );
|
2013-08-03 14:17:16 +00:00
|
|
|
|
|
|
|
// Initialization
|
2015-09-05 14:23:59 +00:00
|
|
|
this.$element.addClass( 've-ui-mwExtensionInspector' );
|
2014-07-14 21:32:49 +00:00
|
|
|
this.form.$element.append( this.input.$element );
|
2013-08-03 14:17:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-11-05 00:29:50 +00:00
|
|
|
* @inheritdoc
|
2013-08-03 14:17:16 +00:00
|
|
|
*/
|
2014-05-31 04:47:08 +00:00
|
|
|
ve.ui.MWExtensionInspector.prototype.getSetupProcess = function ( data ) {
|
2015-09-05 14:23:59 +00:00
|
|
|
var process;
|
2014-07-15 22:49:51 +00:00
|
|
|
data = data || {};
|
2015-09-05 14:23:59 +00:00
|
|
|
// Parent process
|
|
|
|
process = ve.ui.MWExtensionInspector.super.prototype.getSetupProcess.call( this, data );
|
|
|
|
// Mixin process
|
|
|
|
return ve.ui.MWExtensionWindow.prototype.getSetupProcess.call( this, data, process );
|
2013-11-05 00:29:50 +00:00
|
|
|
};
|
2013-11-08 14:57:50 +00:00
|
|
|
|
2013-11-05 00:29:50 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2014-05-31 04:47:08 +00:00
|
|
|
ve.ui.MWExtensionInspector.prototype.getReadyProcess = function ( data ) {
|
2015-09-05 14:23:59 +00:00
|
|
|
var process;
|
|
|
|
data = data || {};
|
|
|
|
// Parent process
|
|
|
|
process = ve.ui.MWExtensionInspector.super.prototype.getReadyProcess.call( this, data );
|
|
|
|
// Mixin process
|
|
|
|
return ve.ui.MWExtensionWindow.prototype.getReadyProcess.call( this, data, process ).next( function () {
|
|
|
|
// Focus the input
|
|
|
|
this.input.focus();
|
|
|
|
}, this );
|
2013-08-03 14:17:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-11-05 00:29:50 +00:00
|
|
|
* @inheritdoc
|
2013-08-03 14:17:16 +00:00
|
|
|
*/
|
2014-05-31 04:47:08 +00:00
|
|
|
ve.ui.MWExtensionInspector.prototype.getTeardownProcess = function ( data ) {
|
2015-09-05 14:23:59 +00:00
|
|
|
var process;
|
|
|
|
data = data || {};
|
|
|
|
// Parent process
|
|
|
|
process = ve.ui.MWExtensionInspector.super.prototype.getTeardownProcess.call( this, data );
|
|
|
|
// Mixin process
|
|
|
|
return ve.ui.MWExtensionWindow.prototype.getTeardownProcess.call( this, data, process );
|
2014-08-15 16:40:25 +00:00
|
|
|
};
|
|
|
|
|
2013-12-06 14:52:26 +00:00
|
|
|
/**
|
2015-09-05 14:23:59 +00:00
|
|
|
* @inheritdoc
|
2013-12-06 14:52:26 +00:00
|
|
|
*/
|
2015-09-05 14:23:59 +00:00
|
|
|
ve.ui.MWExtensionInspector.prototype.getActionProcess = function ( action ) {
|
|
|
|
// Parent process
|
|
|
|
var process = ve.ui.MWExtensionInspector.super.prototype.getActionProcess.call( this, action );
|
|
|
|
// Mixin process
|
|
|
|
return ve.ui.MWExtensionWindow.prototype.getActionProcess.call( this, action, process );
|
2013-12-06 14:52:26 +00:00
|
|
|
};
|