2014-10-29 21:50:14 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWParameterCheckboxInputWidget class.
|
|
|
|
*
|
2023-12-01 16:06:11 +00:00
|
|
|
* @copyright See AUTHORS.txt
|
2014-10-29 21:50:14 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2022-07-12 09:55:54 +00:00
|
|
|
* Checkbox input for a parameter value which can only contain boolean values.
|
2014-10-29 21:50:14 +00:00
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends OO.ui.CheckboxInputWidget
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
ve.ui.MWParameterCheckboxInputWidget = function VeUiMWParameterCheckboxInputWidget() {
|
|
|
|
// Parent constructor
|
2023-11-02 16:42:31 +00:00
|
|
|
ve.ui.MWParameterCheckboxInputWidget.super.apply( this, arguments );
|
2014-10-29 21:50:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWParameterCheckboxInputWidget, OO.ui.CheckboxInputWidget );
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWParameterCheckboxInputWidget.prototype.getValue = function () {
|
|
|
|
return this.isSelected() ? '1' : '0';
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWParameterCheckboxInputWidget.prototype.setValue = function ( value ) {
|
|
|
|
return this.setSelected( value === '1' );
|
|
|
|
};
|