From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- comm/suite/components/bindings/datetimepicker.xml | 1316 +++++++++++++++++++++ 1 file changed, 1316 insertions(+) create mode 100644 comm/suite/components/bindings/datetimepicker.xml (limited to 'comm/suite/components/bindings/datetimepicker.xml') diff --git a/comm/suite/components/bindings/datetimepicker.xml b/comm/suite/components/bindings/datetimepicker.xml new file mode 100644 index 0000000000..7475b6c04e --- /dev/null +++ b/comm/suite/components/bindings/datetimepicker.xml @@ -0,0 +1,1316 @@ + + + + + + %datetimepickerDTD; +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + null + + document.getAnonymousElementByAttribute(this, "anonid", "input-one"); + + + document.getAnonymousElementByAttribute(this, "anonid", "input-two"); + + + document.getAnonymousElementByAttribute(this, "anonid", "input-three"); + + + document.getAnonymousElementByAttribute(this, "anonid", "input-ampm"); + + + document.getAnonymousElementByAttribute(this, "anonid", "sep-first"); + + + document.getAnonymousElementByAttribute(this, "anonid", "sep-second"); + + null + true + false + null + + + + var focusedInput = document.activeElement; + if (focusedInput == this._fieldOne || + focusedInput == this._fieldTwo || + focusedInput == this._fieldThree || + focusedInput == this._fieldAMPM) + return focusedInput; + return this._lastFocusedField || this._fieldOne; + + + + + + + + + + + + + + + + var event = document.createEvent("Events"); + event.initEvent(aEventName, true, true); + return !aTarget.dispatchEvent(event); + + + + + + + + + + + + + + + + this._init(); + + var cval = this.getAttribute("value"); + if (cval) { + try { + this.value = cval; + return; + } catch (ex) { } + } + this.dateValue = new Date(); + + + + if (this.attachedControl) { + this.attachedControl.attachedControl = null; + this.attachedControl = null; + } + + + + + + + + + + + 57)) + event.preventDefault(); + ]]> + + + + if (this._hasEntry) + this._increaseOrDecrease(1); + + + if (this._hasEntry) + this._increaseOrDecrease(-1); + + + + this._valueEntered = true; + + + + this._setValueOnChange(event.originalTarget); + + + + + + +#else + extends="chrome://messenger/content/datetimepicker.xml#datetimepicker-base"> +#endif + + false + false + true + true + "AM" + "PM" + + null + null + null + + + + + + + + + + + + 23) + throw "Invalid Hour"; + this._setFieldValue(this.hourField, valnum); + return val; + ]]> + + + + + 59) + throw "Invalid Minute"; + this._setFieldValue(this.minuteField, valnum); + return val; + ]]> + + + + + 59) + throw "Invalid Second"; + this._setFieldValue(this.secondField, valnum); + return val; + ]]> + + + + + = 12); + ]]> + + + = 12) { + this.hour -= 12; + } + return val; + ]]> + + + + + return (this.getAttribute("hideseconds") == "true"); + + + if (val) + this.setAttribute("hideseconds", "true"); + else + this.removeAttribute("hideseconds"); + if (this.secondField) + this.secondField.parentNode.collapsed = val; + this._separatorSecond.collapsed = val; + return val; + + + + + = 60) + return 1; + return increment; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12) + aValue -= 12; + else if (aValue == 0) + aValue = 12; + this._fieldAMPM.value = this.isPM ? this.pmIndicator : + this.amIndicator; + } + } else if (aField == this.minuteField) { + prependZero = this.minuteLeadingZero; + } else if (aField == this.secondField) { + prependZero = this.secondLeadingZero; + } + + if (prependZero && aValue < 10) + aField.value = "0" + aValue; + else + aField.value = aValue; + ]]> + + + + + + + + = max) + return aNoWrap ? max - 1 : aValue - max; + return aValue; + ]]> + + + + + 12) + this.is24HourClock = true; + else + this.pmIndicator = numberFields[1] || numberFields[7]; + } + + var amTime = dtf.format(new Date(2000, 0, 1, 1, 7, 9)); + numberFields = amTime.match(numberOrder); + if (numberFields) { + this.hourLeadingZero = (numberFields[2].length > 1); + this.minuteLeadingZero = (numberFields[4].length > 1); + this.secondLeadingZero = (numberFields[6].length > 1); + + if (!this.is24HourClock) { + this.amIndicator = numberFields[1] || numberFields[7]; + if (numberFields[1]) { + var mfield = this._fieldAMPM.parentNode; + var mcontainer = mfield.parentNode; + mcontainer.insertBefore(mfield, mcontainer.firstChild); + } + var size = (numberFields[1] || numberFields[7]).length; + if (this.pmIndicator.length > size) + size = this.pmIndicator.length; + this._fieldAMPM.size = size; + this._fieldAMPM.maxLength = size; + } else { + this._fieldAMPM.parentNode.collapsed = true; + } + } + + this.hideSeconds = this.hideSeconds; + ]]> + + + + + + + + + + + + + + + false + true + true + + + + + + + + + + + + + + + + + 9999) + throw "Invalid Year"; + this._setFieldValue(this.yearField, valnum); + return val; + ]]> + + + + + 11) + throw "Invalid Month"; + this._setFieldValue(this.monthField, valnum); + return val; + ]]> + + + + + 31) + throw "Invalid Date"; + this._setFieldValue(this.dateField, valnum); + return val; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + max) + return aNoWrap ? max : min; + return aValue; + ]]> + + + + + 1); + this.monthLeadingZero = (numberFields[mi].length > 1); + this.dateLeadingZero = (numberFields[di].length > 1); + } + + this.yearField = document.getAnonymousElementByAttribute(this, "anonid", yfield); + if (!twoDigitYear) + this.yearField.parentNode.classList.add("datetimepicker-input-subbox", "datetimepicker-year"); + this.monthField = document.getAnonymousElementByAttribute(this, "anonid", mfield); + this.dateField = document.getAnonymousElementByAttribute(this, "anonid", dfield); + + this._fieldAMPM.parentNode.collapsed = true; + this.yearField.size = twoDigitYear ? 2 : 4; + this.yearField.maxLength = twoDigitYear ? 2 : 4; + ]]> + + + + + + + + + + +