1 /* 2 * ***** BEGIN LICENSE BLOCK ***** 3 * Zimbra Collaboration Suite Web Client 4 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016 Synacor, Inc. 5 * 6 * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: https://www.zimbra.com/license 9 * The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 10 * have been added to cover use of software over a computer network and provide for limited attribution 11 * for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B. 12 * 13 * Software distributed under the License is distributed on an "AS IS" basis, 14 * WITHOUT WARRANTY OF ANY KIND, either express or implied. 15 * See the License for the specific language governing rights and limitations under the License. 16 * The Original Code is Zimbra Open Source Web Client. 17 * The Initial Developer of the Original Code is Zimbra, Inc. All rights to the Original Code were 18 * transferred by Zimbra, Inc. to Synacor, Inc. on September 14, 2015. 19 * 20 * All portions of the code are Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016 Synacor, Inc. All Rights Reserved. 21 * ***** END LICENSE BLOCK ***** 22 */ 23 24 /** 25 * Creates a radio button. 26 * @constructor 27 * @class 28 * This class implements a radio button. 29 * 30 * @param {hash} params a hash of parameters 31 * @param {DwtComposite} params.parent the parent widget 32 * @param {constant} params.style the text style. May be one of: {@link DwtCheckbox.TEXT_LEFT} or 33 * {@link DwtCheckbox.TEXT_RIGHT} arithimatically or'd (|) with one of: 34 * {@link DwtCheckbox.ALIGN_LEFT}, {@link DwtCheckbox.ALIGN_CENTER}, or 35 * {@link DwtCheckbox.ALIGN_LEFT}. 36 * The first determines were in the checkbox the text will appear 37 * (if set), the second determine how the content of the text will be 38 * aligned. The default value for this parameter is: 39 * {@link DwtCheckbox.TEXT_LEFT} | {@link DwtCheckbox.ALIGN_CENTER} 40 * @param {string} params.name the input control name (required for IE) 41 * @param {string} params.value the input control value. 42 * @param {boolean} params.checked the input control checked status (required for IE) 43 * @param {string} params.className the CSS class 44 * @param {constant} params.posStyle the positioning style (see {@link DwtControl}) 45 * @param {string} params.id an explicit ID to use for the control's HTML element 46 * @param {number} params.index the index at which to add this control among parent's children 47 * 48 * @extends DwtCheckbox 49 */ 50 DwtRadioButton = function(params) { 51 if (arguments.length == 0) { return; } 52 params = Dwt.getParams(arguments, DwtRadioButton.PARAMS); 53 params.className = params.className || "DwtRadioButton"; 54 DwtCheckbox.call(this, params); 55 } 56 57 DwtRadioButton.PARAMS = DwtCheckbox.PARAMS; 58 59 DwtRadioButton.prototype = new DwtCheckbox; 60 DwtRadioButton.prototype.constructor = DwtRadioButton; 61 62 DwtRadioButton.prototype.isDwtRadioButton = true; 63 DwtRadioButton.prototype.isInputControl = true; 64 DwtRadioButton.prototype.toString = function() { return "DwtRadioButton"; }; 65 66 // 67 // Data 68 // 69 70 DwtRadioButton.prototype.INPUT_TYPE = 'radio'; 71