2014-04-08 19:15:15 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWMoreParametersResultWidget class.
|
|
|
|
*
|
2016-01-03 22:56:59 +00:00
|
|
|
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
|
2014-04-08 19:15:15 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an ve.ui.MWMoreParametersResultWidget object.
|
|
|
|
*
|
|
|
|
* @class
|
2014-10-28 00:46:32 +00:00
|
|
|
* @extends OO.ui.DecoratedOptionWidget
|
2014-04-08 19:15:15 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
2014-11-22 01:40:00 +00:00
|
|
|
* @param {Mixed} [config.data] Item data
|
|
|
|
* @param {number} [config.data.remainder] Remaining items that can be shown
|
2014-04-08 19:15:15 +00:00
|
|
|
*/
|
2014-11-22 01:40:00 +00:00
|
|
|
ve.ui.MWMoreParametersResultWidget = function VeUiMWMoreParametersResultWidget( config ) {
|
2014-04-08 19:15:15 +00:00
|
|
|
// Configuration initialization
|
2014-08-22 20:50:48 +00:00
|
|
|
config = ve.extendObject( { icon: 'parameter-set' }, config );
|
2014-04-08 19:15:15 +00:00
|
|
|
|
|
|
|
// Parent constructor
|
2014-11-22 01:40:00 +00:00
|
|
|
OO.ui.DecoratedOptionWidget.call( this, config );
|
2014-04-08 19:15:15 +00:00
|
|
|
|
|
|
|
// Initialization
|
|
|
|
this.$element.addClass( 've-ui-mwMoreParametersResultWidget' );
|
|
|
|
this.setLabel( this.buildLabel() );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-10-28 00:46:32 +00:00
|
|
|
OO.inheritClass( ve.ui.MWMoreParametersResultWidget, OO.ui.DecoratedOptionWidget );
|
2014-04-08 19:15:15 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/** */
|
|
|
|
ve.ui.MWMoreParametersResultWidget.prototype.buildLabel = function () {
|
2015-04-09 23:47:15 +00:00
|
|
|
return $( '<div>' )
|
2014-04-08 19:15:15 +00:00
|
|
|
.addClass( 've-ui-mwMoreParametersResultWidget-label' )
|
|
|
|
.text( ve.msg( 'visualeditor-parameter-search-more', this.data.remainder ) );
|
|
|
|
};
|