Mise à jour du profil de configuration par défaut qui ne fonctionnait plus depuis...
[Plinn.git] / skins / jscalendar / index.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <!-- -->
5
6 <head>
7 <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
8 <title>The Coolest DHTML Calendar - Online Demo</title>
9 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-blue.css" title="winter" />
10 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-blue2.css" title="blue" />
11 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-brown.css" title="summer" />
12 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-green.css" title="green" />
13 <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-1.css" title="win2k-1" />
14 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-2.css" title="win2k-2" />
15 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-cold-1.css" title="win2k-cold-1" />
16 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-cold-2.css" title="win2k-cold-2" />
17 <link rel="alternate stylesheet" type="text/css" media="all" href="calendar-system.css" title="system" />
18
19 <!-- import the calendar script -->
20 <script type="text/javascript" src="calendar.js"></script>
21
22 <!-- import the language module -->
23 <script type="text/javascript" src="lang/calendar-en.js"></script>
24
25 <!-- other languages might be available in the lang directory; please check
26 your distribution archive. -->
27
28 <!-- helper script that uses the calendar -->
29 <script type="text/javascript">
30
31 var oldLink = null;
32 // code to change the active stylesheet
33 function setActiveStyleSheet(link, title) {
34 var i, a, main;
35 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
36 if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
37 a.disabled = true;
38 if(a.getAttribute("title") == title) a.disabled = false;
39 }
40 }
41 if (oldLink) oldLink.style.fontWeight = 'normal';
42 oldLink = link;
43 link.style.fontWeight = 'bold';
44 return false;
45 }
46
47 // This function gets called when the end-user clicks on some date.
48 function selected(cal, date) {
49 cal.sel.value = date; // just update the date in the input field.
50 if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
51 // if we add this call we close the calendar on single-click.
52 // just to exemplify both cases, we are using this only for the 1st
53 // and the 3rd field, while 2nd and 4th will still require double-click.
54 cal.callCloseHandler();
55 }
56
57 // And this gets called when the end-user clicks on the _selected_ date,
58 // or clicks on the "Close" button. It just hides the calendar without
59 // destroying it.
60 function closeHandler(cal) {
61 cal.hide(); // hide the calendar
62 // cal.destroy();
63 calendar = null;
64 }
65
66 // This function shows the calendar under the element having the given id.
67 // It takes care of catching "mousedown" signals on document and hiding the
68 // calendar if the click was outside.
69 function showCalendar(id, format, showsTime, showsOtherMonths) {
70 var el = document.getElementById(id);
71 if (calendar != null) {
72 // we already have some calendar created
73 calendar.hide(); // so we hide it first.
74 } else {
75 // first-time call, create the calendar.
76 var cal = new Calendar(true, null, selected, closeHandler);
77 // uncomment the following line to hide the week numbers
78 // cal.weekNumbers = false;
79 if (typeof showsTime == "string") {
80 cal.showsTime = true;
81 cal.time24 = (showsTime == "24");
82 }
83 if (showsOtherMonths) {
84 cal.showsOtherMonths = true;
85 }
86 calendar = cal; // remember it in the global var
87 cal.setRange(1900, 2070); // min/max year allowed.
88 cal.create();
89 }
90 calendar.setDateFormat(format); // set the specified date format
91 calendar.parseDate(el.value); // try to parse the text in field
92 calendar.sel = el; // inform it what input field we use
93
94 // the reference element that we pass to showAtElement is the button that
95 // triggers the calendar. In this example we align the calendar bottom-right
96 // to the button.
97 calendar.showAtElement(el.nextSibling, "Br"); // show the calendar
98
99 return false;
100 }
101
102 var MINUTE = 60 * 1000;
103 var HOUR = 60 * MINUTE;
104 var DAY = 24 * HOUR;
105 var WEEK = 7 * DAY;
106
107 // If this handler returns true then the "date" given as
108 // parameter will be disabled. In this example we enable
109 // only days within a range of 10 days from the current
110 // date.
111 // You can use the functions date.getFullYear() -- returns the year
112 // as 4 digit number, date.getMonth() -- returns the month as 0..11,
113 // and date.getDate() -- returns the date of the month as 1..31, to
114 // make heavy calculations here. However, beware that this function
115 // should be very fast, as it is called for each day in a month when
116 // the calendar is (re)constructed.
117 function isDisabled(date) {
118 var today = new Date();
119 return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
120 }
121
122 function flatSelected(cal, date) {
123 var el = document.getElementById("preview");
124 el.innerHTML = date;
125 }
126
127 function showFlatCalendar() {
128 var parent = document.getElementById("display");
129
130 // construct a calendar giving only the "selected" handler.
131 var cal = new Calendar(true, null, flatSelected);
132
133 // hide week numbers
134 cal.weekNumbers = false;
135
136 // We want some dates to be disabled; see function isDisabled above
137 cal.setDisabledHandler(isDisabled);
138 cal.setDateFormat("%A, %B %e");
139
140 // this call must be the last as it might use data initialized above; if
141 // we specify a parent, as opposite to the "showCalendar" function above,
142 // then we create a flat calendar -- not popup. Hidden, though, but...
143 cal.create(parent);
144
145 // ... we can show it here.
146 cal.show();
147 }
148 </script>
149
150 <style type="text/css">
151 .ex { font-weight: bold; background: #fed; color: #080 }
152 .help { color: #080; font-style: italic; }
153 body { background: #fea; font: 10pt tahoma,verdana,sans-serif; }
154 table { font: 13px verdana,tahoma,sans-serif; }
155 a { color: #00f; }
156 a:visited { color: #00f; }
157 a:hover { color: #f00; background: #fefaf0; }
158 a:active { color: #08f; }
159 .key { border: 1px solid #000; background: #fff; color: #008;
160 padding: 0px 5px; cursor: default; font-size: 80%; }
161 </style>
162
163 </head>
164 <body onload="showFlatCalendar()">
165
166 <h2><a href="http://dynarch.com/mishoo/calendar.epl"
167 title="Visit the project website">jscalendar</a>-0.9.6
168 "Keep cool but don't freeze"</h2>
169
170 <p>
171 <div style="float: right; border: 1px solid #b87; padding: 2px; font-size: 90%; background: #ffb;">
172 Theme:<br />
173 <a href="#" onclick="return setActiveStyleSheet(this, 'winter');">winter</a>
174 |
175 <a href="#" onclick="return setActiveStyleSheet(this, 'blue');">blue</a>
176 |
177 <a href="#" onclick="return setActiveStyleSheet(this, 'summer');">summer</a>
178 |
179 <a href="#" onclick="return setActiveStyleSheet(this, 'green');">green</a>
180 <br />
181 <a href="#" id="defaultTheme" onclick="return setActiveStyleSheet(this, 'win2k-1');">win2k-1</a>
182 |
183 <a href="#" onclick="return setActiveStyleSheet(this, 'win2k-2');">win2k-2</a>
184 |
185 <a href="#" onclick="return setActiveStyleSheet(this, 'win2k-cold-1');">win2k-cold-1</a>
186 |
187 <a href="#" onclick="return setActiveStyleSheet(this, 'win2k-cold-2');">win2k-cold-2</a>
188 <br />
189 <a href="#" onclick="return setActiveStyleSheet(this, 'system');">system</a>
190 <script type="text/javascript">
191 setActiveStyleSheet(document.getElementById("defaultTheme"), "win2k-1");
192 </script>
193 </div>
194 <a href="release-notes.html">Release notes</a>.
195 <br />
196 Set it up in minutes:
197 <a href="simple-1.html">popup calendar</a>,
198 <a href="simple-2.html">flat calendar</a>.
199 <br />
200 Documentation:
201 <a href="doc/html/reference.html">HTML</a>,
202 <a href="doc/reference.pdf">PDF</a>.
203 <br />
204 <b style="color: red">Donate! Keep me on it! Details on <a href="http://dynarch.com/mishoo/calendar.epl">the Calendar website</a>.</b>
205 </p>
206
207 <div style="padding-left:20px; font-size: 90%; font-style: italic;">
208
209 </div>
210
211 <table style="width: 100%">
212 <tr valign="top">
213 <td style="background: #ffa; padding: 5px; border: 1px solid #995;">
214
215 <form action="#">
216 <div style="background: #995; color: #ffa; font-weight: bold; padding: 2px;">
217 Popup examples
218 </div>
219
220 <br />
221
222 <b>Date #1:</b> <input type="text" name="date1" id="sel1" size="30"
223 ><input type="reset" value=" ... "
224 onclick="return showCalendar('sel1', '%Y-%m-%d [%W] %H:%M', '24', true);"> %Y-%m-%d [%W] %H:%M -- single
225 click<br />
226
227 <b>Date #2:</b> <input type="text" name="date2" id="sel2" size="30"
228 ><input type="reset" value=" ... "
229 onclick="return showCalendar('sel2', '%a, %b %e, %Y [%I:%M %p]', '12');"> %a, %b %e, %Y [%I:%M %p]
230 -- double click
231
232 <br /><br />
233 <!--
234 if you remove this comment and leave the following HTML code
235 you will see a horrible effect, in all supported browsers (IE and Mozilla).
236 -->
237 <SELECT multiple size="4" name="component-select">
238 <OPTION selected value="Component_1_a">Component_1</OPTION>
239 <OPTION selected value="Component_1_b">Component_2</OPTION>
240 <OPTION>Component_3</OPTION>
241 <OPTION>Component_4</OPTION>
242 <OPTION>Component_5</OPTION>
243 <OPTION>Component_6</OPTION>
244 <OPTION>Component_7</OPTION>
245 </SELECT>
246 this select should hide when the calendar is above it.
247 <br /><br />
248
249 <b>Date #3:</b> <input type="text" name="date3" id="sel3" size="30"
250 ><input type="reset" value=" ... "
251 onclick="return showCalendar('sel3', '%d/%m/%Y');"> %d/%m/%Y
252 -- single click
253 <br />
254
255 <b>Date #4:</b> <input type="text" name="date4" id="sel4" size="30"
256 ><input type="reset" value=" ... "
257 onclick="return showCalendar('sel4', '%A, %B %e, %Y');"> %A, %B %e, %Y --
258 double click
259
260 </form>
261
262 <p>This is release <b>0.9.6</b>. Works on MSIE/Win 5.0 or better (really),
263 Opera 7, Mozilla, Netscape 6.x, 7.0 and all other Gecko-s, Konqueror and
264 Safari.</p>
265
266 <p class="help">You can click on "Mo"/"Su" (first day name displayed) to
267 change the first day of week (Sunday/Monday) (since 0.8 this is also mapped
268 on the "-" button in the top-left corner). Use the navigation buttons
269 ("&lt;&lt;", "&lt;", "Today", "&gt;", "&gt;&gt;") to move to the prev/next
270 year/month. Keep the mouse button pressed for a short time over one of
271 these buttons to get a menu for faster selection. You can drag the "status
272 bar" (that's where the tooltips appear) or title bar (that's where the
273 currently selected month/year shows up) to move the whole calendar.</p>
274
275 <h4>Keyboard navigation</h4>
276
277 <p>Starting with version 0.9.2, you can also use the keyboard to select
278 dates (only for popup calendars; does <em>not</em> work with Opera
279 7 or Konqueror/Safari). The following keys are available:</p>
280
281 <ul>
282
283 <li><span class="key">&larr;</span> , <span class="key">&rarr;</span> ,
284 <span class="key">&uarr;</span> , <span class="key">&darr;</span> -- select date</li>
285 <li><span class="key">CTRL</span> + <span class="key">&larr;</span> ,
286 <span class="key">&rarr;</span> -- select month</li>
287 <li><span class="key">CTRL</span> + <span class="key">&uarr;</span> ,
288 <span class="key">&darr;</span> -- select year</li>
289 <li><span class="key">SPACE</span> -- go to <em>today</em> date</li>
290 <li><span class="key">ENTER</span> -- accept the currently selected date</li>
291 <li><span class="key">ESC</span> -- cancel selection</li>
292
293 </ul>
294
295 </td>
296
297 <td style="padding: 5px; margin: 5px; border: 1px solid #984; background: #ed9; width: 15em;">
298
299 <div style="background: #984; color: #fea; font-weight: bold; padding: 2px; text-align: center">
300 Flat calendar
301 </div>
302
303 <p style="width: 12em"><small>A non-popup version will appear below as soon
304 as the page is loaded. Note that it doesn't show the week number.</small></p>
305
306 <!-- the calendar will be inserted here -->
307 <div id="display" style="float: right; clear: both;"></div>
308 <div id="preview" style="font-size: 80%; text-align: center; padding: 2px"></div>
309
310 <p style="width: 12em"><small>
311 The example above uses the <code>setDisabledHandler()</code> member function
312 to setup a handler that would only enable days withing a range of 10 days,
313 forward or backward, from the current date.
314 </small></p>
315
316 </div>
317
318 </td>
319
320 </tr>
321 </table>
322
323 <hr /><address>
324 &copy; <a href="http://dynarch.com">dynarch.com</a> 2002-2003 <br />
325 Author: <a href="http://dynarch.com/mishoo/">Mihai
326 Bazon</a><br /> Distributed under the <a
327 href="http://www.gnu.org/licenses/lgpl.html">GNU LGPL</a>.</address>
328
329 <p style="font-size: smaller">If you use this script on a public page it
330 would be nice if you would <a href="mailto:mishoo@infoiasi.ro">let me
331 know</a>.</p>
332
333 </body></html>