Debian Codegraph @

extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWParameterCheckboxInputWidget.js

raw symbols SCIP
1 /*!
2 * VisualEditor UserInterface MWParameterCheckboxInputWidget class.
3 *
4 * @copyright See AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
6 */
7
8 /**
9 * Checkbox input for a parameter value which can only contain boolean values.
10 *
11 * @class
12 * @extends OO.ui.CheckboxInputWidget
13 *
14 * @constructor
15 */
16 ve.ui.MWParameterCheckboxInputWidget = function VeUiMWParameterCheckboxInputWidget() {
17 // Parent constructor
18 ve.ui.MWParameterCheckboxInputWidget.super.apply( this, arguments );
19 };
20
21 /* Inheritance */
22
23 OO.inheritClass( ve.ui.MWParameterCheckboxInputWidget, OO.ui.CheckboxInputWidget );
24
25 /* Methods */
26
27 /**
28 * @inheritdoc
29 */
30 ve.ui.MWParameterCheckboxInputWidget.prototype.getValue = function () {
31 return this.isSelected() ? '1' : '0';
32 };
33
34 /**
35 * @inheritdoc
36 */
37 ve.ui.MWParameterCheckboxInputWidget.prototype.setValue = function ( value ) {
38 return this.setSelected( value === '1' );
39 };