%xformsDTD; ]> aControl.setAttribute("label", aLabel); aControl.setAttribute("class", aType); if (aControl) aControl.setAttribute("checked", "true"); if (aControl) aControl.removeAttribute("checked"); if (aNode.localName != "toolbarbutton" || aNode.namespaceURI != this.XUL_NS) return false; return true; this.buildUIInternal(); if (!this._dayContainer) this._dayContainer = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "dayContainer"); return this._dayContainer; null var target = event.originalTarget; if (this.isDayControl(target)) this.processAction(target.getAttribute("class"), target.getAttribute('label')); this.refreshInternal(aCurrentDay, aDaysRefreshOnly); this.monthyearBox.month = this.month - 1; this.monthyearBox.year = this.year; var handler = { handleEvent: function handleEvent(aEvent) { this.widget.setDate(this.monthyear.year, this.monthyear.month + 1); }, widget: this, monthyear: this.monthyearBox }; this.monthyearBox.addEventListener("change", handler, false); if (!this._monthyearBox) { this._monthyearBox = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "monthyear"); } return this._monthyearBox; null if (!this.hasAttribute("internaltabhandling")) return; event.preventDefault(); if (this.monthyearBox.isMonthFocused()) this.monthyearBox.focusYear(); else if (this.monthyearBox.isYearFocused()) this.focus(); else this.monthyearBox.focusMonth(); if (!this.hasAttribute("internaltabhandling")) return; event.preventDefault(); if (this.monthyearBox.isMonthFocused()) this.focus(); else if (this.monthyearBox.isYearFocused()) this.monthyearBox.focusMonth(); else this.monthyearBox.focusYear(); return Components.interfaces.nsIAccessibleProvider.XFormsDropmarkerWidget; return document.getAnonymousElementByAttribute(this, "anonid", "increaseButton"); return document.getAnonymousElementByAttribute(this, "anonid", "decreaseButton"); this.removeAttribute("state"); this.removeAttribute("state"); false null 0 "." if (this._valueEntered) { var newval = this.inputField.value; newval = newval.replace(this.decimalSymbol, "."); this._validateValue(newval, false); } return this._value; return this._validateValue(val, false); var min = this.getAttribute("min"); return min ? Number(min) : 0; var max = this.getAttribute("max"); return max ? Number(max) : Infinity; = val) this._validateValue(val, false); return val; ]]> var places = this.getAttribute("decimalplaces"); return places ? Number(places) : 0; if (typeof val == "number") { this.setAttribute("decimalplaces", val); this._validateValue(this.value, false); } return val; var increment = this.getAttribute("increment"); return increment ? Number(increment) : 1; return this._validateValue(this.value - this.increment, true); return this._validateValue(this.value + this.increment, true); = this.max); } ]]> = max) aValue = (aIsIncDec && wrapAround ? min : max); // Round the value to specified number of decimal places. var places = this.decimalPlaces; if (places != Infinity) aValue = aValue.toFixed(places); this._valueEntered = false; this._value = Number(aValue); // Localization: use the correct decimal symbol. this.inputField.value = aValue.replace(/\./, this.decimalSymbol); if (!wrapAround) this._enableDisableButtons(); return aValue; ]]> var evt = document.createEvent("Events"); evt.initEvent("change", true, true); this.dispatchEvent(evt); var evt = document.createEvent("Events"); evt.initEvent(eventname, true, false); this.dispatchEvent(evt); this._valueEntered = true; 57) event.preventDefault(); } ]]> this._modifyUp(); this._modifyDown(); if (event.originalTarget == this.inputField) { var newval = this.inputField.value; newval = newval.replace(this.decimalSymbol, "."); this._validateValue(newval, false); } 11) val = 0; if (!this.monthNames.length) { for (var month = 0; month < 12; month++) { var loc = new Date(1970, month).toLocaleFormat("%B"); this.monthNames.push(loc); this.monthValues[loc] = month; } } this.inputField.value = this.monthNames[val]; ]]> this.value++; this.fireEvent("change"); this.fireEvent("spinup"); this.value--; this.fireEvent("change"); this.fireEvent("spindown"); var evt = document.createEvent("Events"); evt.initEvent(aName, true, false); this.dispatchEvent(evt); if (this.value == undefined) this.value = 0; new Array() new Object() this._modifyUp(); this._modifyDown(); this.monthField.focus(); this.yearField.focus(); return this.getFocusedElement() == this.monthField; return this.getFocusedElement() == this.yearField; var focused = this.ownerDocument.commandDispatcher.focusedElement; if (!focused) return; var binding = this.ownerDocument.getBindingParent(focused); return binding; var handler = { handleEvent: function handleEvent(aEvent) { if (aEvent.type == "spinup") { if (this.widget.month == 0) this.widget.year++; } else if (this.widget.month == 11) { this.widget.year--; } }, widget: this }; this.monthField.addEventListener("spinup", handler, false); this.monthField.addEventListener("spindown", handler, false); if (!this._monthField) this._monthField = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "month"); return this._monthField; null if (!this._yearField) this._yearField = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "year"); return this._yearField; null if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._yearSpin) { this._yearSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "yearSpin"); } return this._yearSpin; null if (!this._monthSpin) { this._monthSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "monthSpin"); } return this._monthSpin; null if (!this._daySpin) { this._daySpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "daySpin"); } return this._daySpin; null if (!this._hoursSpin) { this._hoursSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "hoursSpin"); } return this._hoursSpin; null if (!this._minutesSpin) { this._minutesSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minutesSpin"); } return this._minutesSpin; null if (!this._secondsSpin) { this._secondsSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "secondsSpin"); } return this._secondsSpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._yearSpin) { this._yearSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "yearSpin"); } return this._yearSpin; null if (!this._monthSpin) { this._monthSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "monthSpin"); } return this._monthSpin; null if (!this._daySpin) { this._daySpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "daySpin"); } return this._daySpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._hoursSpin) { this._hoursSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "hoursSpin"); } return this._hoursSpin; null if (!this._minutesSpin) { this._minutesSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minutesSpin"); } return this._minutesSpin; null if (!this._secondsSpin) { this._secondsSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "secondsSpin"); } return this._secondsSpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._spinLabel) { this._spinLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "spinLabel"); } return this._spinLabel; null if (!this._spinValue) { this._spinValue = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "spinValue"); } return this._spinValue; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null &xforms.date.day.label.field; this.spinLabel.value = this._daySpinLabel; &xforms.date.month.label.field; this.spinLabel.value = this._monthSpinLabel; &xforms.date.year.label.field; this.spinLabel.value = this._yearSpinLabel; this.spinValue.size = 3; if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._monthSpin) { this._monthSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "monthSpin"); } return this._monthSpin; null if (!this._daySpin) { this._daySpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "daySpin"); } return this._daySpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._yearSpin) { this._yearSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "yearSpin"); } return this._yearSpin; null if (!this._monthSpin) { this._monthSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "monthSpin"); } return this._monthSpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._yearSpin) { this._yearSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "yearSpin"); } return this._yearSpin; null if (!this._monthSpin) { this._monthSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "monthSpin"); } return this._monthSpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null = endHours) { // Current hour is the end hour of the end day. minMinutes = 0; maxMinutes = endMinutes; if (currentMinutes >= endMinutes) { // Current minutes is greater than or equal to the end // minutes of the end day. Seconds can range between the // minimum number of seconds in a minute to the seconds of // the end duration. minSeconds = 0; maxSeconds = endSeconds; } else { // Current minutes is between the start and end minutes of // the current hour. Seconds range between their minimum and // maximum values. minSeconds = 0; maxSeconds = 59; } } else { // Current hours is between the start and end hours of the // end day. Minutes and seconds can range between their // minimum and maximum values. minMinutes = 0; maxMinutes = 59; minSeconds = 0; maxSeconds = 59; } } } else { // Range is more than one full day. // Example: start= P1DT10H59M59S, end=P3DT23H30M10S // Example: start= P1DT0H0M0S, end=P3DT0H0M0S if (currentDays == startDays) { // Min hours is the start hours and max hours is the maximum // number of hours in a day. // on the end hours. minHours = startHours; maxHours = 23; // Minutes depends on the current hour. if (currentHours == startHours) { // Current hours is equal to the start hours. Minutes range // from the start minutes to the maximum number of minutes // in an hour. minMinutes = startMinutes; maxMinutes = 59; // Seconds depends on the current minutes. if (currentMinutes == startMinutes) { // Current minutes is equal to the start minutes. Seconds // range from the start seconds to the maximum number of // seconds in a minute. minSeconds = startSeconds; maxSeconds = 59; } else { // Current minutes is between the start and end minutes of // the current hour. Seconds range between their minimum // and maximum values. minSeconds = 0; maxSeconds = 59; } } else { // Current hours is between the start and end hours of the // current day. Minutes and seconds range between their minimum // and maximum values. minMinutes = 0; maxMinutes = 59; minSeconds = 0; maxSeconds = 59; } } else if (currentDays == endDays) { // Current day is equal to the end day. // Hours range between the minimum number of hours in a day and // the hours of the end duration. minHours = 0; maxHours = endHours; // Minutes depend on the current hour. if (currentHours == endHours) { // Current hour is equal to the end hour. Minutes range between // the minimum number of minutes in an hour and the minutes of // the end duration. minMinutes = 0; maxMinutes = endMinutes; // Seconds depends on the current minutes. if (currentMinutes >= endMinutes) { // Current minutes is greater than or equal to the end // minutes of the end day. Seconds range between the minimum // number of seconds in a minute and the seconds of the end // duration. minSeconds = 0; maxSeconds = endSeconds; } else { // Current minutes is between the start and end minutes of // the current hour. Seconds range between their minimum and // maximum values. minSeconds = 0; maxSeconds = 59; } } else { // Current hours is between the start and end hours of the // end day. Minutes and seconds range between their minimum // and maximum values. minMinutes = 0; maxMinutes = 59; minSeconds = 0; maxSeconds = 59; } } else { // Current day falls between the start and end days. Hours, // minutes, and seconds all range between their minimum and // maximum values. minHours = 0; maxHours = 23; minMinutes = 0; maxMinutes = 59; minSeconds = 0; maxSeconds = 59; } } // Set the min and max for the days, hours, minutes, // and seconds spinbuttons. this.daySpin.min = startDays; this.daySpin.max = endDays; this.hoursSpin.min = minHours; this.hoursSpin.max = maxHours; this.minutesSpin.min = minMinutes; this.minutesSpin.max = maxMinutes; this.secondsSpin.min = minSeconds; this.secondsSpin.max = maxSeconds; ]]> if (!this._minLabel) { this._minLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minLabel"); } return this._minLabel; null if (!this._daySpin) { this._daySpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "daySpin"); } return this._daySpin; null if (!this._hoursSpin) { this._hoursSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "hoursSpin"); } return this._hoursSpin; null if (!this._minutesSpin) { this._minutesSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "minutesSpin"); } return this._minutesSpin; null if (!this._secondsSpin) { this._secondsSpin = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "secondsSpin"); } return this._secondsSpin; null if (!this._maxLabel) { this._maxLabel = this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "maxLabel"); } return this._maxLabel; null