2014-04-08 19:15:15 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWMoreParametersResultWidget class.
|
|
|
|
*
|
2020-01-08 17:13:04 +00:00
|
|
|
* @copyright 2011-2020 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
|
2021-09-11 08:05:31 +00:00
|
|
|
* @param {Object} config
|
|
|
|
* @cfg {Object} data
|
|
|
|
* @cfg {number} data.remainder Number of remaining items currently not 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
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWMoreParametersResultWidget.super.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 */
|
|
|
|
|
2019-04-16 15:17:29 +00:00
|
|
|
/**
|
|
|
|
* Build the label element
|
|
|
|
*
|
2021-09-17 09:29:50 +00:00
|
|
|
* @private
|
2019-04-16 15:17:29 +00:00
|
|
|
* @return {jQuery}
|
|
|
|
*/
|
2014-04-08 19:15:15 +00:00
|
|
|
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 ) );
|
|
|
|
};
|