mediawiki-extensions-Visual.../modules/ve-mw/ui/widgets/ve.ui.MWParameterCheckboxInputWidget.js
Adam Wight d77728bd4f Document some classes touched in the sidebar rewrite
Depends-On: I385dca1d95033961d3844e888521750443e49c95
Change-Id: Ic515b41863bcf2ac4daa0272f67e1d30238a4b85
2022-07-12 12:49:31 +02:00

40 lines
948 B
JavaScript

/*!
* VisualEditor UserInterface MWParameterCheckboxInputWidget class.
*
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Checkbox input for a parameter value which can only contain boolean values.
*
* @class
* @extends OO.ui.CheckboxInputWidget
*
* @constructor
*/
ve.ui.MWParameterCheckboxInputWidget = function VeUiMWParameterCheckboxInputWidget() {
// Parent constructor
ve.ui.MWParameterCheckboxInputWidget.parent.apply( this, arguments );
};
/* 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' );
};