From fe3d816ba751a8b04660a80b7ccda685e575e7ca Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Fri, 6 May 2005 21:42:51 +0000 Subject: [PATCH] b=260120, improvements to datepicker and timepicker, forgot to cvs add new files last commit git-svn-id: svn://10.0.0.236/trunk@173141 18797224-902f-48f8-a5cc-f745e15eee43 --- .../datetimepickers/datetimepickers.css | 60 + .../datetimepickers/datetimepickers.xml | 1426 +++++++++++++++++ .../content/datetimepickers/minimonth.xml | 545 +++++++ .../datetimepickers/datetimepickers.css | 226 +++ .../datetimepickers/datetimepickers.css | 214 +++ 5 files changed, 2471 insertions(+) create mode 100644 mozilla/calendar/resources/content/datetimepickers/datetimepickers.css create mode 100644 mozilla/calendar/resources/content/datetimepickers/datetimepickers.xml create mode 100644 mozilla/calendar/resources/content/datetimepickers/minimonth.xml create mode 100644 mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css create mode 100644 mozilla/calendar/resources/skin/modern/datetimepickers/datetimepickers.css diff --git a/mozilla/calendar/resources/content/datetimepickers/datetimepickers.css b/mozilla/calendar/resources/content/datetimepickers/datetimepickers.css new file mode 100644 index 00000000000..5902396ae19 --- /dev/null +++ b/mozilla/calendar/resources/content/datetimepickers/datetimepickers.css @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is OEone Calendar Code, released October 31st, 2001. + * + * The Initial Developer of the Original Code is OEone Corporation. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +@import url("chrome://calendar/content/datetimepickers/minimonth.css"); + +datepicker { + -moz-binding: url("chrome://calendar/content/datetimepickers/datetimepickers.xml#datepicker"); +} + +datetimepicker { + -moz-binding: url("chrome://calendar/content/datetimepickers/datetimepickers.xml#datetimepicker"); +} + +timepicker { + -moz-binding: url("chrome://calendar/content/datetimepickers/datetimepickers.xml#timepicker"); +} + +timepicker-grids { + -moz-binding: url("chrome://calendar/content/datetimepickers/datetimepickers.xml#timepicker-grids"); +} + +timepicker-minute { + -moz-binding: url("chrome://calendar/content/datetimepickers/datetimepickers.xml#timepicker-minute"); +} + +timepicker-hour { + -moz-binding: url("chrome://calendar/content/datetimepickers/datetimepickers.xml#timepicker-hour"); +} diff --git a/mozilla/calendar/resources/content/datetimepickers/datetimepickers.xml b/mozilla/calendar/resources/content/datetimepickers/datetimepickers.xml new file mode 100644 index 00000000000..d242fa8fb9f --- /dev/null +++ b/mozilla/calendar/resources/content/datetimepickers/datetimepickers.xml @@ -0,0 +1,1426 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 59) + minutesByFive = 55; + return minutesByFive; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + currentYear + 30) + year -= 100; + } + // if time is also present, parse it + var hours = 0; var minutes = 0; var seconds = 0; + if (timeString != null) { + var time = this.parseTime(dateNumbersArray[4]); + if (time != null) { + hours = time.getHours(); + minutes = time.getMinutes(); + seconds = time.getSeconds(); + this.mLastDateParseIncludedTime = true; + } + } + tempDate = new Date(year, month, day, hours, minutes, seconds, 0); + } //else did not match regex, not a valid date + return tempDate; + ]]> + + + + + + + + + + + + + + + + + + + + + = HR_INDEX; k -= 2) { + var nextSepI = k + 1; + var nextDigitsI = k + 2; + if ((k == SEC_INDEX || + (!amProbeArray[nextDigitsI] && !pmProbeArray[nextDigitsI])) + && amProbeArray[nextSepI] && pmProbeArray[nextSepI] + && amProbeArray[nextSepI] != pmProbeArray[nextSepI]) + { + amProbeArray[POST_INDEX] = + amProbeArray[nextSepI] + amProbeArray[POST_INDEX]; + pmProbeArray[POST_INDEX] = + pmProbeArray[nextSepI] + pmProbeArray[POST_INDEX]; + this.ampmIndex = POST_INDEX; + break; + } + } + } + } + if (this.ampmIndex) { + var makeFormatRegExp = function(string) { + // make expr to accept either as provided, lowercased, or uppercased + var regExp = string.replace(/(\W)/g, "[$1]"); // escape punctuation + var lowercased = string.toLowerCase(); + if (string != lowercased) + regExp += "|"+lowercased; + var uppercased = string.toUpperCase(); + if (string != uppercased) + regExp += "|"+uppercased; + return regExp; + }; + amFormatExpr = makeFormatRegExp(amProbeArray[this.ampmIndex]); + pmFormatExpr = makeFormatRegExp(pmProbeArray[this.ampmIndex]); + } + } + } + // International formats ([roman, cyrillic]|arabic|chinese/kanji characters) + // covering languages of U.N. (en,fr,sp,ru,ar,zh) and G8 (en,fr,de,it,ru,ja). + // See examples at parseTimeOfDay. + var amExpr = + "[Aa\u0410\u0430][. ]?[Mm\u041c\u043c][. ]?|\u0635|\u4e0a\u5348|\u5348\u524d"; + var pmExpr = + "[Pp\u0420\u0440][. ]?[Mm\u041c\u043c][. ]?|\u0645|\u4e0b\u5348|\u5348\u5f8c"; + if (this.ampmIndex){ + amExpr = amFormatExpr+"|"+amExpr; + pmExpr = pmFormatExpr+"|"+pmExpr; + } + var ampmExpr = amExpr+"|"+pmExpr; + // Must build am/pm formats into parse time regexp so that it can + // match them without mistaking the initial char for an optional divider. + // (For example, want to be able to parse both "12:34pm" and + // "12H34M56Spm" for any characters H,M,S and any language's "pm". + // The character between the last digit and the "pm" is optional. + // Must recogize "pm" directly, otherwise in "12:34pm" the "S" pattern + // matches the "p" character so only "m" is matched as ampm suffix.) + // + // digitsExpr has 6 captures, so index of first ampmExpr is 1, of last is 8. + this.parseTimeRegExp = + new RegExp("("+ampmExpr+")?\\s?"+digitsExpr+"("+ampmExpr+")?\\s*$"); + this.amRegExp = new RegExp("^(?:"+amExpr+")$"); + this.pmRegExp = new RegExp("^(?:"+pmExpr+")$"); + // build time display format that mimics "%x" format without seconds + var ampmSep = (pmProbeString.indexOf(' ') != -1? " " : ""); + this.kTimeFormatString = + (this.ampmIndex == PRE_INDEX? "%p" + ampmSep + "%I:%M" : + this.ampmIndex == POST_INDEX? "%I:%M" + ampmSep + "%p" : "%H:%M"); + ]]> + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/calendar/resources/content/datetimepickers/minimonth.xml b/mozilla/calendar/resources/content/datetimepickers/minimonth.xml new file mode 100644 index 00000000000..669f30b3c0e --- /dev/null +++ b/mozilla/calendar/resources/content/datetimepickers/minimonth.xml @@ -0,0 +1,545 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css b/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css new file mode 100644 index 00000000000..1340c62dd96 --- /dev/null +++ b/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css @@ -0,0 +1,226 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is OEone Calendar Code, released October 31st, 2001. + * + * The Initial Developer of the Original Code is OEone Corporation. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/*-------------------------------------------------------------------- + * Datepicker (text field with minimonth popup) + *-------------------------------------------------------------------*/ + +/* flex box around menulist */ +.datepicker-box-class { +} + +/* menulist */ +.datepicker-text-class { + width: 11em; +} + +/* text input field */ +.datepicker-text-class input { +} + +/*------------------------------------------------------------------- + * Timepicker (text menulist with popup) + *-------------------------------------------------------------------*/ + +.timepicker-box-class { +} + +.timepicker-text-class { + width: 8em; +} + +/*------------------------------------------------------------------- + * popup (from timepicker/timepicker.css) + *-------------------------------------------------------------------*/ + +/* Box that occupies whole window */ + +vbox[anonid="time-picker-grids"] { + background-color : #F8F8F8; + font-size : 8pt; + margin-bottom : 1px; + margin-right : 1px; +} + +/* Grid for hours */ + +grid[anonid="time-picker-hour-grid"] { + border-top : 1px solid #2060c7; + border-left : 1px solid #2060c7; + margin-top : 1px; +} + +/* Box in each cell of the grid for hours */ + +.time-picker-hour-box-class { + -moz-box-align : center; + border-right : 1px solid #2060c7; + border-bottom : 1px solid #2060c7; +} + +.time-picker-hour-box-class:hover { + color : #ff0000; + cursor : pointer; +} + +/* selected hour box */ + +.time-picker-hour-box-class[selected="true"] { + background-color : #6699CC; +} + +/* label inside each minute/hour */ + +.time-picker-minute-label:hover { + color : #ff0000; + cursor: pointer !important; +} + +.time-picker-hour-label:hover { + color : #ff0000; + cursor: pointer !important; +} + + +.time-picker-minute-box-class { + -moz-box-align : center; + border-right : 1px solid #2060c7; + border-bottom : 1px solid #2060c7; +} + +.time-picker-minute-box-class:hover { + color : #ff0000; + cursor : pointer; +} + +/* box around five minute grid */ + +vbox[anonid="time-picker-five-minute-grid-box"] { + min-width : 195px; + margin-left : 1px; +} + +/* five minute grid */ + +grid[anonid="time-picker-five-minute-grid"] { + margin-top : 2px; + margin-right : 2px; + border-top : 1px solid #003399; + border-left : 1px solid #003399; + border-right : 1px solid #003399; + background-color : #e7eeec; +} + + +/* box in five-minute grid elements */ + +.time-picker-five-minute-class { + -moz-box-align : center; +} + +.time-picker-five-minute-class:hover { + color: #ff0000; + cursor: pointer; +} + +/* selected five-minute grid element box */ + +.time-picker-five-minute-class[selected="true"] { + background-color : #6699CC; +} + +/* box around one minute grid */ + +vbox[anonid="time-picker-one-minute-grid-box"] { + min-width : 195px; + margin-left : 1px; +} + +/* one minute grid */ + +grid[anonid="time-picker-one-minute-grid"] { + margin-top : 2px; + margin-right : 2px; + border-top : 1px solid #003399; + border-left : 1px solid #003399; + border-right : 1px solid #003399; + background-color : #e7eeec; +} + +/* box in one-minute grid elements */ + +.time-picker-one-minute-class { + -moz-box-align : center; +} + +.time-picker-one-minute-class:hover { + color: #ff0000; + cursor: pointer; +} + +/* selected one-minute grid element box */ + +.time-picker-one-minute-class[selected="true"] { + background-color : #6699CC; +} + +.time-picker-more-control-label { + background-color : #6699CC; + color : #ffffff; + font-size : 12pt; + height : 12px; + min-width : 40px; + margin : 0px; + border : 1px solid #003399; + text-align : center; +} + +.time-picker-more-control-label:hover { + background-color : #477eb7; +} + +.time-picker-more-control-label:hover:active { + background-color : #2063a8; +} + +/* line across the bottom of the minute boxes, made to line up with more & less tabs */ + +.time-picker-minutes-bottom { + background-color : #e7eeec; + border-bottom : 1px solid #003399; + border-left : 1px solid #003399; + border-right : 1px solid #003399; + margin-right : 2px; +} diff --git a/mozilla/calendar/resources/skin/modern/datetimepickers/datetimepickers.css b/mozilla/calendar/resources/skin/modern/datetimepickers/datetimepickers.css new file mode 100644 index 00000000000..b67533e7712 --- /dev/null +++ b/mozilla/calendar/resources/skin/modern/datetimepickers/datetimepickers.css @@ -0,0 +1,214 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is OEone Calendar Code, released October 31st, 2001. + * + * The Initial Developer of the Original Code is OEone Corporation. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/*-------------------------------------------------------------------- + * Datepicker (text field with minimonth popup) + *-------------------------------------------------------------------*/ + +/* flex box around menulist */ +.datepicker-box-class { +} + +/* menulist */ +.datepicker-text-class { + width:11em; +} + +/* text input field */ +.datepicker-text-class input { +} + +/*------------------------------------------------------------------- + * Timepicker (text menulist with popup) + *-------------------------------------------------------------------*/ + +.timepicker-box-class { +} + +.timepicker-text-class { + width: 8em; +} + +/*------------------------------------------------------------------- + * popup (from timepicker/timepicker.css) + *-------------------------------------------------------------------*/ + +/* Box that occupies whole window */ + +vbox[anonid="timepicker-grids"] { + background-color : #F8F8F8; + font-size : 8pt; + margin-bottom : 1px; + margin-right : 1px; +} + +/* Grid for hours */ + +grid[anonid="time-picker-hour-grid"] { + border-top : 1px solid #2060c7; + border-left : 1px solid #2060c7; + margin-top : 1px; +} + +/* Box in each cell of the grid for hours */ + +.time-picker-hour-box-class { + -moz-box-align : center; + border-right : 1px solid #2060c7; + border-bottom : 1px solid #2060c7; +} + +.time-picker-hour-box-class:hover { + color: #ff0000; + cursor: pointer; +} + +/* label inside each minute/hour */ + +.time-picker-minute-label:hover { + color: #ff0000; + cursor: pointer !important; +} + +.time-picker-hour-label:hover { + color: #ff0000; + cursor: pointer !important; +} + +/* selected hour box */ + +.time-picker-hour-box-class[selected="true"] { + background-color : #6699CC; +} + +/* box around five minute grid */ + +vbox[anonid="time-picker-five-minute-grid-box"] { + min-width : 195px; + margin-left : 1px; +} + +/* five minute grid */ + +grid[anonid="time-picker-five-minute-grid"] { + margin-top : 2px; + margin-right : 2px; + border-top : 1px solid #003399; + border-left : 1px solid #003399; + border-right : 1px solid #003399; + background-color : #e7eeec; +} + + +/* box in five-minute grid elements */ + +.time-picker-five-minute-class { + -moz-box-align : center; +} + +.time-picker-five-minute-class:hover { + color: #ff0000; + cursor: pointer; +} + +/* selected five-minute grid element box */ + +.time-picker-five-minute-class[selected="true"] { + background-color : #6699CC; +} + +/* box around one minute grid */ + +vbox[anonid="time-picker-one-minute-grid-box"] { + min-width : 195px; + margin-left : 1px; +} + +/* one minute grid */ + +grid[anonid="time-picker-one-minute-grid"] { + margin-top : 2px; + margin-right : 2px; + border-top : 1px solid #003399; + border-left : 1px solid #003399; + border-right : 1px solid #003399; + background-color : #e7eeec; +} + +/* box in one-minute grid elements */ + +.time-picker-one-minute-class { + -moz-box-align : center; +} + +.time-picker-one-minute-class:hover { + color: #ff0000; + cursor: pointer; +} + +/* selected one-minute grid element box */ + +.time-picker-one-minute-class[selected="true"] { + background-color : #6699CC; +} + +.time-picker-more-control-label { + background-color : #6699CC; + color : #ffffff; + font-size : 12pt; + height : 12px; + min-width : 40px; + margin : 0px; + border : 1px solid #003399; + text-align : center; +} + +.time-picker-more-control-label:hover { + background-color : #477eb7; +} + +.time-picker-more-control-label:hover:active { + background-color : #2063a8; +} + +/* line across the bottom of the minute boxes, made to line up with more & less tabs */ + +.time-picker-minutes-bottom { + background-color : #e7eeec; + border-bottom : 1px solid #003399; + border-left : 1px solid #003399; + border-right : 1px solid #003399; + margin-right : 2px; +}