From 9f1a3a4e84ea1fa9c506f433280dd4e27336a2c4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 6 May 2004 11:57:41 +0000 Subject: [PATCH] imported version 0.9.6 from jscalendar --- phpgwapi/js/jscalendar/ChangeLog | 500 ++++++++++++++++++ phpgwapi/js/jscalendar/README | 2 + phpgwapi/js/jscalendar/README-eGW | 3 +- phpgwapi/js/jscalendar/calendar-blue.css | 21 +- phpgwapi/js/jscalendar/calendar-blue2.css | 235 ++++++++ phpgwapi/js/jscalendar/calendar-brown.css | 21 +- phpgwapi/js/jscalendar/calendar-green.css | 21 +- phpgwapi/js/jscalendar/calendar-setup.js | 66 ++- .../js/jscalendar/calendar-setup_stripped.js | 2 +- phpgwapi/js/jscalendar/calendar-system.css | 21 +- phpgwapi/js/jscalendar/calendar-tas.css | 238 +++++++++ phpgwapi/js/jscalendar/calendar-win2k-1.css | 21 +- phpgwapi/js/jscalendar/calendar-win2k-2.css | 21 +- .../js/jscalendar/calendar-win2k-cold-1.css | 21 +- .../js/jscalendar/calendar-win2k-cold-2.css | 21 +- phpgwapi/js/jscalendar/calendar.js | 302 +++++++---- phpgwapi/js/jscalendar/calendar.php | 119 +++++ phpgwapi/js/jscalendar/calendar.udiff | 48 ++ phpgwapi/js/jscalendar/calendar_stripped.js | 4 +- .../js/jscalendar/doc/html/reference.html | 86 +-- phpgwapi/js/jscalendar/doc/reference.pdf | Bin 212547 -> 214982 bytes phpgwapi/js/jscalendar/img.gif | Bin 145 -> 223 bytes phpgwapi/js/jscalendar/index.html | 29 +- phpgwapi/js/jscalendar/lang/calendar-da.js | 22 +- phpgwapi/js/jscalendar/lang/calendar-de.js | 34 +- phpgwapi/js/jscalendar/lang/calendar-el.js | 114 ++-- phpgwapi/js/jscalendar/lang/calendar-en.js | 13 +- phpgwapi/js/jscalendar/lang/calendar-fi.js | 98 ++++ phpgwapi/js/jscalendar/lang/calendar-fr.js | 47 +- phpgwapi/js/jscalendar/lang/calendar-jp.js | 2 +- .../js/jscalendar/lang/calendar-ko-utf8.js | 120 +++++ phpgwapi/js/jscalendar/lang/calendar-ko.js | 120 +++++ .../js/jscalendar/lang/calendar-lt-utf8.js | 114 ++++ phpgwapi/js/jscalendar/lang/calendar-lt.js | 114 ++++ .../js/jscalendar/lang/calendar-pl-utf8.js | 93 ++++ phpgwapi/js/jscalendar/lang/calendar-pl.js | 82 +-- phpgwapi/js/jscalendar/lang/calendar-ro.js | 5 +- phpgwapi/js/jscalendar/lang/calendar-si.js | 94 ++++ phpgwapi/js/jscalendar/lang/calendar-sp.js | 24 +- phpgwapi/js/jscalendar/menuarrow2.gif | Bin 0 -> 49 bytes phpgwapi/js/jscalendar/release-notes.html | 105 +++- phpgwapi/js/jscalendar/simple-1.html | 7 +- phpgwapi/js/jscalendar/test-position.html | 40 ++ phpgwapi/js/jscalendar/test.php | 116 ++++ 44 files changed, 2822 insertions(+), 344 deletions(-) create mode 100644 phpgwapi/js/jscalendar/ChangeLog create mode 100644 phpgwapi/js/jscalendar/calendar-blue2.css create mode 100644 phpgwapi/js/jscalendar/calendar-tas.css create mode 100644 phpgwapi/js/jscalendar/calendar.php create mode 100644 phpgwapi/js/jscalendar/calendar.udiff create mode 100644 phpgwapi/js/jscalendar/lang/calendar-fi.js create mode 100644 phpgwapi/js/jscalendar/lang/calendar-ko-utf8.js create mode 100644 phpgwapi/js/jscalendar/lang/calendar-ko.js create mode 100644 phpgwapi/js/jscalendar/lang/calendar-lt-utf8.js create mode 100644 phpgwapi/js/jscalendar/lang/calendar-lt.js create mode 100644 phpgwapi/js/jscalendar/lang/calendar-pl-utf8.js create mode 100644 phpgwapi/js/jscalendar/lang/calendar-si.js create mode 100644 phpgwapi/js/jscalendar/menuarrow2.gif create mode 100644 phpgwapi/js/jscalendar/test-position.html create mode 100644 phpgwapi/js/jscalendar/test.php diff --git a/phpgwapi/js/jscalendar/ChangeLog b/phpgwapi/js/jscalendar/ChangeLog new file mode 100644 index 0000000000..2d73e3aa82 --- /dev/null +++ b/phpgwapi/js/jscalendar/ChangeLog @@ -0,0 +1,500 @@ +2004-02-06 Mihai Bazon + + * make-release.pl: ChangeLog included in the distribution (if found) + + * calendar.js, doc/reference.tex, index.html: switched to version 0.9.6 + + * doc/Calendar.setup.tex, doc/reference.tex: updated documentation + + * release-notes.html: updated release notes + + * calendar.js: Fixed bug: Feb/29 and year change now keeps Feb in view + + * calendar.js: fixed the "ESC" problem (call the close handler) + + * calendar.js: fixed day of year range (1 to 366 instead of 0 to 365) + + * calendar.js: fixed week number calculations + + * doc/reference.tex: fixed (date input format) + + * calendar.php: removed comment + + * calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-tas.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar.js: + workaround for IE bug (you can't normally specify through CSS the style for + an element having two classes or more; we had to change a classname) + + * calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-tas.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css: + smaller fonts on days that are in neighbor months + +2004-02-04 Mihai Bazon + + * index.html: first demo shows the "showOtherMonths" capability + + * calendar-setup.js: support new parameters in the calendar. + added: firstDay, showOthers, cache. + + * calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar.js, lang/calendar-en.js, lang/calendar-ro.js: + new parameters: firstDayOfWeek, showsOtherMonths; removed mondayFirst. + This adds support for setting any day to be the first day of week (by just + clicking the day name in the display); also, if showsOtherMonths is enabled + then dates belonging to adjacent months that are in the current view will be + displayed and the calendar will have a fixed height. + + all themes updated. + + * test.php: test for calendar.php + + * calendar.php: fixed bug (pass numeric values as numbers) + +2004-02-01 Mihai Bazon + + * calendar.php: added PHP wrapper + + * img.gif: icon updated + + * TODO: updated TODO list + +2004-01-27 Mihai Bazon + + * calendar.js: + Janusz Piwowarski sent over a patch for IE5 compatibility which is much more + elegant than the atrocities that I had wrote :-D I'm gettin' old.. Thanks Janusz! + + * lang/calendar-fi.js: updated + +2004-01-15 Mihai Bazon + + * TODO: updated TODO list + + * calendar-setup.js: default align changed to "Br" + + * doc/reference.tex: changed default value for "align" + + * calendar-setup.js: calling onchange event handler, if available + + * calendar-setup.js: added "position" option + + * simple-1.html: demonstrates "step" option + + * calendar-setup.js: added "step" option + + * calendar.js: added yearStep config parameter + + * calendar.js: + fixed parseDate routine (the NaN bug which occurred when there was a space + after the date and no time) + +2004-01-14 Mihai Bazon + + * lang/calendar-en.js: added "Time:" + + * test-position.html: test for the new position algorithm + + * index.html: do not destroy() the calendar + avoid bug in parseDate (%p must be separated by non-word characters) + + * menuarrow2.gif: for calendar-blue2.css + + * calendar-setup.js: honor "date" parameter if passed + + * calendar.js: IE5 support is back + performance improvements in IE6 (mouseover combo boxes) + display "Time:" beside the clock area, if defined in the language file + new positioning algorithm (try to keep the calendar in page) + rewrote parseDate a little cleaner + + * lang/calendar-el.js: + updated Greek translation (thanks Alexandros Pappas) + +2004-01-13 Mihai Bazon + + * index.html: added style blue2, using utf-8 instead of iso-8859-2 + + * calendar.js: performance under IE (which sucks, by the way) + + * doc/reference.tex: Sunny added to sponsor list + + * doc/Calendar.setup.tex: documenting parameter 'electric' + + * calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css: + fixed IE text size problems + +2004-01-08 Mihai Bazon + + * lang/calendar-pl.js: + Polish translation updated to UTF-8 (thanks to Artur Filipiak) + +2004-01-07 Mihai Bazon + + * lang/calendar-si.js: updated (David Milost) + + * lang/calendar-si.js: Slovenian translation (thanks to David Milost) + +2003-12-21 Mihai Bazon + + * TODO: updated TODO list + + * lang/calendar-de.js: German translation (thanks to Peter Strotmann) + +2003-12-19 Mihai Bazon + + * doc/reference.tex: Thank you, Ian Barrak + +2003-12-18 Mihai Bazon + + * doc/reference.tex: fixed documentation bug (thanks Mike) + +2003-12-05 Mihai Bazon + + * lang/calendar-ko-utf8.js: + UTF8 version of the Korean language (hopefully correct) + + * lang/calendar-pl-utf8.js, lang/calendar-pl.js: + updated Polish translation (thanks to Janusz Piwowarski) + +2003-12-04 Mihai Bazon + + * lang/calendar-fr.js: + French translation updated (thanks to Angiras Rama) + +2003-11-22 Mihai Bazon + + * lang/calendar-da.js: updated (thanks to Jesper M. Christensen) + +2003-11-20 Mihai Bazon + + * calendar-blue2.css, calendar-tas.css: + new styles (thanks to Wendall Mosemann for blue2, Mark Lynch for tas) + + * lang/calendar-lt-utf8.js, lang/calendar-lt.js: + Lithuanian translation (thanks to Martynas Majeris) + + * lang/calendar-sp.js: updated + +2003-11-17 Mihai Bazon + + * TODO: added TODO list + +2003-11-14 Mihai Bazon + + * lang/calendar-ko.js: Korean translation (thanks to Yourim Yi) + +2003-11-12 Mihai Bazon + + * lang/calendar-jp.js: small bug fixed (thanks to TAHARA Yusei) + +2003-11-10 Mihai Bazon + + * lang/calendar-fr.js: translation updated, thanks to Florent Ramiere + + * calendar-setup.js: + added new parameter: electric (if false then the field will not get updated on each move) + + * index.html: fixed DOCTYPE + +2003-11-07 Mihai Bazon + + * calendar-setup.js: + fixed minor problem (maybe we're passing object reference instead of ID for + the flat calendar parent) + +2003-11-06 Mihai Bazon + + * lang/calendar-fi.js: + added Finnish translation (thanks to Antti Tuppurainen) + +2003-11-05 Mihai Bazon + + * release-notes.html: fixed typo + + * doc/reference.tex, index.html, calendar.js: 0.9.5 + + * README: fixed license statement + + * release-notes.html: updated release notes (0.9.5) + +2003-11-03 Mihai Bazon + + * lang/calendar-de.js: + updated German translation (thanks to Gerhard Neiner) + + * calendar-setup.js: fixed license statement + + * calendar.js: whitespace + + * calendar.js: fixed license statement + + * calendar.js: + fixed positioning problem when input field is inside scrolled divs + +2003-11-01 Mihai Bazon + + * lang/calendar-af.js: Afrikaan language (thanks to Derick Olivier) + +2003-10-31 Mihai Bazon + + * lang/calendar-it.js: + updated IT translation (thanks to Christian Blaser) + + * lang/calendar-es.js: updated ES translation, thanks to Raul + +2003-10-30 Mihai Bazon + + * lang/calendar-hu.js: updated thanks to Istvan Karaszi + + * index.html, simple-1.html, simple-2.html, simple-3.html: + switched to utf-8 all encodings + + * lang/calendar-sk.js: + added Slovak translation (thanks to Peter Valach) + + * lang/calendar-ro.js: switched to utf-8 + +2003-10-29 Mihai Bazon + + * lang/calendar-es.js: + updated translation, thanks to Jose Ma. Martinez Miralles + + * doc/reference.tex: + fixed the footnote problem (thanks Dominique de Waleffe for the tip) + + * lang/calendar-ro.js: fixed typo + + * lang/calendar-sv.js: oops, license should be LGPL + + * lang/calendar-sw.js: new swedish translation is calendar-sv.js + + * menuarrow.gif, menuarrow.png: + oops, forgot little drop-down menu arrows + + * lang/calendar-sv.js: swedish translation thanks to Leonard Norrgard + + * index.html: oops, some other minor changes + + * index.html, release-notes.html: + latest changes in release-notes and index page for 0.9.4 + + * doc/reference.tex, calendar.js: + added %s date format (# of seconds since Epoch) + + * calendar.js: + A click on TODAY will not close the calendar, even in single-click mode + +2003-10-28 Mihai Bazon + + * index.html: previous cal.html + + * cal.html: moved to index.html + + * README, cal.html, doc/reference.tex, lang/calendar-de.js, lang/calendar-en.js, lang/calendar-ro.js, release-notes.html: + LGPL license, forever. + + * doc/Calendar.setup.tex, simple-1.html: + doc updated for the onUpdate parameter to Calendar.setup + +2003-10-26 Mihai Bazon + + * calendar.js: fixed bug (correct display of the dropdown menus) + + * doc/Calendar.setup.tex, doc/reference.tex, lang/calendar-de.js, lang/calendar-en.js, lang/calendar-ro.js, README, cal.html, calendar-blue.css, calendar-brown.css, calendar-green.css, calendar-setup.js, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar.js, release-notes.html, simple-1.html, simple-3.html: + lots of changes for the 0.9.4 release (see the release-notes.html) + +2003-10-15 Mihai Bazon + + * doc/reference.tex: + documentation updated for 0.9.4 (not yet finished though) + +2003-10-07 Mihai Bazon + + * calendar.js, doc/reference.tex, release-notes.html, README, cal.html, calendar-setup.js: + modified project website + +2003-10-06 Mihai Bazon + + * calendar-setup.js: + added some properties (onSelect, onClose, date) (thanks altblue) + +2003-09-24 Mihai Bazon + + * simple-3.html: dateIsSpecial does not need the "date" argument ;-) + +2003-09-24 fsoft + + * calendar.js, simple-3.html: + added year, month, day to getDateStatus() function + +2003-09-24 Mihai Bazon + + * simple-3.html: example on how to use special dates + + * calendar-setup.js, calendar.js, simple-1.html: + support for special dates (thanks fabio) + +2003-09-17 Mihai Bazon + + * doc/reference.tex: fixed error in section 3. + +2003-08-01 Mihai Bazon + + * lang/calendar-jp.js: added Japanese translation + +2003-07-16 Mihai Bazon + + * simple-1.html: fixed problem with first example [IE,Opera] + +2003-07-09 Mihai Bazon + + * doc/Calendar.setup.tex: fixed typo (closing parenthesis) + + * lang/calendar-de.js: + added German translation, thanks to Hartwig Weinkauf + +2003-07-08 Mihai Bazon + + * cal.html: added link to release-notes + + * release-notes.html: 0.9.3 release notes + + * make-release.pl: + Script to create distribution archive. It needs some additional packages: + + - LaTeX + - tex2page + - jscrunch (JS compressor) + + * doc/html/makedoc.sh, doc/html/reference.css, doc/reference.tex, doc/makedoc.sh: + documentation updates... + + * calendar.js: added semicolon to make the code "compressible" + +2003-07-06 Mihai Bazon + + * doc/reference.tex: spell checked + + * doc/reference.tex: [minor] changed credits order + + * doc/reference.tex: various improvements and additions + + * doc/html/reference.css: minor eye-candy tweaks + +2003-07-05 Mihai Bazon + + * doc/html/Calendar.setup.html.tex, doc/html/makedoc.sh, doc/html/reference.css, doc/html/reference.t2p, doc/hyperref.cfg, doc/makedoc.sh, doc/reference.tex, doc/Calendar.setup.tex, doc/Calendar.setup.pdf.tex: + full documentation in LaTeX, for PDF and HTML formats + + * simple-2.html: + added demonstration of flat calendar with Calendar.setup + + * simple-1.html: + modified some links, added link to documentation, added demonstration of + disableFunc property + + * calendar-setup.js: added the ability to create flat calendar too + + * cal.html: added links to documentation and simple-[12].html pages + + * README: up-to-date... + + * calendar-setup.html: removed: the documentation is unified + +2003-07-03 Mihai Bazon + + * cal.html: some links to newly added files + + * calendar-setup.html, calendar-setup.js, img.gif, simple-1.html: + added some files to simplify calendar creation for non-(JS)-programmers + + * lang/calendar-zh.js: added simplified chinese (thanks ATang) + +2003-07-02 Mihai Bazon + + * calendar.js: * "yy"-related... [small fix] + + * calendar.js: + * #721833 fixed (yy format will understand years prior to 29 as 20xx) + + * calendar.js: * added refresh() function + + * calendar.js: * fixed bug when in single click mode + * added alignment options to "showAtElement" member function + +2003-06-25 Mihai Bazon + + * lang/calendar-pt.js: + added portugese translation (thanks Nuno Barreto) + +2003-06-24 Mihai Bazon + + * calendar.js: + call user handler when the date was changed using the keyboard + + * bugtest-hidden-selects.html: + file to test bug with hidden select-s (thanks Ying Zhang for reporting and for this test file) + + * lang/calendar-hr-utf8.js: + added croatian translation in utf8 (thanks Krunoslav Zubrinic) + +2003-06-23 Mihai Bazon + + * lang/calendar-hu.js: added hungarian translation + + * lang/calendar-hr.js: + added croatian translation (thanks to Krunoslav Zubrinic) + +2003-06-22 Mihai Bazon + + * calendar.js: + * #723335 fixed (clicking TODAY will not select the today date if the + disabledHandler rejects it) + + * cal.html: * new code for to work with fix for bug #703238 + * switch to new version + + * calendar.js: + * some patches to make code compatible with Opera 7 (well, almost compatible) + * bug #703238 fixed (fix breaks compatibility with older code that uses + calendar in single-click mode) + * bug #703814 fixed + +2003-04-09 Mihai Bazon + + * lang/calendar-tr.js: added turkish lang file + +2003-03-19 Mihai Bazon + + * lang/calendar-ru.js: russian translation added + + * lang/calendar-no.js: norwegian translation added + +2003-03-15 Mihai Bazon + + * lang/calendar-no.js: norwegian translation + +2003-03-12 Mihai Bazon + + * lang/calendar-pl.js: added polish translation + +2003-03-11 Mihai Bazon + + * calendar.js: + bugfix in parseDate (added base to parseInt, thanks Alan!) + +2003-03-05 Mihai Bazon + + * calendar.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-cs-win.js, lang/calendar-da.js, lang/calendar-du.js, lang/calendar-el.js, lang/calendar-en.js, lang/calendar-es.js, lang/calendar-fr.js, lang/calendar-it.js, lang/calendar-nl.js, lang/calendar-ro.js, lang/calendar-sp.js, lang/calendar-sw.js: + New file. + + * calendar.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-cs-win.js, lang/calendar-da.js, lang/calendar-du.js, lang/calendar-el.js, lang/calendar-en.js, lang/calendar-es.js, lang/calendar-fr.js, lang/calendar-it.js, lang/calendar-nl.js, lang/calendar-ro.js, lang/calendar-sp.js, lang/calendar-sw.js: + moved to CVS at sourceforge.net + release: 0.9.2 + new language packs + + + * README, cal.html, calendar-blue.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css: + New file. + + * README, cal.html, calendar-blue.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css: + moved to CVS at sourceforge.net + release: 0.9.2 + new language packs + + diff --git a/phpgwapi/js/jscalendar/README b/phpgwapi/js/jscalendar/README index d558f80517..a9f0d9f73c 100644 --- a/phpgwapi/js/jscalendar/README +++ b/phpgwapi/js/jscalendar/README @@ -20,6 +20,8 @@ Contents doc/ -- documentation, in PDF and HTML simple-1.html -- quick setup examples [popup calendars] simple-2.html -- quick setup example for flat calendar + calendar.php -- PHP wrapper + test.php -- test file for the PHP wrapper Homepage --------- diff --git a/phpgwapi/js/jscalendar/README-eGW b/phpgwapi/js/jscalendar/README-eGW index a893f44721..60c22d80ff 100644 --- a/phpgwapi/js/jscalendar/README-eGW +++ b/phpgwapi/js/jscalendar/README-eGW @@ -1,4 +1,4 @@ -This directory contains the (unchanged) Version 0.9.5 of jsCalendar +This directory contains the (unchanged) Version 0.9.6 of jsCalendar jsCalendar is called by the jscalendar wrapper-class in the phpGW API @@ -9,5 +9,6 @@ translations from the database for the language the user has spec. in his prefs. RalfBecker@outdoor-training.de History: +06-May-2004 updated to version 0.9.6 11-Nov-2003 updated to version 0.9.5 17-Aug-2003 inital import of version 0.9.3 diff --git a/phpgwapi/js/jscalendar/calendar-blue.css b/phpgwapi/js/jscalendar/calendar-blue.css index b8ec504187..86f260f698 100644 --- a/phpgwapi/js/jscalendar/calendar-blue.css +++ b/phpgwapi/js/jscalendar/calendar-blue.css @@ -70,6 +70,13 @@ div.calendar { position: relative; } text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -152,7 +159,7 @@ div.calendar { position: relative; } /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; top: 0px; @@ -162,24 +169,24 @@ div.calendar { position: relative; } border: 1px solid #655; background: #def; color: #000; - font-size: smaller; + font-size: 90%; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .hilite { +.calendar .combo .hilite { background: #acf; } -.combo .active { +.calendar .combo .active { border-top: 1px solid #46a; border-bottom: 1px solid #46a; background: #eef; diff --git a/phpgwapi/js/jscalendar/calendar-blue2.css b/phpgwapi/js/jscalendar/calendar-blue2.css new file mode 100644 index 0000000000..94fe8e8007 --- /dev/null +++ b/phpgwapi/js/jscalendar/calendar-blue2.css @@ -0,0 +1,235 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #206A9B; + font-size: 11px; + color: #000; + cursor: default; + background: #F1F8FC; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ +} + +.calendar .nav { + background: #007ED1 url(menuarrow2.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #000; + color: #fff; + padding: 2px; +} + +.calendar thead tr { /* Row containing navigation buttons */ + background: #007ED1; + color: #fff; +} + +.calendar thead .daynames { /* Row containing the day names */ + background: #C7E1F3; +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #206A9B; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #a66; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #34ABFA; + color: #000; + border: 1px solid #016DC5; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #006AA9; + border: 1px solid #008AFF; + padding: 2px 0px 0px 2px; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells containing month days dates */ + width: 2em; + color: #456; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #C7E1F3; +} + +.calendar tbody .rowhilite td { + background: #def; +} + +.calendar tbody .rowhilite td.wn { + background: #F1F8FC; +} + +.calendar tbody td.hilite { /* Hovered cells */ + background: #def; + padding: 1px 3px 1px 1px; + border: 1px solid #8FC4E8; +} + +.calendar tbody td.active { /* Active (pressed) cells */ + background: #cde; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #fff; + color: #000; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #a66; +} + +.calendar tbody td.today { /* Cell showing selected date */ + font-weight: bold; + color: #D50000; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The in footer (only one right now) */ + text-align: center; + background: #206A9B; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + background: #000; + color: #fff; + border-top: 1px solid #206A9B; + padding: 1px; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #B8DAF0; + border: 1px solid #178AEB; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #006AA9; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #def; + color: #000; + font-size: 90%; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #34ABFA; + border-top: 1px solid #46a; + border-bottom: 1px solid #46a; + font-weight: bold; +} + +.calendar .combo .active { + border-top: 1px solid #46a; + border-bottom: 1px solid #46a; + background: #F1F8FC; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #E3F0F9; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #889; + font-weight: bold; + background-color: #F1F8FC; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #267DB7; + color: #fff; +} + +.calendar td.time span.active { + border-color: red; + background-color: #000; + color: #A5FF00; +} diff --git a/phpgwapi/js/jscalendar/calendar-brown.css b/phpgwapi/js/jscalendar/calendar-brown.css index 4ecc36d918..ed638c4600 100644 --- a/phpgwapi/js/jscalendar/calendar-brown.css +++ b/phpgwapi/js/jscalendar/calendar-brown.css @@ -69,6 +69,13 @@ div.calendar { position: relative; } text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -145,7 +152,7 @@ div.calendar { position: relative; } /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; top: 0px; @@ -155,24 +162,24 @@ div.calendar { position: relative; } border: 1px solid #655; background: #ffe; color: #000; - font-size: smaller; + font-size: 90%; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .hilite { +.calendar .combo .hilite { background: #fc8; } -.combo .active { +.calendar .combo .active { border-top: 1px solid #a64; border-bottom: 1px solid #a64; background: #fee; diff --git a/phpgwapi/js/jscalendar/calendar-green.css b/phpgwapi/js/jscalendar/calendar-green.css index 55bb8aed50..df04de2a5d 100644 --- a/phpgwapi/js/jscalendar/calendar-green.css +++ b/phpgwapi/js/jscalendar/calendar-green.css @@ -71,6 +71,13 @@ div.calendar { position: relative; } text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -149,7 +156,7 @@ div.calendar { position: relative; } /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; top: 0px; @@ -159,24 +166,24 @@ div.calendar { position: relative; } border: 1px solid #565; background: #efd; color: #000; - font-size: smaller; + font-size: 90%; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .hilite { +.calendar .combo .hilite { background: #af8; } -.combo .active { +.calendar .combo .active { border-top: 1px solid #6a4; border-bottom: 1px solid #6a4; background: #efe; diff --git a/phpgwapi/js/jscalendar/calendar-setup.js b/phpgwapi/js/jscalendar/calendar-setup.js index 856f4834fe..83ff12ea2b 100644 --- a/phpgwapi/js/jscalendar/calendar-setup.js +++ b/phpgwapi/js/jscalendar/calendar-setup.js @@ -36,8 +36,8 @@ * ifFormat | date format that will be stored in the input field * daFormat | the date format that will be used to display the date in displayArea * singleClick | (true/false) wether the calendar is in single click mode or not (default: true) - * mondayFirst | (true/false) if true Monday is the first day of week, Sunday otherwise (default: true) - * align | alignment (default: "Bl"); if you don't know what's this see the calendar documentation + * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc. + * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation * range | array with 2 elements. Default: [1900, 2999] -- the range of years available * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID @@ -49,6 +49,11 @@ * date | the date that the calendar will be initially displayed to * showsTime | default: false; if true the calendar will include a time selector * timeFormat | the time format; can be "12" or "24", default is "12" + * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close + * step | configures the step of the years in drop-down boxes; default: 2 + * position | configures the calendar absolute position; default: null + * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible + * showOthers | if "true" (but default: "false") it will show days from other months too * * None of them is required, they all have default values. However, if you * pass none of "inputField", "displayArea" or "button" you'll get a warning @@ -66,8 +71,8 @@ Calendar.setup = function (params) { param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("mondayFirst", true); - param_default("align", "Bl"); + param_default("firstDay", 0); // defaults to "Sunday" first + param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); @@ -78,6 +83,11 @@ Calendar.setup = function (params) { param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); + param_default("electric", true); + param_default("step", 2); + param_default("position", null); + param_default("cache", false); + param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { @@ -91,35 +101,36 @@ Calendar.setup = function (params) { } function onSelect(cal) { - if (cal.params.flat) { - if (typeof cal.params.flatCallback == "function") { - cal.params.flatCallback(cal); - } else { + var p = cal.params; + var update = (cal.dateClicked || p.electric); + if (update && p.flat) { + if (typeof p.flatCallback == "function") + p.flatCallback(cal); + else alert("No flatCallback given -- doing nothing."); - } return false; } - if (cal.params.inputField) { - cal.params.inputField.value = cal.date.print(cal.params.ifFormat); + if (update && p.inputField) { + p.inputField.value = cal.date.print(p.ifFormat); + if (typeof p.inputField.onchange == "function") + p.inputField.onchange(); } - if (cal.params.displayArea) { - cal.params.displayArea.innerHTML = cal.date.print(cal.params.daFormat); - } - if (cal.params.singleClick && cal.dateClicked) { + if (update && p.displayArea) + p.displayArea.innerHTML = cal.date.print(p.daFormat); + if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); - } - if (typeof cal.params.onUpdate == "function") { - cal.params.onUpdate(cal); - } + if (update && typeof p.onUpdate == "function") + p.onUpdate(cal); }; if (params.flat != null) { - params.flat = document.getElementById(params.flat); + if (typeof params.flat == "string") + params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } - var cal = new Calendar(params.mondayFirst, params.date, params.onSelect || onSelect); + var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; @@ -137,8 +148,8 @@ Calendar.setup = function (params) { var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; - if (!window.calendar) { - window.calendar = cal = new Calendar(params.mondayFirst, + if (!(cal && params.cache)) { + window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); @@ -147,8 +158,12 @@ Calendar.setup = function (params) { cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { + if (params.date) + cal.setDate(params.date); cal.hide(); } + cal.showsOtherMonths = params.showOthers; + cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); @@ -157,7 +172,10 @@ Calendar.setup = function (params) { cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); - cal.showAtElement(params.displayArea || params.inputField, params.align); + if (!params.position) + cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); + else + cal.showAt(params.position[0], params.position[1]); return false; }; }; diff --git a/phpgwapi/js/jscalendar/calendar-setup_stripped.js b/phpgwapi/js/jscalendar/calendar-setup_stripped.js index 8d3aabe6d4..cc641432d9 100644 --- a/phpgwapi/js/jscalendar/calendar-setup_stripped.js +++ b/phpgwapi/js/jscalendar/calendar-setup_stripped.js @@ -18,4 +18,4 @@ * modify this code to suit your needs (this is recommended and much better * than modifying calendar.js itself). */ - Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("mondayFirst",true);param_default("align","Bl");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){if(cal.params.flat){if(typeof cal.params.flatCallback=="function"){cal.params.flatCallback(cal);}else{alert("No flatCallback given -- doing nothing.");}return false;}if(cal.params.inputField){cal.params.inputField.value=cal.date.print(cal.params.ifFormat);}if(cal.params.displayArea){cal.params.displayArea.innerHTML=cal.date.print(cal.params.daFormat);}if(cal.params.singleClick&&cal.dateClicked){cal.callCloseHandler();}if(typeof cal.params.onUpdate=="function"){cal.params.onUpdate(cal);}};if(params.flat!=null){params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.mondayFirst,params.date,params.onSelect||onSelect);cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(!window.calendar){window.calendar=cal=new Calendar(params.mondayFirst,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{cal.hide();}cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.parseDate(dateEl.value||dateEl.innerHTML);cal.refresh();cal.showAtElement(params.displayArea||params.inputField,params.align);return false;};}; \ No newline at end of file + Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("firstDay",0);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);else alert("No flatCallback given -- doing nothing.");return false;}if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.parseDate(dateEl.value||dateEl.innerHTML);cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};}; \ No newline at end of file diff --git a/phpgwapi/js/jscalendar/calendar-system.css b/phpgwapi/js/jscalendar/calendar-system.css index 3bc1b1c983..805596967b 100644 --- a/phpgwapi/js/jscalendar/calendar-system.css +++ b/phpgwapi/js/jscalendar/calendar-system.css @@ -82,6 +82,13 @@ text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -170,7 +177,7 @@ /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; width: 4em; @@ -181,26 +188,26 @@ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; background: Menu; color: MenuText; - font-size: smaller; + font-size: 90%; padding: 1px; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .active { +.calendar .combo .active { padding: 0px; border: 1px solid #000; } -.combo .hilite { +.calendar .combo .hilite { background: Highlight; color: HighlightText; } diff --git a/phpgwapi/js/jscalendar/calendar-tas.css b/phpgwapi/js/jscalendar/calendar-tas.css new file mode 100644 index 0000000000..c336e71489 --- /dev/null +++ b/phpgwapi/js/jscalendar/calendar-tas.css @@ -0,0 +1,238 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #655; + font-size: 11px; + color: #000; + cursor: default; + background: #ffd; + font-family: tahoma,verdana,sans-serif; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF); +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ + color:#363636; +} + +.calendar .nav { + background: #edc url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #654; + color: #363636; + padding: 2px; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#dddccc); +} + +.calendar thead .headrow { /* Row containing navigation buttons */ + /*background: #3B86A0;*/ + color: #363636; + font-weight: bold; +filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#3b86a0); +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #655; + padding: 2px; + text-align: center; + color: #363636; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF); +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #f00; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #ffcc86; + color: #000; + border: 1px solid #b59345; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #c77; + padding: 2px 0px 0px 2px; +} + +.calendar thead .daynames { /* Row containing the day names */ + background: #fed; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #fed; +} + +.calendar tbody .rowhilite td { + background: #ddf; + +} + +.calendar tbody .rowhilite td.wn { + background: #efe; +} + +.calendar tbody td.hilite { /* Hovered cells */ + background: #ffe; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells */ + background: #ddc; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #fea; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #f00; +} + +.calendar tbody td.today { font-weight: bold; } + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The in footer (only one right now) */ + text-align: center; + background: #988; + color: #000; + +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + border-top: 1px solid #655; + background: #dcb; + color: #363636; + font-weight: bold; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#FFFFFF,EndColorStr=#DDDCCC); +} +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #faa; + border: 1px solid #f40; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #c77; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #ffe; + color: #000; + font-size: smaller; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .hilite { + background: #fc8; +} + +.combo .active { + border-top: 1px solid #a64; + border-bottom: 1px solid #a64; + background: #fee; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #a88; + padding: 1px 0px; + text-align: center; + background-color: #fed; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #988; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #866; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} diff --git a/phpgwapi/js/jscalendar/calendar-win2k-1.css b/phpgwapi/js/jscalendar/calendar-win2k-1.css index bbc98c85f0..2c008c6031 100644 --- a/phpgwapi/js/jscalendar/calendar-win2k-1.css +++ b/phpgwapi/js/jscalendar/calendar-win2k-1.css @@ -92,6 +92,13 @@ text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -185,7 +192,7 @@ /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; width: 4em; @@ -197,21 +204,21 @@ border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #e4e0d8; - font-size: smaller; + font-size: 90%; padding: 1px; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .active { +.calendar .combo .active { background: #c4c0b8; padding: 0px; border-top: 1px solid #000; @@ -220,7 +227,7 @@ border-left: 1px solid #000; } -.combo .hilite { +.calendar .combo .hilite { background: #048; color: #fea; } diff --git a/phpgwapi/js/jscalendar/calendar-win2k-2.css b/phpgwapi/js/jscalendar/calendar-win2k-2.css index 9727d1b9a9..6001cfaa4b 100644 --- a/phpgwapi/js/jscalendar/calendar-win2k-2.css +++ b/phpgwapi/js/jscalendar/calendar-win2k-2.css @@ -92,6 +92,13 @@ text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -185,7 +192,7 @@ /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; width: 4em; @@ -197,21 +204,21 @@ border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #e4d8e0; - font-size: smaller; + font-size: 90%; padding: 1px; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .active { +.calendar .combo .active { background: #d4c8d0; padding: 0px; border-top: 1px solid #000; @@ -220,7 +227,7 @@ border-left: 1px solid #000; } -.combo .hilite { +.calendar .combo .hilite { background: #408; color: #fea; } diff --git a/phpgwapi/js/jscalendar/calendar-win2k-cold-1.css b/phpgwapi/js/jscalendar/calendar-win2k-cold-1.css index f3ca5e0d52..bb5c2cbc9f 100644 --- a/phpgwapi/js/jscalendar/calendar-win2k-cold-1.css +++ b/phpgwapi/js/jscalendar/calendar-win2k-cold-1.css @@ -92,6 +92,13 @@ text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -179,7 +186,7 @@ /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; width: 4em; @@ -191,21 +198,21 @@ border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #d8e0e4; - font-size: smaller; + font-size: 90%; padding: 1px; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .active { +.calendar .combo .active { background: #c8d0d4; padding: 0px; border-top: 1px solid #000; @@ -214,7 +221,7 @@ border-left: 1px solid #000; } -.combo .hilite { +.calendar .combo .hilite { background: #048; color: #aef; } diff --git a/phpgwapi/js/jscalendar/calendar-win2k-cold-2.css b/phpgwapi/js/jscalendar/calendar-win2k-cold-2.css index b757ea66e1..b43ce57d37 100644 --- a/phpgwapi/js/jscalendar/calendar-win2k-cold-2.css +++ b/phpgwapi/js/jscalendar/calendar-win2k-cold-2.css @@ -92,6 +92,13 @@ text-align: right; padding: 2px 4px 2px 2px; } +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} .calendar table .wn { padding: 2px 3px 2px 2px; @@ -185,7 +192,7 @@ /* Combo boxes (menus that display months/years for direct selection) */ -.combo { +.calendar .combo { position: absolute; display: none; width: 4em; @@ -197,21 +204,21 @@ border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #d8e4e0; - font-size: smaller; + font-size: 90%; padding: 1px; } -.combo .label, -.combo .label-IEfix { +.calendar .combo .label, +.calendar .combo .label-IEfix { text-align: center; padding: 1px; } -.combo .label-IEfix { +.calendar .combo .label-IEfix { width: 4em; } -.combo .active { +.calendar .combo .active { background: #c8d4d0; padding: 0px; border-top: 1px solid #000; @@ -220,7 +227,7 @@ border-left: 1px solid #000; } -.combo .hilite { +.calendar .combo .hilite { background: #048; color: #aef; } diff --git a/phpgwapi/js/jscalendar/calendar.js b/phpgwapi/js/jscalendar/calendar.js index dde8b00caa..96bec6f78e 100644 --- a/phpgwapi/js/jscalendar/calendar.js +++ b/phpgwapi/js/jscalendar/calendar.js @@ -1,7 +1,7 @@ /* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * ------------------------------------------------------------------ * - * The DHTML Calendar, version 0.9.5 "Your favorite time, bis" + * The DHTML Calendar, version 0.9.6 "Keep cool but don't freeze" * * Details and latest version at: * http://dynarch.com/mishoo/calendar.epl @@ -13,7 +13,7 @@ // $Id$ /** The Calendar object constructor. */ -Calendar = function (mondayFirst, dateStr, onSelected, onClose) { +Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { // member variables this.activeDiv = null; this.currentDateEl = null; @@ -29,11 +29,13 @@ Calendar = function (mondayFirst, dateStr, onSelected, onClose) { this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; this.isPopup = true; this.weekNumbers = true; - this.mondayFirst = mondayFirst; + this.firstDayOfWeek = firstDayOfWeek; // 0 for Sunday, 1 for Monday, etc. + this.showsOtherMonths = false; this.dateStr = dateStr; this.ar_days = null; this.showsTime = false; this.time24 = true; + this.yearStep = 2; // HTML elements this.table = null; this.element = null; @@ -79,6 +81,8 @@ Calendar._C = null; Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ); +Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); + /// detect Opera browser Calendar.is_opera = /opera/i.test(navigator.userAgent); @@ -97,7 +101,7 @@ Calendar.getAbsolutePos = function(el) { ST = el.scrollTop; var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST }; if (el.offsetParent) { - var tmp = Calendar.getAbsolutePos(el.offsetParent); + var tmp = this.getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } @@ -261,8 +265,13 @@ Calendar.showMonthsCombo = function () { s.display = "block"; if (cd.navtype < 0) s.left = cd.offsetLeft + "px"; - else - s.left = (cd.offsetLeft + cd.offsetWidth - mc.offsetWidth) + "px"; + else { + var mcw = mc.offsetWidth; + if (typeof mcw == "undefined") + // Konqueror brain-dead techniques + mcw = 50; + s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px"; + } s.top = (cd.offsetTop + cd.offsetHeight) + "px"; }; @@ -294,15 +303,20 @@ Calendar.showYearsCombo = function (fwd) { yr.style.display = "none"; } yr = yr.nextSibling; - Y += fwd ? 2 : -2; + Y += fwd ? cal.yearStep : -cal.yearStep; } if (show) { var s = yc.style; s.display = "block"; if (cd.navtype < 0) s.left = cd.offsetLeft + "px"; - else - s.left = (cd.offsetLeft + cd.offsetWidth - yc.offsetWidth) + "px"; + else { + var ycw = yc.offsetWidth; + if (typeof ycw == "undefined") + // Konqueror brain-dead techniques + ycw = 50; + s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px"; + } s.top = (cd.offsetTop + cd.offsetHeight) + "px"; } }; @@ -397,9 +411,9 @@ Calendar.tableMouseOver = function (ev) { break; while (count-- > 0) if (decrease) { - if (!(--i in range)) + if (--i < 0) i = range.length - 1; - } else if (!(++i in range)) + } else if ( ++i >= range.length ) i = 0; var newval = range[i]; el.firstChild.data = newval; @@ -474,7 +488,6 @@ Calendar.calDragEnd = function (ev) { cal.dragging = false; with (Calendar) { removeEvent(document, "mousemove", calDragIt); - removeEvent(document, "mouseover", stopEvent); removeEvent(document, "mouseup", calDragEnd); tableMouseUp(ev); } @@ -490,11 +503,12 @@ Calendar.dayMouseDown = function(ev) { cal.activeDiv = el; Calendar._C = cal; if (el.navtype != 300) with (Calendar) { - if (el.navtype == 50) + if (el.navtype == 50) { el._current = el.firstChild.data; + addEvent(document, "mousemove", tableMouseOver); + } else + addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); addClass(el, "hilite active"); - addEvent(document, "mouseover", tableMouseOver); - addEvent(document, "mousemove", tableMouseOver); addEvent(document, "mouseup", tableMouseUp); } else if (cal.isPopup) { cal._dragStart(ev); @@ -525,11 +539,7 @@ Calendar.dayMouseOver = function(ev) { } if (el.ttip) { if (el.ttip.substr(0, 1) == "_") { - var date = null; - with (el.calendar.date) { - date = new Date(getFullYear(), getMonth(), el.caldate); - } - el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1); + el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); } el.calendar.tooltips.firstChild.data = el.ttip; } @@ -573,11 +583,12 @@ Calendar.cellClick = function(el, ev) { if (!closing) { cal.currentDateEl = el; } - cal.date.setDate(el.caldate); + cal.date = new Date(el.caldate); date = cal.date; newdate = true; // a date was clicked - cal.dateClicked = true; + if (!(cal.dateClicked = !el.otherMonth)) + cal._init(cal.firstDayOfWeek, date); } else { if (el.navtype == 200) { Calendar.removeClass(el, "hilite"); @@ -644,7 +655,7 @@ Calendar.cellClick = function(el, ev) { } break; case 100: - cal.setMondayFirst(!cal.mondayFirst); + cal.setFirstDayOfWeek(el.fdow); return; case 50: var range = el._range; @@ -653,9 +664,9 @@ Calendar.cellClick = function(el, ev) { if (range[i] == current) break; if (ev && ev.shiftKey) { - if (!(--i in range)) + if (--i < 0) i = range.length - 1; - } else if (!(++i in range)) + } else if ( ++i >= range.length ) i = 0; var newval = range[i]; el.firstChild.data = newval; @@ -824,7 +835,7 @@ Calendar.prototype.create = function (_par) { cell = Calendar.createElement("td", row); cell.className = "time"; cell.colSpan = 2; - cell.innerHTML = " "; + cell.innerHTML = Calendar._TT["TIME"] || " "; cell = Calendar.createElement("td", row); cell.className = "time"; @@ -941,7 +952,7 @@ Calendar.prototype.create = function (_par) { div.appendChild(yr); } - this._init(this.mondayFirst, this.date); + this._init(this.firstDayOfWeek, this.date); parent.appendChild(this.element); }; @@ -975,7 +986,7 @@ Calendar._keyEvent = function(ev) { Calendar.cellClick(cal._nav_now); break; case 27: // KEY esc - act && cal.hide(); + act && cal.callCloseHandler(); break; case 37: // KEY left case 38: // KEY up @@ -1014,7 +1025,7 @@ Calendar._keyEvent = function(ev) { } Calendar.removeClass(el, "selected"); Calendar.addClass(ne, "selected"); - cal.date.setDate(ne.caldate); + cal.date = new Date(ne.caldate); cal.callHandler(); cal.currentDateEl = ne; } @@ -1032,12 +1043,11 @@ Calendar._keyEvent = function(ev) { }; /** - * (RE)Initializes the calendar to the given date and style (if mondayFirst is - * true it makes Monday the first day of week, otherwise the weeks start on - * Sunday. + * (RE)Initializes the calendar to the given date and firstDayOfWeek */ -Calendar.prototype._init = function (mondayFirst, date) { +Calendar.prototype._init = function (firstDayOfWeek, date) { var today = new Date(); + this.table.style.visibility = "hidden"; var year = date.getFullYear(); if (year < this.minYear) { year = this.minYear; @@ -1046,53 +1056,57 @@ Calendar.prototype._init = function (mondayFirst, date) { year = this.maxYear; date.setFullYear(year); } - this.mondayFirst = mondayFirst; + this.firstDayOfWeek = firstDayOfWeek; this.date = new Date(date); var month = date.getMonth(); var mday = date.getDate(); var no_days = date.getMonthDays(); + + // calendar voodoo for computing the first day that would actually be + // displayed in the calendar, even if it's from the previous month. + // WARNING: this is magic. ;-) date.setDate(1); - var wday = date.getDay(); - var MON = mondayFirst ? 1 : 0; - var SAT = mondayFirst ? 5 : 6; - var SUN = mondayFirst ? 6 : 0; - if (mondayFirst) { - wday = (wday > 0) ? (wday - 1) : 6; - } - var iday = 1; + var day1 = (date.getDay() - this.firstDayOfWeek) % 7; + if (day1 < 0) + day1 += 7; + date.setDate(-day1); + date.setDate(date.getDate() + 1); + var row = this.tbody.firstChild; var MN = Calendar._SMN[month]; - var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month)); - var todayDate = today.getDate(); - var week_number = date.getWeekNumber(); var ar_days = new Array(); - for (var i = 0; i < 6; ++i) { - if (iday > no_days) { - row.className = "emptyrow"; - row = row.nextSibling; - continue; - } + var weekend = Calendar._TT["WEEKEND"]; + for (var i = 0; i < 6; ++i, row = row.nextSibling) { var cell = row.firstChild; if (this.weekNumbers) { cell.className = "day wn"; - cell.firstChild.data = week_number; + cell.firstChild.data = date.getWeekNumber(); cell = cell.nextSibling; } - ++week_number; row.className = "daysrow"; - for (var j = 0; j < 7; ++j) { + var hasdays = false; + for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(date.getDate() + 1)) { + var iday = date.getDate(); + var wday = date.getDay(); cell.className = "day"; - if ((!i && j < wday) || iday > no_days) { - // cell.className = "emptycell"; - cell.innerHTML = " "; - cell.disabled = true; - cell = cell.nextSibling; - continue; + var current_month = (date.getMonth() == month); + if (!current_month) { + if (this.showsOtherMonths) { + cell.className += " othermonth"; + cell.otherMonth = true; + } else { + cell.className = "emptycell"; + cell.innerHTML = " "; + cell.disabled = true; + continue; + } + } else { + cell.otherMonth = false; + hasdays = true; } cell.disabled = false; cell.firstChild.data = iday; if (typeof this.getDateStatus == "function") { - date.setDate(iday); var status = this.getDateStatus(date, year, month, iday); if (status === true) { cell.className += " disabled"; @@ -1105,29 +1119,30 @@ Calendar.prototype._init = function (mondayFirst, date) { } if (!cell.disabled) { ar_days[ar_days.length] = cell; - cell.caldate = iday; + cell.caldate = new Date(date); cell.ttip = "_"; - if (iday == mday) { + if (current_month && iday == mday) { cell.className += " selected"; this.currentDateEl = cell; } - if (hasToday && (iday == todayDate)) { + if (date.getFullYear() == today.getFullYear() && + date.getMonth() == today.getMonth() && + iday == today.getDate()) { cell.className += " today"; cell.ttip += Calendar._TT["PART_TODAY"]; } - if (wday == SAT || wday == SUN) { - cell.className += " weekend"; + if (weekend.indexOf(wday.toString()) != -1) { + cell.className += cell.otherMonth ? " oweekend" : " weekend"; } } - ++iday; - ((++wday) ^ 7) || (wday = 0); - cell = cell.nextSibling; } - row = row.nextSibling; + if (!(hasdays || this.showsOtherMonths)) + row.className = "emptyrow"; } this.ar_days = ar_days; this.title.firstChild.data = Calendar._MN[month] + ", " + year; this.onSetTime(); + this.table.style.visibility = "visible"; // PROFILE // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms"; }; @@ -1138,7 +1153,7 @@ Calendar.prototype._init = function (mondayFirst, date) { */ Calendar.prototype.setDate = function (date) { if (!date.equalsTo(this.date)) { - this._init(this.mondayFirst, date); + this._init(this.firstDayOfWeek, date); } }; @@ -1149,12 +1164,12 @@ Calendar.prototype.setDate = function (date) { * should * change. */ Calendar.prototype.refresh = function () { - this._init(this.mondayFirst, this.date); + this._init(this.firstDayOfWeek, this.date); }; -/** Modifies the "mondayFirst" parameter (EU/US style). */ -Calendar.prototype.setMondayFirst = function (mondayFirst) { - this._init(mondayFirst, this.date); +/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */ +Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { + this._init(firstDayOfWeek, this.date); this._displayWeekdays(); }; @@ -1282,6 +1297,30 @@ Calendar.prototype.showAtElement = function (el, opts) { this.showAt(p.x, p.y + el.offsetHeight); return true; } + function fixPosition(box) { + if (box.x < 0) + box.x = 0; + if (box.y < 0) + box.y = 0; + var cp = document.createElement("div"); + var s = cp.style; + s.position = "absolute"; + s.right = s.bottom = s.width = s.height = "0px"; + document.body.appendChild(cp); + var br = Calendar.getAbsolutePos(cp); + document.body.removeChild(cp); + if (Calendar.is_ie) { + br.y += document.body.scrollTop; + br.x += document.body.scrollLeft; + } else { + br.y += window.scrollY; + br.x += window.scrollX; + } + var tmp = box.x + box.width - br.x; + if (tmp > 0) box.x -= tmp; + tmp = box.y + box.height - br.y; + if (tmp > 0) box.y -= tmp; + }; this.element.style.display = "block"; Calendar.continuation_for_the_fucking_khtml_browser = function() { var w = self.element.offsetWidth; @@ -1308,6 +1347,10 @@ Calendar.prototype.showAtElement = function (el, opts) { case "r": p.x += el.offsetWidth - w; break; case "l": break; // already there } + p.width = w; + p.height = h + 40; + self.monthsCombo.style.display = "none"; + fixPosition(p); self.showAt(p.x, p.y); }; if (Calendar.is_khtml) @@ -1338,38 +1381,52 @@ Calendar.prototype.parseDate = function (str, fmt) { if (!fmt) { fmt = this.dateFormat; } - var b = []; - fmt.replace(/(%.)/g, function(str, par) { - return b[b.length] = par; - }); + var b = fmt.match(/%./g); var i = 0, j = 0; var hr = 0; var min = 0; for (i = 0; i < a.length; ++i) { - if (b[i] == "%a" || b[i] == "%A") { + if (!a[i]) continue; - } - if (b[i] == "%d" || b[i] == "%e") { + switch (b[i]) { + case "%d": + case "%e": d = parseInt(a[i], 10); - } - if (b[i] == "%m") { + break; + + case "%m": m = parseInt(a[i], 10) - 1; - } - if (b[i] == "%Y" || b[i] == "%y") { + break; + + case "%Y": + case "%y": y = parseInt(a[i], 10); (y < 100) && (y += (y > 29) ? 1900 : 2000); - } - if (b[i] == "%b" || b[i] == "%B") { + break; + + case "%b": + case "%B": for (j = 0; j < 12; ++j) { if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } } - } else if (/%[HIkl]/.test(b[i])) { + break; + + case "%H": + case "%I": + case "%k": + case "%l": hr = parseInt(a[i], 10); - } else if (/%[pP]/.test(b[i])) { + break; + + case "%P": + case "%p": if (/pm/i.test(a[i]) && hr < 12) hr += 12; - } else if (b[i] == "%M") { + break; + + case "%M": min = parseInt(a[i], 10); + break; } } if (y != 0 && m != -1 && d != 0) { @@ -1471,22 +1528,23 @@ Calendar.prototype.hideShowCovered = function () { /** Internal function; it displays the bar with the names of the weekday. */ Calendar.prototype._displayWeekdays = function () { - var MON = this.mondayFirst ? 0 : 1; - var SUN = this.mondayFirst ? 6 : 0; - var SAT = this.mondayFirst ? 5 : 6; + var fdow = this.firstDayOfWeek; var cell = this.firstdayname; + var weekend = Calendar._TT["WEEKEND"]; for (var i = 0; i < 7; ++i) { cell.className = "day name"; - if (!i) { - cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"]; + var realday = (i + fdow) % 7; + if (i) { + cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); cell.navtype = 100; cell.calendar = this; + cell.fdow = realday; Calendar._add_evs(cell); } - if (i == SUN || i == SAT) { + if (weekend.indexOf(realday.toString()) != -1) { Calendar.addClass(cell, "weekend"); } - cell.firstChild.data = Calendar._SDN[i + 1 - MON]; + cell.firstChild.data = Calendar._SDN[(i + fdow) % 7]; cell = cell.nextSibling; } }; @@ -1517,7 +1575,6 @@ Calendar.prototype._dragStart = function (ev) { this.yOffs = posY - parseInt(st.top); with (Calendar) { addEvent(document, "mousemove", calDragIt); - addEvent(document, "mouseover", stopEvent); addEvent(document, "mouseup", calDragEnd); } }; @@ -1550,20 +1607,20 @@ Date.prototype.getMonthDays = function(month) { /** Returns the number of day in the year. */ Date.prototype.getDayOfYear = function() { var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); - var then = new Date(this.getFullYear(), 0, 1, 0, 0, 0); + var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); var time = now - then; return Math.floor(time / Date.DAY); }; /** Returns the number of the week in year, as defined in ISO 8601. */ Date.prototype.getWeekNumber = function() { - var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); - var then = new Date(this.getFullYear(), 0, 1, 0, 0, 0); - var time = now - then; - var day = then.getDay(); // 0 means Sunday - if (day == 0) day = 7; - (day > 4) && (day -= 4) || (day += 3); - return Math.round(((time / Date.DAY) + day) / 7); + var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); + var DoW = d.getDay(); + d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu + var ms = d.valueOf(); // GMT + d.setMonth(0); + d.setDate(4); // Thu in Week 1 + return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; }; /** Checks dates equality (ignores time) */ @@ -1625,17 +1682,34 @@ Date.prototype.print = function (str) { s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) s["%Y"] = y; // year with the century s["%%"] = "%"; // a literal '%' character - var re = Date._msh_formatRegexp; - if (typeof re == "undefined") { - var tmp = ""; - for (var i in s) - tmp += tmp ? ("|" + i) : i; - Date._msh_formatRegexp = re = new RegExp("(" + tmp + ")", 'g'); + + var re = /%./g; + if (!Calendar.is_ie5) + return str.replace(re, function (par) { return s[par] || par; }); + + var a = str.match(re); + for (var i = 0; i < a.length; i++) { + var tmp = s[a[i]]; + if (tmp) { + re = new RegExp(a[i], 'g'); + str = str.replace(re, tmp); + } } - return str.replace(re, function(match, par) { return s[par]; }); + + return str; +}; + +Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; +Date.prototype.setFullYear = function(y) { + var d = new Date(this); + d.__msh_oldSetFullYear(y); + if (d.getMonth() != this.getMonth()) + this.setDate(28); + this.__msh_oldSetFullYear(y); }; // END: DATE OBJECT PATCHES + // global object that remembers the calendar window.calendar = null; diff --git a/phpgwapi/js/jscalendar/calendar.php b/phpgwapi/js/jscalendar/calendar.php new file mode 100644 index 0000000000..5b9120d67c --- /dev/null +++ b/phpgwapi/js/jscalendar/calendar.php @@ -0,0 +1,119 @@ +calendar_file = 'calendar_stripped.js'; + $this->calendar_setup_file = 'calendar-setup_stripped.js'; + } else { + $this->calendar_file = 'calendar.js'; + $this->calendar_setup_file = 'calendar-setup.js'; + } + $this->calendar_lang_file = 'lang/calendar-' . $lang . '.js'; + $this->calendar_theme_file = $theme.'.css'; + $this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path); + $this->calendar_options = array('ifFormat' => '%Y/%m/%d', + 'daFormat' => '%Y/%m/%d'); + } + + function set_option($name, $value) { + $this->calendar_options[$name] = $value; + } + + function load_files() { + echo $this->get_load_files_code(); + } + + function get_load_files_code() { + $code = ( '' . NEWLINE ); + $code .= ( '' . NEWLINE ); + $code .= ( '' . NEWLINE ); + $code .= ( '' ); + return $code; + } + + function _make_calendar($other_options = array()) { + $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options)); + $code = ( '' ); + return $code; + } + + function make_input_field($cal_options = array(), $field_attributes = array()) { + $id = $this->_gen_id(); + $attrstr = $this->_make_html_attr(array_merge($field_attributes, + array('id' => $this->_field_id($id), + 'type' => 'text'))); + echo ''; + echo '' . + ''; + + $options = array_merge($cal_options, + array('inputField' => $this->_field_id($id), + 'button' => $this->_trigger_id($id))); + echo $this->_make_calendar($options); + } + + /// PRIVATE SECTION + + function _field_id($id) { return 'f-calendar-field-' . $id; } + function _trigger_id($id) { return 'f-calendar-trigger-' . $id; } + function _gen_id() { static $id = 0; return ++$id; } + + function _make_js_hash($array) { + $jstr = ''; + reset($array); + while (list($key, $val) = each($array)) { + if (is_bool($val)) + $val = $val ? 'true' : 'false'; + else if (!is_numeric($val)) + $val = '"'.$val.'"'; + if ($jstr) $jstr .= ','; + $jstr .= '"' . $key . '":' . $val; + } + return $jstr; + } + + function _make_html_attr($array) { + $attrstr = ''; + reset($array); + while (list($key, $val) = each($array)) { + $attrstr .= $key . '="' . $val . '" '; + } + return $attrstr; + } +}; + +?> \ No newline at end of file diff --git a/phpgwapi/js/jscalendar/calendar.udiff b/phpgwapi/js/jscalendar/calendar.udiff new file mode 100644 index 0000000000..3be79ceda6 --- /dev/null +++ b/phpgwapi/js/jscalendar/calendar.udiff @@ -0,0 +1,48 @@ +Index: calendar.js +=================================================================== +RCS file: /cvsroot/egroupware/phpgwapi/js/jscalendar/calendar.js,v +retrieving revision 1.2 +diff -u -r1.2 calendar.js +--- calendar.js 11 Nov 2003 14:50:19 -0000 1.2 ++++ calendar.js 6 May 2004 07:38:00 -0000 +@@ -601,6 +601,10 @@ + date.setMonth(m); + }; + switch (el.navtype) { ++// TEST RB ++ case 500: ++ window.location="/egroupware/?menuaction=calendar.uicalendar.week&date="+el.caldate.print('%Y%m%d'); ++ return; + case 400: + Calendar.removeClass(el, "hilite"); + var text = Calendar._TT["ABOUT"]; +@@ -806,8 +810,11 @@ + for (i = 6; i > 0; --i) { + row = Calendar.createElement("tr", tbody); + if (this.weekNumbers) { +- cell = Calendar.createElement("td", row); +- cell.appendChild(document.createTextNode("")); ++// cell = Calendar.createElement("td", row); ++// cell.appendChild(document.createTextNode("")); ++// TEST RB ++ cell = hh("",1,500) ++ cell.ttip = "go to week-view"; + } + for (var j = 7; j > 0; --j) { + cell = Calendar.createElement("td", row); +@@ -1076,6 +1083,15 @@ + if (this.weekNumbers) { + cell.className = "day wn"; + cell.firstChild.data = week_number; ++// TEST RB ++ cell.caldate = new Date(date); ++ if (!i && wday != 1) { ++ cell.caldate.setTime(date.getTime()-wday*Date.DAY); ++ } ++ else ++ { ++ cell.caldate.setDate(iday); ++ } + cell = cell.nextSibling; + } + ++week_number; diff --git a/phpgwapi/js/jscalendar/calendar_stripped.js b/phpgwapi/js/jscalendar/calendar_stripped.js index 029496a749..6a8e326af2 100644 --- a/phpgwapi/js/jscalendar/calendar_stripped.js +++ b/phpgwapi/js/jscalendar/calendar_stripped.js @@ -1,7 +1,7 @@ /* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * ------------------------------------------------------------------ * - * The DHTML Calendar, version 0.9.5 "Your favorite time, bis" + * The DHTML Calendar, version 0.9.6 "Keep cool but don't freeze" * * Details and latest version at: * http://dynarch.com/mishoo/calendar.epl @@ -9,4 +9,4 @@ * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ - Calendar=function(mondayFirst,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.mondayFirst=mondayFirst;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=Calendar.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.currentTarget;}};Calendar.getTargetElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.target;}};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else s.left=(cd.offsetLeft+cd.offsetWidth-mc.offsetWidth)+"px";s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.firstChild.data=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?2:-2;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else s.left=(cd.offsetLeft+cd.offsetWidth-yc.offsetWidth)+"px";s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(!(--i in range))i=range.length-1;}else if(!(++i in range))i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseover",stopEvent);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50)el._current=el.firstChild.data;addClass(el,"hilite active");addEvent(document,"mouseover",tableMouseOver);addEvent(document,"mousemove",tableMouseOver);addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){var date=null;with(el.calendar.date){date=new Date(getFullYear(),getMonth(),el.caldate);}el.ttip=date.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.firstChild.data=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false;}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite");}el.calendar.tooltips.firstChild.data=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}cal.date.setDate(el.caldate);date=cal.date;newdate=true;cal.dateClicked=true;}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=(el.navtype==0)?new Date():new Date(cal.date);cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(!(--i in range))i=range.length-1;}else if(!(++i in range))i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}}if(newdate){cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;if(text.substr(0,1)!="&"){cell.appendChild(document.createTextNode(text));}else{cell.innerHTML=text;}return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.appendChild(document.createTextNode(Calendar._TT["WK"]));}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.appendChild(document.createTextNode(init));part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.appendChild(document.createTextNode(":"));span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var hrs=this.date.getHours();var mins=this.date.getMinutes();var pm=(hrs>12);if(pm&&t12)hrs-=12;H.firstChild.data=(hrs<10)?("0"+hrs):hrs;M.firstChild.data=(mins<10)?("0"+mins):mins;if(t12)AP.firstChild.data=pm?"pm":"am";};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.firstChild.data,10);if(t12){if(/pm/i.test(AP.firstChild.data)&&h<12)h+=12;else if(/am/i.test(AP.firstChild.data)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.firstChild.data,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";yr.appendChild(document.createTextNode(""));div.appendChild(yr);}this._init(this.mondayFirst,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){if(!window.calendar){return false;}(Calendar.is_ie)&&(ev=window.event);var cal=window.calendar;var act=(Calendar.is_ie||ev.type=="keypress");if(ev.ctrlKey){switch(ev.keyCode){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(ev.keyCode){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.hide();break;case 37:case 38:case 39:case 40:if(act){var date=cal.date.getDate()-1;var el=cal.currentDateEl;var ne=null;var prev=(ev.keyCode==37)||(ev.keyCode==38);switch(ev.keyCode){case 37:(--date>=0)&&(ne=cal.ar_days[date]);break;case 38:date-=7;(date>=0)&&(ne=cal.ar_days[date]);break;case 39:(++datethis.maxYear){year=this.maxYear;date.setFullYear(year);}this.mondayFirst=mondayFirst;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var wday=date.getDay();var MON=mondayFirst?1:0;var SAT=mondayFirst?5:6;var SUN=mondayFirst?6:0;if(mondayFirst){wday=(wday>0)?(wday-1):6;}var iday=1;var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var hasToday=((today.getFullYear()==year)&&(today.getMonth()==month));var todayDate=today.getDate();var week_number=date.getWeekNumber();var ar_days=new Array();for(var i=0;i<6;++i){if(iday>no_days){row.className="emptyrow";row=row.nextSibling;continue;}var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.firstChild.data=week_number;cell=cell.nextSibling;}++week_number;row.className="daysrow";for(var j=0;j<7;++j){cell.className="day";if((!i&&jno_days){cell.innerHTML=" ";cell.disabled=true;cell=cell.nextSibling;continue;}cell.disabled=false;cell.firstChild.data=iday;if(typeof this.getDateStatus=="function"){date.setDate(iday);var status=this.getDateStatus(date,year,month,iday);if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){ar_days[ar_days.length]=cell;cell.caldate=iday;cell.ttip="_";if(iday==mday){cell.className+=" selected";this.currentDateEl=cell;}if(hasToday&&(iday==todayDate)){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(wday==SAT||wday==SUN){cell.className+=" weekend";}}++iday;((++wday)^ 7)||(wday=0);cell=cell.nextSibling;}row=row.nextSibling;}this.ar_days=ar_days;this.title.firstChild.data=Calendar._MN[month]+", "+year;this.onSetTime();};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.mondayFirst,date);}};Calendar.prototype.refresh=function(){this._init(this.mondayFirst,this.date);};Calendar.prototype.setMondayFirst=function(mondayFirst){this._init(mondayFirst,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window.calendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){if(!window.calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window.calendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window.calendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "r":p.x+=el.offsetWidth-w;break;case "l":break;}self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){var y=0;var m=-1;var d=0;var a=str.split(/\W+/);if(!fmt){fmt=this.dateFormat;}var b=[];fmt.replace(/(%.)/g,function(str,par){return b[b.length]=par;});var i=0,j=0;var hr=0;var min=0;for(i=0;i29)?1900:2000);}if(b[i]=="%b"||b[i]=="%B"){for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}}else if(/%[HIkl]/.test(b[i])){hr=parseInt(a[i],10);}else if(/%[pP]/.test(b[i])){if(/pm/i.test(a[i])&&hr<12)hr+=12;}else if(b[i]=="%M"){min=parseInt(a[i],10);}}if(y!=0&&m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));return;}y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0){var today=new Date();y=today.getFullYear();}if(m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));}};Calendar.prototype.hideShowCovered=function(){var self=this;Calendar.continuation_for_the_fucking_khtml_browser=function(){function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=self.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(self.hidden||(CX1>EX2)||(CX2EY2)||(CY24)&&(day-=4)||(day+=3);return Math.round(((time/Date.DAY)+day)/7);};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=Date._msh_formatRegexp;if(typeof re=="undefined"){var tmp="";for(var i in s)tmp+=tmp?("|"+i):i;Date._msh_formatRegexp=re=new RegExp("("+tmp+")",'g');}return str.replace(re,function(match,par){return s[par];});};window.calendar=null; \ No newline at end of file + Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=firstDayOfWeek;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.currentTarget;}};Calendar.getTargetElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.target;}};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.firstChild.data=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.firstChild.data;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.firstChild.data=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false;}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite");}el.calendar.tooltips.firstChild.data=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}cal.date=new Date(el.caldate);date=cal.date;newdate=true;if(!(cal.dateClicked=!el.otherMonth))cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=(el.navtype==0)?new Date():new Date(cal.date);cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}}if(newdate){cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;if(text.substr(0,1)!="&"){cell.appendChild(document.createTextNode(text));}else{cell.innerHTML=text;}return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.appendChild(document.createTextNode(Calendar._TT["WK"]));}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.appendChild(document.createTextNode(init));part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.appendChild(document.createTextNode(":"));span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var hrs=this.date.getHours();var mins=this.date.getMinutes();var pm=(hrs>12);if(pm&&t12)hrs-=12;H.firstChild.data=(hrs<10)?("0"+hrs):hrs;M.firstChild.data=(mins<10)?("0"+mins):mins;if(t12)AP.firstChild.data=pm?"pm":"am";};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.firstChild.data,10);if(t12){if(/pm/i.test(AP.firstChild.data)&&h<12)h+=12;else if(/am/i.test(AP.firstChild.data)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.firstChild.data,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";yr.appendChild(document.createTextNode(""));div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){if(!window.calendar){return false;}(Calendar.is_ie)&&(ev=window.event);var cal=window.calendar;var act=(Calendar.is_ie||ev.type=="keypress");if(ev.ctrlKey){switch(ev.keyCode){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(ev.keyCode){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var date=cal.date.getDate()-1;var el=cal.currentDateEl;var ne=null;var prev=(ev.keyCode==37)||(ev.keyCode==38);switch(ev.keyCode){case 37:(--date>=0)&&(ne=cal.ar_days[date]);break;case 38:date-=7;(date>=0)&&(ne=cal.ar_days[date]);break;case 39:(++datethis.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.firstChild.data=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false;for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(date.getDate()+1)){var iday=date.getDate();var wday=date.getDay();cell.className="day";var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML=" ";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.firstChild.data=iday;if(typeof this.getDateStatus=="function"){var status=this.getDateStatus(date,year,month,iday);if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){ar_days[ar_days.length]=cell;cell.caldate=new Date(date);cell.ttip="_";if(current_month&&iday==mday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==today.getFullYear()&&date.getMonth()==today.getMonth()&&iday==today.getDate()){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1){cell.className+=cell.otherMonth?" oweekend":" weekend";}}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.ar_days=ar_days;this.title.firstChild.data=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window.calendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){if(!window.calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window.calendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window.calendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "r":p.x+=el.offsetWidth-w;break;case "l":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){var y=0;var m=-1;var d=0;var a=str.split(/\W+/);if(!fmt){fmt=this.dateFormat;}var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i29)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;break;case "%M":min=parseInt(a[i],10);break;}}if(y!=0&&m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));return;}y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0){var today=new Date();y=today.getFullYear();}if(m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));}};Calendar.prototype.hideShowCovered=function(){var self=this;Calendar.continuation_for_the_fucking_khtml_browser=function(){function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=self.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(self.hidden||(CX1>EX2)||(CX2EY2)||(CY2=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i

DHTML Calendar Widget

-Mihai Bazon, <mishoo@infoiasi.ro>

November 5, 2003

+Mihai Bazon, <mishoo@infoiasi.ro>

February 6, 2004

-calendar version: 0.9.5 “Your favorite time, bis” +calendar version: 0.9.6 “Keep cool but don’t freeze”

@@ -102,7 +102,7 @@ Mihai Bazon, <mishoo@infoiasi.ro>

November 5, 2003

            4.3.10  Calendar.showAt
            4.3.11  Calendar.showAtElement
            4.3.12  Calendar.setDate
-            4.3.13  Calendar.setMondayFirst
+            4.3.13  Calendar.setFirstDayOfWeek
            4.3.14  Calendar.parseDate
            4.3.15  Calendar.setRange

@@ -218,7 +218,7 @@ this in your document’s <head> section, also make sure you correct paths to the scripts.

-
<style type="text/css">@import url(calendar-win2k-1.css)</style>
+
<style type="text/css">@import url(calendar-win2k-1.css);</style>
 <script type="text/javascript" src="calendar.js"></script>
 <script type="text/javascript" src="lang/calendar-en.js"></script>
 <script type="text/javascript" src="calendar-setup.js"></script>
@@ -244,9 +244,9 @@ insert the following code immediately after the HTML form:

<script type="text/javascript">
   Calendar.setup(
     {
-      inputField  : "data",      // ID of the input field
-      ifFormat    : "M d, y",    // the date format
-      button      : "trigger"    // ID of the button
+      inputField  : "data",         // ID of the input field
+      ifFormat    : "%m %d, %Y",    // the date format
+      button      : "trigger"       // ID of the button
     }
   );
 </script>
@@ -373,13 +373,12 @@ as a CSS class and appended to the date element.  If this string is
 4.3.8.
 null
 
-mondayFirst
-boolean If true (default) then the calendar will display with
-Monday being the first day of week.  If false then Sunday will be
-the first day of week.  This has changed from default false to
-default true because the ISO 8601 defines week as starting Monday
-and this definition is used for computing the week number.
-true
+firstDay
+integer Specifies which day is to be displayed as the first day of
+week.  Possible values are 0 to 6; 0 means Sunday, 1 means Monday, ..., 6
+means Saturday.  The end user can easily change this too, by clicking on the
+day name in the calendar header.
+0
 
 weekNumbers
 boolean If “true” then the calendar will display week numbers.
@@ -444,6 +443,27 @@ allow time selection.
 string Set this to “12” or “24” to configure the way that the
 calendar will display time.
 “24”
+
+electric
+boolean Set this to “false” if you want the calendar to update the
+field only when closed (by default it updates the field at each date change,
+even if the calendar is not closed) true
+
+position
+array Specifies the [x, y] position, relative to page’s top-left corner,
+where the calendar will be displayed.  If not passed then the position will
+be computed based on the “align” parameter.  Defaults to “null” (not
+used). null
+
+cache
+boolean Set this to “true” if you want to cache the calendar object.
+This means that a single calendar object will be used for all fields that
+require a popup calendar false
+
+showOthers
+boolean If set to “true” then days belonging to months overlapping
+with the currently displayed month will also be displayed in the calendar
+(but in a “faded-out” color) false
 
 
 
@@ -675,7 +695,7 @@ i.e. highlight them differently).  Details in section
 Synopsis:

-
var calendar = Calendar(mondayFirst, date, onSelect, onClose);
+
var calendar = Calendar(firstDayOfWeek, date, onSelect, onClose);
 

Parameters are as follows:

@@ -683,8 +703,9 @@ Parameters are as follows: