Update of /cvsroot/webschool/webschool/lib/calendar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10420/lib/calendar Added Files: ChangeLog README bugtest-hidden-selects.html calendar-blue.css calendar-blue2.css calendar-brown.css calendar-green.css calendar-setup.js calendar-setup_stripped.js 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 calendar.php calendar_stripped.js img.gif index.html menuarrow.gif menuarrow2.gif release-notes.html simple-1.html simple-2.html simple-3.html test-position.html test.php Log Message: Uh.....some more files that I forogot --- NEW FILE: calendar-win2k-2.css --- /* The main calendar widget. DIV containing a table. */ .calendar { position: relative; display: none; border-top: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; border-left: 2px solid #fff; font-size: 11px; color: #000; cursor: default; background: #d4c8d0; font-family: tahoma,verdana,sans-serif; } .calendar table { border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; font-size: 11px; color: #000; cursor: default; background: #d4c8d0; font-family: tahoma,verdana,sans-serif; } /* Header part -- contains navigation buttons and day names. */ .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ text-align: center; padding: 1px; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; } .calendar .nav { background: transparent url(menuarrow.gif) no-repeat 100% 100%; } .calendar thead .title { /* This holds the current "month, year" */ font-weight: bold; padding: 1px; border: 1px solid #000; background: #847880; color: #fff; text-align: center; } .calendar thead .headrow { /* Row <TR> containing navigation buttons */ } .calendar thead .daynames { /* Row <TR> containing the day names */ } .calendar thead .name { /* Cells <TD> containing the day names */ border-bottom: 1px solid #000; padding: 2px; text-align: center; background: #f4e8f0; } .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 */ border-top: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; border-left: 2px solid #fff; padding: 0px; background-color: #e4d8e0; } .calendar thead .active { /* Active (pressed) buttons in header */ padding: 2px 0px 0px 2px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; background-color: #c4b8c0; } /* The body part -- contains all the days in month. */ .calendar tbody .day { /* Cells <TD> 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: #f4e8f0; } .calendar tbody .rowhilite td { background: #e4d8e0; } .calendar tbody .rowhilite td.wn { background: #d4c8d0; } .calendar tbody td.hilite { /* Hovered cells <TD> */ padding: 1px 3px 1px 1px; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; } .calendar tbody td.active { /* Active (pressed) cells <TD> */ padding: 2px 2px 0px 2px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; } .calendar tbody td.selected { /* Cell showing selected date */ font-weight: bold; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; padding: 2px 2px 0px 2px; background: #e4d8e0; } .calendar tbody td.weekend { /* Cells showing weekend days */ color: #f00; } .calendar tbody td.today { /* Cell showing today date */ font-weight: bold; color: #00f; } .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 <TR> in footer (only one right now) */ } .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ background: #f4e8f0; padding: 1px; border: 1px solid #000; background: #847880; color: #fff; text-align: center; } .calendar tfoot .hilite { /* Hover style for buttons in footer */ border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; padding: 1px; background: #e4d8e0; } .calendar tfoot .active { /* Active (pressed) style for buttons in footer */ padding: 2px 0px 0px 2px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; } /* Combo boxes (menus that display months/years for direct selection) */ .calendar .combo { position: absolute; display: none; width: 4em; top: 0px; left: 0px; cursor: default; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #e4d8e0; font-size: 90%; padding: 1px; } .calendar .combo .label, .calendar .combo .label-IEfix { text-align: center; padding: 1px; } .calendar .combo .label-IEfix { width: 4em; } .calendar .combo .active { background: #d4c8d0; padding: 0px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; } .calendar .combo .hilite { background: #408; color: #fea; } .calendar td.time { border-top: 1px solid #000; padding: 1px 0px; text-align: center; background-color: #f4f0e8; } .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: #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: #766; color: #fff; } .calendar td.time span.active { border-color: #f00; background-color: #000; color: #0f0; } --- NEW FILE: release-notes.html --- <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN"> <html> <head> <title>jscalendar release notes</title> <style type="text/css"> h1 { border-bottom: 1px solid #000; } h2 { border-bottom: 1px solid #444; } ul li { margin-top: 0.5em; margin-bottom: 0.5em; } </style> </head> <body> <h1>jscalendar release notes</h1> <p>This release compiled at Friday, 6 Feb 2004 (21:40).</p> <h2>0.9.6</h2> <ul> <li> "Smart" (TM :-) positioning algorithm. The new algorithm will try to keep the calendar in the browser view, which is helpful in situations when the input field is near the bottom or the right edge. This code is only tested with IE and Mozilla, but it should work with other browsers too. Many thanks to <a href="http://www.ex3.com">Sunny Chowdhury</a> for sponsoring this feature! </li> <li> Support for IE5/Win is back. I also want to thank Janusz Piwowarski for keeping his eye on the CVS ;-) He reviewed my IE5-related changes and sent me a much cleaner patch. </li> <li> The calendar will now allow any day of week to be "the first day of week". This was requested long time ago, by someone whose name I forgot (sorry). The reason was that in certain countries weeks start on Saturday. So I thought that instead of having a "mondayFirst" and a "saturdayFirst" parameter, :-), it's better to have a "firstDayOfWeek" parameter; now it's present and its meaning is: "0 for Sunday", "1 for Monday", "2 for Tuesday", etc. The equivalent parameter for Calendar.setup is "firstDay". The end user can also change it very easy: click on the day name in the calendar display. </li> <li> The above feature triggered one <b>important change</b>: the notion of "weekend" is now defined in the language file. Added parameters: <pre> Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["DAY_FIRST"] = "Display %s first";</pre> "WEEKEND" specifies a string with comma-separated numbers from 0 to 7; they define what days are marked as "weekend". 5 and 6 mean, of course, "Sunday" and "Saturday". Day first is the tooltip displayed when a day name is hovered; "%s" will get replaced with the day name. Updated languages are "en" and "ro", which I maintain. Please note that languages wich are not updated <b>will not work</b>. If yours is one of them, please consider fixing it and sending me the fix so that I can include it in the distro. </li> <li> The calendar can now display days from the months adjacent to the currently displayed one. This is optional, of course, and the parameter name is "showsOtherMonths" (or "showOthers" in Calendar.setup). All theme files were updated. </li> <li> Displays "Time:" near the time selector, only if defined in the language file. </li> <li> Some bugs fixed in the date parsing code (which has also been rewritten a little bit cleaner). </li> <li> Calendar.setup will now configure the calendar to trigger the input fields' "onchange" event, if specified, when a date is selected. </li> <li> New parameter in Calendar.setup: "cache" (<b>defaults to false</b>). If set to true then the popup calendar object will be "cached", meaning, it will be created only once, no matter how many input fields are there in the page. Sometimes this is not desirable, which is why I've added this parameter. Please note that it defaults to "false" (thus the default behavior has changed). </li> <li> Added a simple PHP wrapper. It provides code which loads all the required scripts and theme file, and one function which creates and configures an input field for date input. It takes care of creating and assigning unique ID-s for the calendar fields and it also creates the "Calendar.setup" code. Functions to create more specialized fields can be added very easily. This feature was requested by the FreeMED.org project (thanks for donating!). </li> </ul> <p>Wow, there were quite some changes :-D Enjoy it!</p> <h2>0.9.5</h2> <p> This release's primary goal is to fix a wrong license statement which can be found in some files from 0.9.4. For instance in README or calendar.js, the statement was that the code is distributed under the GNU GPL; that's because I had plans to change the license, then changed my mind but unfortunately I committed files so. I am sorry for this inconvenience, please use the latest (0.9.5) release which is fully covered by LGPL. </p> <p>Other changes:</p> <ul> <li> <b>Fixed</b> an annoying bug that prevented the calendar to display correctly when it was configured for an input field inside a <b>scrolling area</b>. <b>Many thanks</b> to Ian Barrack (<a href="http://www.simban.com">Simban.com</a>) who pointed it up and donated quite some money for the Calendar project! </li> <li> All examples use UTF-8 now; the translations may not be all up-to-date, but I <strong>strongly</strong> suggest everyone to use UTF-8; other encodings are a plain mess. So far I know for sure that Romanian translation will work with UTF-8 and <em>not anymore</em> with ISO-8859-2. Other translations are probably usable under UTF-8, but if your preferred language isn't... ;-) please make it and send it to me for inclusion. </li> <li> Fixed small bug in the documentation (one footnote didn't appear where it should have). </li> <li> Updated translations: DE, ES, HU, IT, RO. Thanks to everyone who sent translations! </li> </ul> <h2>0.9.4</h2> <h3>New stuff</h3> <ul> <li>Supports time selection. Yes. ;-) This work has been largely sponsored by <strong>Himanshukumar Shah</strong> (thank you!). See the docs and example files for details on how to setup.</li> <li>Easy to link 2 or more fields by using the new <code>onUpdate</code> parameter of <code>Calendar.setup</code>. This is useful, say, to automatically set a value in a second field based on the value selected in the first field. See the documentation and first sample in <a href="simple-1.html">simple-1.html</a>.</li> <li>Other <code>Calendar.setup</code> low-level parameters, for those wanting to have the complete control: <code>onSelect</code> and <code>onClose</code>. The handlers are called when something is selected in the calendar or when the calendar is closed.</li> <li>The translation files can optionally include the short day names and the short month names. That's because in some languages, like German, the short form is not the first 3 letters of the entire name but only the first 2. Also in other languages short names can't be as easily derived from the full name by just calling substr, so this patch solves the problem.</li> <li>Implemented a nice way to make some dates "special" (look different). Specifically, the <code>setDisabledHandler</code> method was replaced with the more general <code>setDateStatusHandler</code> method (the old one is still available for backwards compatibility but <em>will</em> be removed). More details about this in the documentation. Also see <a href="simple-3.html">simple-3.html</a> for a live sample.</li> <li>Date parsing and formatting engine is now rewritten and supports a subset of <code>strftime</code> format specifiers from ANSI C. This makes it possible to use dates like "YYYYMMDD" (the corresponding format for this would be "%Y%m%d"). Details in the documentation. <b>Please note that the new engine is not compatibile with older calendar releases!</b></li> <li>Along with the new date parser I workarounded an unpleasant crash that occurred in IE when certain accented characters appeared in the texts. I think German was one of the language with such problems, and the workaround was to use the letter without an accent. Well, now you can translate to whatever you want.</li> <li>"Fixes" (I mean, "horrible workarounds") for Konqueror (and hopefully Safari). Unfortunately, this otherwise excellent browser still has some bugs that keep the calendar from working <em>exactly</em> as it should.. But they're going to be fixed, right? ;-)</li> <li>CSS themes got pretty much modified too so if you wrote your theme you need to update it. Aside for the time selector support, the CSS themes contain a simple hack that makes the navigation buttons show a little arrow in the lower-right corner which indicates that if one holds the mouse a menu will appear.</li> </ul> <h3>Translation files</h3> <p>The translation files need to be updated in order for the calendar to work properly. Currently the only updated files are calendar-en.js (main file) and calendar-ro.js (well, yes, I am a Romanian ;-).</p> <p>Specifically, they need the following:</p> <ul> <li>Correct date format, according with the new format specifiers introduced in 0.9.4. Details about the available format specifiers in the documentation</li> <li>Short day or month names, <em>if required</em>. If they can be derived by taking the first N letters of the full name then a simple Calendar._SDN_len = N or Calendar._SMN_len = N will suffice. If N is 3 then nothing needs to be done as we take it for granted if no other option is offered ;-)</li> <li>We have some new texts that shows short usage information as well as copyright information.</li> </ul> <p>If your favorite language is not there yet, or it is but not updated according to the main calendar-en.js file, then please consider translating calendar-en.js and send the translation back to me so that I include it in the official distribution.</p> <h3>Bug status</h3> <p>Check <a href="http://sourceforge.net/tracker/?atid=544285&group_id=75569&func=browse">SourceForge</a>, I didn't keep track. However, there were a lot of bugfixes.</p> <h2>0.9.3</h2> <h3>New stuff</h3> <ul> <li>Opera 7 compatibility — keyboard navigation is still not available; text selection can't be disabled, leading to an ugly effect when walking through the month/year menus.</li> <li>Ability to align the calendar relative to the input field (or any other element). Vertical: top, center, bottom. Horizontal: left, center, right. This is established as a new parameter for <tt>showAtElement</tt>.</li> <li>Added <tt>dateClicked</tt> property (boolean). This can be inspected in the "onSelect" handler to determine if a date was really clicked or the user only changed month/year using the menus. You <em>need</em> to check this for "single-click" calendars and only close/hide the calendar if it's <tt>true</tt>.</li> <li>Full documentation in <a href="doc/html/reference.html">HTML</a> and <a href="doc/reference.pdf">PDF</a> format is now available in the distribution archive.</li> <li>New language definition files: HU, HR, PT, ZH. Thanks those who submitted!</li> </ul> <h3>Bug status</h3> <p>This covers only those bugs that have been reported <a href="http://sourceforge.net/projects/jscalendar" target="_blank" title="Project page at SourceForge">at SourceForge</a>.</p> <ol> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=703238&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#703,238</tt></a> — fixed</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=703814&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#703,814</tt></a> — fixed</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=716777&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#716,777</tt></a> — closed (was fixed already in 0.9.2-1)</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=723335&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#723,335</tt></a> — fixed</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=715122&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#715,122</tt></a> — feature request; implemented.</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=721206&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#721,206</tt></a> — fixed (added "refresh()" function)</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=721833&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#721,833</tt></a> — fixed (bug concerning the "yy" format parsing)</li> <li><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=721833&group_id=75569&atid=544285" target="_blank" title="Go to bug description at sourceforge"><tt>#721,833</tt></a> — won't fix (we won't set the time to midnight; time might actually be useful when we implement support for time selection). </ol> <hr /> <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address> <!-- Created: Tue Jul 8 17:29:37 EEST 2003 --> <!-- hhmts start --> Last modified on Wed Oct 29 02:37:07 2003 <!-- hhmts end --> <!-- doc-lang: English --> </body> </html> --- NEW FILE: test-position.html --- <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>JS Calendar (positioning test)</title> <script type="text/javascript" src="calendar.js"></script> <script type="text/javascript" src="calendar-setup.js"></script> <script type="text/javascript" src="lang/calendar-en.js"></script> <style type="text/css"> @import url("calendar-win2k-cold-1.css"); </style> </head> <body style="height: 100%; margin: 0px; padding: 0px;"> <table style="height: 100%; width: 100%;" cellspacing="0" cellpadding="0"> <tr style="height: 100%;"> <td style="vertical-align: top; text-align: left;"> <input type="text" id="cal-field-1" /> <button type="submit" id="cal-button-1">...</button> <script type="text/javascript"> Calendar.setup({ inputField : "cal-field-1", button : "cal-button-1", align : "Tr" }); </script> </td> <td style="vertical-align: bottom; text-align: right;"> <input type="text" id="cal-field-2" /> <button type="submit" id="cal-button-2">...</button> <script type="text/javascript"> Calendar.setup({ inputField : "cal-field-2", button : "cal-button-2" }); </script> </td> </tr> </table> </body> </html> --- NEW FILE: calendar-setup.js --- /* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * --------------------------------------------------------------------------- * * The DHTML Calendar * * Details and latest version at: * http://dynarch.com/mishoo/calendar.epl * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html * * This file defines helper functions for setting up the calendar. They are * intended to help non-programmers get a working calendar on their site * quickly. This script should not be seen as part of the calendar. It just * shows you what one can do with the calendar, while in the same time * providing a quick and simple method for setting it up. If you need * exhaustive customization of the calendar creation process feel free to * modify this code to suit your needs (this is recommended and much better * than modifying calendar.js itself). */ // $Id: calendar-setup.js,v 1.1 2004/12/27 03:11:07 jsvoyager Exp $ /** * This function "patches" an input field (or other element) to use a calendar * widget for date selection. * * The "params" is a single object that can have the following properties: * * prop. name | description * ------------------------------------------------------------------------------------------------- * inputField | the ID of an input field to store the date * displayArea | the ID of a DIV or other element to show the date * button | ID of a button or other element that will trigger the calendar * eventName | event that will trigger the calendar, without the "on" prefix (default: "click") * 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) * 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 * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar) * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay) * onClose | function that gets called when the calendar is closed. [default] * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar. * 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 * saying "nothing to setup". */ 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"]); // takes precedence if both are defined 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); 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 && params.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; }; }; --- NEW FILE: bugtest-hidden-selects.html --- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro" lang="ro"> <head> <title>Bug</title> <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-1.css" title="win2k-1" /> <!-- import the calendar script --> <script type="text/javascript" src="calendar.js"></script> <!-- import the language module --> <script type="text/javascript" src="lang/calendar-en.js"></script> <!-- helper script that uses the calendar --> <script type="text/javascript"> // This function gets called when the end-user clicks on some date. function selected(cal, date) { cal.sel.value = date; // just update the date in the input field. if (cal.sel.id == "sel1" || cal.sel.id == "sel3") // if we add this call we close the calendar on single-click. // just to exemplify both cases, we are using this only for the 1st // and the 3rd field, while 2nd and 4th will still require double-click. cal.callCloseHandler(); } // And this gets called when the end-user clicks on the _selected_ date, // or clicks on the "Close" button. It just hides the calendar without // destroying it. function closeHandler(cal) { cal.hide(); // hide the calendar } // This function shows the calendar under the element having the given id. // It takes care of catching "mousedown" signals on document and hiding the // calendar if the click was outside. function showCalendar(id, format) { var el = document.getElementById(id); if (calendar != null) { // we already have some calendar created calendar.hide(); // so we hide it first. } else { // first-time call, create the calendar. var cal = new Calendar(false, null, selected, closeHandler); // uncomment the following line to hide the week numbers // cal.weekNumbers = false; calendar = cal; // remember it in the global var cal.setRange(1900, 2070); // min/max year allowed. cal.create(); } calendar.setDateFormat(format); // set the specified date format calendar.parseDate(el.value); // try to parse the text in field calendar.sel = el; // inform it what input field we use calendar.showAtElement(el); // show the calendar below it return false; } var MINUTE = 60 * 1000; var HOUR = 60 * MINUTE; var DAY = 24 * HOUR; var WEEK = 7 * DAY; // If this handler returns true then the "date" given as // parameter will be disabled. In this example we enable // only days within a range of 10 days from the current // date. // You can use the functions date.getFullYear() -- returns the year // as 4 digit number, date.getMonth() -- returns the month as 0..11, // and date.getDate() -- returns the date of the month as 1..31, to // make heavy calculations here. However, beware that this function // should be very fast, as it is called for each day in a month when // the calendar is (re)constructed. function isDisabled(date) { var today = new Date(); return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10; } </script> </head> <body> <form> <b>Date:</b> <br> <input type="text" name="date1" id="sel1" size="30"> <input type="button" value="..." onclick="return showCalendar('sel1', 'y-m-d');"> <p> <br> <br><b>Visible <select>, hides and unhides as expected</b> <br> <select name="foo" multiple> <option value="1">can use the functions date.getFullYear() -- returns</option> <option value="2">4 digit number, date.getMonth() -- returns the month</option> <option value="3">heavy calculations here. However, beware that this</option> </select> <p> <br><b>Hidden <select>, it should stay hidden (but doesn't)</b> <br> <select name="foo2" multiple style="visibility: hidden"> <option value="1">this should</option> <option value="2">remain hidden right?</option> </select> <p> <br><b>Hidden textbox below, it stays hidden as expected</b> <br> <input type="text" name="foo3" value="this stays hidden just fine" style="visibility: hidden"> </form> </body></html> --- NEW FILE: test.php --- <?php $lang = $_GET['lang']; if (!$lang) { $lang = $_REQUEST['lang']; } if (!$lang) { $lang = 'en'; } setcookie('lang', $lang); ?> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <title> Test for calendar.php </title> <?php // put here the correct path to "calendar.php"; don't move the file // "calendar.php" -- I think it's best if you leave it inside the // "/jscalendar/" directory. Just put here the correct path to it, such as // "../jscalendar/calendar.php" or something. require_once ('calendar.php'); // parameters to constructor: // 1. the absolute URL path to the calendar files // 2. the languate used for the calendar (see the lang/ dir) // 3. the theme file used for the clanedar, without the ".css" extension // 4. boolean that specifies if the "_stripped" files are to be loaded // The stripped files are smaller as they have no whitespace and comments $calendar = new DHTML_Calendar('/jscalendar/', $lang, 'calendar-win2k-2', false); // call this in the <head> section; it will "echo" code that loads the calendar // scripts and theme file. $calendar->load_files(); ?> </head> <body> <?php if ($_REQUEST['submitted']) { ?> <h1>Form submitted</h1> <?php foreach ($_REQUEST as $key => $val) { echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />'; } ?> <?php } else { ?> <h1>Calendar.php test</h1> <form action="test.php" method="get"> Select language: <select name="lang" onchange="this.form.submit()"> <?php $cwd = getcwd(); chdir('lang'); foreach (glob('*.js') as $filename) { $l = preg_replace('/(^calendar-|.js$)/', '', $filename); $selected = ''; if ($l == $lang) $selected = 'selected="selected" '; $display = $l; if ($l == 'en') $display = 'EN'; echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>'; } ?> </select> <blockquote style="font-size: 90%"> <b>NOTE</b>: as of this release, 0.9.6, only "EN" and "RO", which I maintain, function correctly. Other language files do not work because they need to be updated. If you update some language file, please consider sending it back to me so that I can include it in the calendar distribution. </blockquote> </form> <form action="test.php" method="get"> <input type="hidden" name="submitted" value="1" /> <table> <tr> <td> Date 1: </td> <td> <?php $calendar->make_input_field( // calendar options go here; see the documentation and/or calendar-setup.js array('firstDay' => 1, // show Monday first 'showsTime' => true, 'showOthers' => true, 'ifFormat' => '%Y-%m-%d %I:%M %P', 'timeFormat' => '12'), // field attributes go here array('style' => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center', 'name' => 'date1', 'value' => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?> </td> </tr> </table> <hr /> <button>Submit</button> </form> <?php } ?> </body> </html> --- NEW FILE: README --- The DHTML Calendar ------------------- Author: Mihai Bazon, <mi...@in...> http://dynarch.com/mishoo/ This program is free software published under the terms of the GNU Lesser General Public License. For the entire license text please refer to http://www.gnu.org/licenses/lgpl.html Contents --------- calendar.js -- the main program file lang/*.js -- internalization files *.css -- color themes cal.html -- example usage file 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 --------- For details and latest versions please refer to calendar homepage, located on my website: http://dynarch.com/mishoo/calendar.epl --- NEW FILE: simple-2.html --- <html style="background-color: buttonface; color: buttontext;"> <head> <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> <title>Simple calendar setup [flat calendar]</title> <!-- calendar stylesheet --> <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-cold-1.css" title="win2k-cold-1" /> <!-- main calendar program --> <script type="text/javascript" src="calendar.js"></script> <!-- language for the calendar --> <script type="text/javascript" src="lang/calendar-en.js"></script> <!-- the following script defines the Calendar.setup helper function, which makes adding a calendar a matter of 1 or 2 lines of code. --> <script type="text/javascript" src="calendar-setup.js"></script> </head> <body> <h2>DHTML Calendar — for the impatient</h2> <blockquote> <p> This page demonstrates how to setup a flat calendar. Examples of <em>popup</em> calendars are available in <a href="simple-1.html">another page</a>. </p> <p> The code in this page uses a helper function defined in "calendar-setup.js". With it you can setup the calendar in minutes. If you're not <em>that</em> impatient, ;-) <a href="doc/html/reference.html">complete documenation</a> is available. </p> </blockquote> <hr /> <div style="float: right; margin-left: 1em; margin-bottom: 1em;" id="calendar-container"></div> <script type="text/javascript"> function dateChanged(calendar) { // Beware that this function is called even if the end-user only // changed the month/year. In order to determine if a date was // clicked you can use the dateClicked property of the calendar: if (calendar.dateClicked) { // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php var y = calendar.date.getFullYear(); var m = calendar.date.getMonth(); // integer, 0..11 var d = calendar.date.getDate(); // integer, 1..31 // redirect... window.location = "/" + y + "/" + m + "/" + d + "/index.php"; } }; Calendar.setup( { flat : "calendar-container", // ID of the parent element flatCallback : dateChanged // our callback function } ); </script> <p>The positioning of the DIV that contains the calendar is entirely your job. For instance, the "calendar-container" DIV from this page has the following style: "float: right; margin-left: 1em; margin-bottom: 1em".</p> <p>Following there is the code that has been used to create this calendar. You can find the full description of the <tt>Calendar.setup()</tt> function in the <a href="doc/html/reference.html">calendar documenation</a>.</p> <pre ><div style="float: right; margin-left: 1em; margin-bottom: 1em;" id="calendar-container"></div> <script type="text/javascript"> function dateChanged(calendar) { // Beware that this function is called even if the end-user only // changed the month/year. In order to determine if a date was // clicked you can use the dateClicked property of the calendar: if (calendar.dateClicked) { // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php var y = calendar.date.getFullYear(); var m = calendar.date.getMonth(); // integer, 0..11 var d = calendar.date.getDate(); // integer, 1..31 // redirect... window.location = "/" + y + "/" + m + "/" + d + "/index.php"; } }; Calendar.setup( { flat : "calendar-container", // ID of the parent element flatCallback : dateChanged // our callback function } ); </script></pre> </body> </html> --- NEW FILE: calendar-blue2.css --- /* 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 <TR> containing navigation buttons */ background: #007ED1; color: #fff; } .calendar thead .daynames { /* Row <TR> containing the day names */ background: #C7E1F3; } .calendar thead .name { /* Cells <TD> 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 <TD> 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 <TD> */ background: #def; padding: 1px 3px 1px 1px; border: 1px solid #8FC4E8; } .calendar tbody td.active { /* Active (pressed) cells <TD> */ 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 <TR> in footer (only one right now) */ text-align: center; background: #206A9B; color: #fff; } .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ 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; } --- NEW FILE: calendar-setup_stripped.js --- /* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * --------------------------------------------------------------------------- * * The DHTML Calendar * * Details and latest version at: * http://dynarch.com/mishoo/calendar.epl * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html * * This file defines helper functions for setting up the calendar. They are * intended to help non-programmers get a working calendar on their site * quickly. This script should not be seen as part of the calendar. It just * shows you what one can do with the calendar, while in the same time * providing a quick and simple method for setting it up. If you need * exhaustive customization of the calendar creation process feel free to * 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("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;};}; --- NEW FILE: calendar-blue.css --- /* The main calendar widget. DIV containing a table. */ div.calendar { position: relative; } .calendar, .calendar table { border: 1px solid #556; font-size: 11px; color: #000; cursor: default; background: #eef; 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: #778 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: #fff; color: #000; padding: 2px; } .calendar thead .headrow { /* Row <TR> containing navigation buttons */ background: #778; color: #fff; } .calendar thead .daynames { /* Row <TR> containing the day names */ background: #bdf; } .calendar thead .name { /* Cells <TD> containing the day names */ border-bottom: 1px solid #556; 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: #aaf; color: #000; border: 1px solid #04f; padding: 1px; } .calendar thead .active { /* Active (pressed) buttons in header */ background-color: #77c; padding: 2px 0px 0px 2px; } /* The body part -- contains all the days in month. */ .calendar tbody .day { /* Cells <TD> 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: #bdf; } .calendar tbody .rowhilite td { background: #def; } .calendar tbody .rowhilite td.wn { background: #eef; } .calendar tbody td.hilite { /* Hovered cells <TD> */ background: #def; padding: 1px 3px 1px 1px; border: 1px solid #bbb; } .calendar tbody td.active { /* Active (pressed) cells <TD> */ 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: #00f; } .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 <TR> in footer (only one right now) */ text-align: center; background: #556; color: #fff; } .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ background: #fff; color: #445; border-top: 1px solid #556; padding: 1px; } .calendar tfoot .hilite { /* Hover style for buttons in footer */ background: #aaf; border: 1px solid #04f; color: #000; padding: 1px; } .calendar tfoot .active { /* Active (pressed) style for buttons in footer */ background: #77c; 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: #acf; } .calendar .combo .active { border-top: 1px solid #46a; border-bottom: 1px solid #46a; background: #eef; font-weight: bold; } .calendar td.time { border-top: 1px solid #000; padding: 1px 0px; text-align: center; background-color: #f4f0e8; } .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: #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: #667; color: #fff; } .calendar td.time span.active { border-color: #f00; background-color: #000; color: #0f0; } --- NEW FILE: calendar-green.css --- /* The main calendar widget. DIV containing a table. */ div.calendar { position: relative; } .calendar, .calendar table { border: 1px solid #565; font-size: 11px; color: #000; cursor: default; background: #efe; 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 */ background: #676; color: #fff; font-size: 90%; } .calendar .nav { background: #676 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; padding: 2px; background: #250; color: #efa; } .calendar thead .headrow { /* Row <TR> containing navigation buttons */ } .calendar thead .name { /* Cells <TD> containing the day names */ border-bottom: 1px solid #565; 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: #afa; color: #000; border: 1px solid #084; padding: 1px; } .calendar thead .active { /* Active (pressed) buttons in header */ background-color: #7c7; padding: 2px 0px 0px 2px; } .calendar thead .daynames { /* Row <TR> containing the day names */ background: #dfb; } /* The body part -- contains all the days in month. */ .calendar tbody .day { /* Cells <TD> containing month days dates */ width: 2em; color: #564; 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 #8a8; background: #dfb; } .calendar tbody .rowhilite td { background: #dfd; } .calendar tbody .rowhilite td.wn { background: #efe; } .calendar tbody td.hilite { /* Hovered cells <TD> */ background: #efd; padding: 1px 3px 1px 1px; border: 1px solid #bbb; } .calendar tbody td.active { /* Active (pressed) cells <TD> */ background: #dec; 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: #f8fff8; color: #000; } .calendar tbody td.weekend { /* Cells showing weekend days */ color: #a66; } .calendar tbody td.today { font-weight: bold; color: #0a0; } .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: ... [truncated message content] |