mediawiki-extensions-Visual.../modules/ve-mw/ui/widgets/ve.ui.MWParameterCheckboxInputWidget.js
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00

40 lines
928 B
JavaScript

/*!
* VisualEditor UserInterface MWParameterCheckboxInputWidget class.
*
* @copyright 2011-2018 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' );
};