mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-22 19:12:50 +00:00
d42a0772bb
Avoids having to update the date in every file every year, which we stopped doing. Change-Id: I7bf7aa0937eef911e00772470091753a7b06fd3d
40 lines
907 B
JavaScript
40 lines
907 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWParameterCheckboxInputWidget class.
|
|
*
|
|
* @copyright 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.super.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' );
|
|
};
|