/* Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Motorola Mobility LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @module "montage/ui/input-checkbox.reel" @requires montage/core/core @requires montage/ui/check-input */ var Montage = require("montage").Montage, Component = require("ui/component").Component, CheckInput = require("ui/check-input").CheckInput; /** @class module:"montage/ui/input-checkbox.reel".InputCheckbox @extends module:montage/ui/check-input.CheckInput */ var InputCheckbox = exports.InputCheckbox = Montage.create(CheckInput, {}); InputCheckbox.addAttributes( /** @lends module:"montage/ui/input-checkbox.reel".InputCheckbox# */ { /** Specifies if the checkbox control should receive focus when the document loads. Because Montage components are loaded asynchronously after the document has loaded, setting this property has no effect on the element's focus state. @type {boolean} @default false */ autofocus: {value: false, dataType: 'boolean'}, /** Specifies if the checkbox control is disabled. @type {boolean} @default false */ disabled: {value: false, dataType: 'boolean'}, /** Specifies if the checkbox is in it checked state or not. @type {boolean} @default false */ checked: {value: false, dataType: 'boolean'}, /** The value of the id attribute of the form with which to associate the element. @type {string} @default null */ form: null, /** The name part of the name/value pair associated with this element for the purposes of form submission. @type {string} @default null */ name: null, /** Specifies if this control is readonly. @type {boolean} @default false */ readonly: {value: false, dataType: 'boolean'}, /** A string the browser displays in a tooltip when the user hovers their mouse over the element. @type {string} @default null */ title: null, /* The value associated with the checkbox. Per the WC3 specification, if the element has a value attribute then the value of that attribute's value is returned; otherwise, it returns "on". @type {string} @default "on" */ value: {value: 'on'} });