mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-04 18:58:37 +00:00
122f49b2dd
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
40 lines
928 B
JavaScript
40 lines
928 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWParameterCheckboxInputWidget class.
|
|
*
|
|
* @copyright 2011-2017 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Creates an ve.ui.MWParameterCheckboxInputWidget object.
|
|
*
|
|
* @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' );
|
|
};
|