diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 9c9ab1e7c..c17e732a6 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -16,5 +16,11 @@ - Templatized the Login Box macro. - Added the new WebGUI 6 design. - Templatized the Admin Bar macro. + - Added CoolMenus to the distribution for easy making of DHTML driven menus. + (Thanks to Thomas Brattli.) + - Added JS Calendar to the distribution to replace the old calendar system. + (Thanks to Mihai Bazon.) + - Updated the Form subsystem to use the new calendar for date and time + fields. diff --git a/docs/credits.txt b/docs/credits.txt index 145c26b83..c39e360b6 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -102,7 +102,12 @@ Midas................................The Mozilla Development Team Mike Kaply HTML Area............................interactivetools.com + Mihai "Mishoo" Bazon The Open Source Community Classic Rich Edit....................Bratta +JS Calendar..........................Mihai "Mishoo" Bazon + +Cool Menus...........................Thomas Brattli + diff --git a/docs/previousVersion.sql b/docs/previousVersion.sql index 32dd30da0..dfe283abe 100644 --- a/docs/previousVersion.sql +++ b/docs/previousVersion.sql @@ -17036,5 +17036,5 @@ update style set styleId=10 where styleId=-10; delete from style where styleId<0; update incrementer set nextValue=nextValue+1 where incrementerId='styleId'; update page set styleId=1000 where styleId=-8; -INSERT INTO style VALUES (1000,'WebGUI 6','\r\n ','\r\n^AdminBar(1);\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
^L(17,"",2); ^AdminToggle;
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n^Spacer(56,1);^Spacer(26,1);
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
^Spacer(53,59);^D(\"%c %D, %y\");
^PageTitle;
^Spacer(53,59);
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n
^Spacer(53,1);\r\n
\r\n^FlexMenu;\r\n


\r\n\r\n
^-;^Spacer(53,1);
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n'); +INSERT INTO style VALUES (1000,'WebGUI 6','\r\n ','\r\n^AdminBar(1);\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
^L(17,"",2); ^AdminToggle;
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\"home\" \n \"Email\"\r\n\"Print\" \n \"Site \"Plain\r\n^Spacer(56,1);^Spacer(26,1);
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
^Spacer(53,59);^D(\"%c %D, %y\");
^PageTitle;
^Spacer(53,59);
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n
^Spacer(53,1);\r\n
\r\n^FlexMenu;\r\n


\r\n\r\n
^-;^Spacer(53,1);
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n'); diff --git a/docs/upgrades/upgrade_5.5.3-6.0.0.sql b/docs/upgrades/upgrade_5.5.3-6.0.0.sql index 8a0521552..420f643c9 100644 --- a/docs/upgrades/upgrade_5.5.3-6.0.0.sql +++ b/docs/upgrades/upgrade_5.5.3-6.0.0.sql @@ -172,6 +172,6 @@ delete from international where languageId=1 and namespace='USS' and internation insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (71,1,'USS','User Submission Systems (USS) are a great way to add a sense of community to any site as well as get free content from your users. The User Submission System name is misleading to some people, because they immediately think of users as visitors. However, users are also staff, or business partners, or even yourself. With the USS you can select who can add new content, and even who can moderate that content.\r\n

\r\nUser Submission systems are so versatile that they allow you to create all kinds of applications, just by editing a few templates. Example applications are Photo Galleries, FAQs, Link Lists, Guest Books, Classifieds, and more.\r\n\r\n\r\n

\r\nSubmission Template
\r\nChoose a layout for the individual submissions.\r\n

\r\n\r\nSubmission Form Template
\r\nChoose a layout of the form users see when submitting content.\r\n

\r\n\r\n\r\nSubmissions Per Page
\r\nHow many submissions should be listed per page in the submissions index?\r\n

\r\n\r\n\r\nFilter Content
\r\nSelect the level of content filtering you wish to perform on all submitted content.\r\n

\r\n\r\nSort By
\r\nThe field to sort the submission list by.\r\n

\r\n\r\nSort Order
\r\nThe direction to sort the submission list by.\r\n

\r\n\r\n\r\n\r\n\r\nWho can approve?
\r\nWhat group is allowed to approve and deny content?\r\n

\r\n\r\nWho can contribute?
\r\nWhat group is allowed to contribute content?\r\n

\r\n\r\n\r\nDefault Status
\r\nShould submissions be set to Approved, Pending, or Denied by default?\r\n

\r\nNote: If you set the default status to Pending, then be prepared to monitor your message log for new submissions.\r\n

\r\n\r\nKarma Per Submission
\r\nHow much karma should be given to a user when they contribute to this user submission system?\r\n

\r\n\r\n\r\nAllow discussion?
\r\nChecking this box will enable responses to your article much like Articles on Slashdot.org.\r\n

\r\n\r\n\r\n', 1070199700,NULL); INSERT INTO template VALUES (1,'Default Login Box','

\n\n \n
\n \n

\n \n
\n \n \n \n

\n
\n\n \n \">.\n \n \n \n \n
\n
\n','Macro/L_loginBox'); INSERT INTO template VALUES (2,'Horizontal Login Box','
\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n \n \">.\n
\n \n \n
\n
\n
\n','Macro/L_loginBox'); -INSERT INTO template VALUES (2,'DHTML Admin Bar','\n\n\n\n
\n','Macro/AdminBar'); +INSERT INTO template VALUES (2,'DHTML Admin Bar','\n\n\n\n
\n','Macro/AdminBar'); INSERT INTO template VALUES (1,'Default Admin Bar',' \n \n
\n\n \n \n \n \n \n
\n \n
\n \n
\n \n
\n
\n','Macro/AdminBar'); diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index 8483b570a..5c513516c 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -73,6 +73,11 @@ All of the functions in this package accept the input of a hash reference contai =cut +#------------------------------------------------------------------- +sub _cssFile { + return ''."\n"; +} + #------------------------------------------------------------------- sub _fixMacros { my $value = shift; @@ -352,18 +357,30 @@ sub date { my ($subtext, $noDate, $class, $name, $label, $extras, $size, $value); $value = epochToSet($_[0]->{value}) unless ($_[0]->{noDate} && $_[0]->{value} eq ''); $size = $_[0]->{size} || 10; - my $output = _javascriptFile('inputCheck.js'); + my $output = _cssFile("calendar/calendar-win2k-1.css") + ._javascriptFile('calendar/calendar.js') + ._javascriptFile('calendar/lang/calendar-en.js') + ._javascriptFile('calendar/calendar-setup.js'); $output .= text({ name=>$_[0]->{name}, value=>$value, size=>$size, - extras=>'onKeyUp="doInputCheck(this.form.'.$_[0]->{name}.',\'0123456789/\')" '.$_[0]->{extras}, + extras=>'id="'.$_[0]->{name}.'Id" '.$_[0]->{extras}, maxlength=>10 }); - $output .= ''; + $output .= ''; +# $output .= ''; return $output; } diff --git a/www/extras/calendar/README b/www/extras/calendar/README new file mode 100644 index 000000000..d558f8051 --- /dev/null +++ b/www/extras/calendar/README @@ -0,0 +1,31 @@ +The DHTML Calendar +------------------- + + Author: Mihai Bazon, + 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 + +Homepage +--------- + + For details and latest versions please refer to calendar + homepage, located on my website: + + http://dynarch.com/mishoo/calendar.epl + diff --git a/www/extras/calendar/bugtest-hidden-selects.html b/www/extras/calendar/bugtest-hidden-selects.html new file mode 100644 index 000000000..df3533716 --- /dev/null +++ b/www/extras/calendar/bugtest-hidden-selects.html @@ -0,0 +1,108 @@ + + + +Bug + + + + + + + + + + + + + +
+Date: +
+ + +

+
+
Visible <select>, hides and unhides as expected +
+ + +

+
Hidden <select>, it should stay hidden (but doesn't) +
+ + +

+
Hidden textbox below, it stays hidden as expected +
+ +

+ diff --git a/www/extras/calendar/calendar-blue.css b/www/extras/calendar/calendar-blue.css new file mode 100644 index 000000000..b8ec50418 --- /dev/null +++ b/www/extras/calendar/calendar-blue.css @@ -0,0 +1,224 @@ +/* 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 containing navigation buttons */ + background: #778; + color: #fff; +} + +.calendar thead .daynames { /* Row containing the day names */ + background: #bdf; +} + +.calendar thead .name { /* Cells 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 containing month days dates */ + width: 2em; + color: #456; + text-align: right; + padding: 2px 4px 2px 2px; +} + +.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 */ + background: #def; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.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: #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 in footer (only one right now) */ + text-align: center; + background: #556; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + 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) */ + +.combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #def; + color: #000; + font-size: smaller; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .hilite { + background: #acf; +} + +.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; +} diff --git a/www/extras/calendar/calendar-brown.css b/www/extras/calendar/calendar-brown.css new file mode 100644 index 000000000..4ecc36d91 --- /dev/null +++ b/www/extras/calendar/calendar-brown.css @@ -0,0 +1,217 @@ +/* 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; +} + +/* 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: #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: #fed; + padding: 2px; +} + +.calendar thead .headrow { /* Row containing navigation buttons */ + background: #edc; + color: #000; +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #655; + padding: 2px; + text-align: center; + color: #000; +} + +.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: #faa; + color: #000; + border: 1px solid #f40; + 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 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: #840; +} + +.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/www/extras/calendar/calendar-green.css b/www/extras/calendar/calendar-green.css new file mode 100644 index 000000000..55bb8aed5 --- /dev/null +++ b/www/extras/calendar/calendar-green.css @@ -0,0 +1,221 @@ +/* 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 containing navigation buttons */ +} + +.calendar thead .name { /* Cells 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 containing the day names */ + background: #dfb; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells containing month days dates */ + width: 2em; + color: #564; + text-align: right; + padding: 2px 4px 2px 2px; +} + +.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 */ + background: #efd; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells */ + 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: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The in footer (only one right now) */ + text-align: center; + background: #565; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + padding: 2px; + background: #250; + color: #efa; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #afa; + border: 1px solid #084; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #7c7; + 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 #565; + background: #efd; + color: #000; + font-size: smaller; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .hilite { + background: #af8; +} + +.combo .active { + border-top: 1px solid #6a4; + border-bottom: 1px solid #6a4; + background: #efe; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #8a8; + padding: 1px 0px; + text-align: center; + background-color: #dfb; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #898; + 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: #686; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} diff --git a/www/extras/calendar/calendar-setup.js b/www/extras/calendar/calendar-setup.js new file mode 100644 index 000000000..856f4834f --- /dev/null +++ b/www/extras/calendar/calendar-setup.js @@ -0,0 +1,163 @@ +/* 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$ + +/** + * 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) + * 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 + * 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" + * + * 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("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; + }; +}; diff --git a/www/extras/calendar/calendar-setup_stripped.js b/www/extras/calendar/calendar-setup_stripped.js new file mode 100644 index 000000000..8d3aabe6d --- /dev/null +++ b/www/extras/calendar/calendar-setup_stripped.js @@ -0,0 +1,21 @@ +/* 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("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 diff --git a/www/extras/calendar/calendar-system.css b/www/extras/calendar/calendar-system.css new file mode 100644 index 000000000..3bc1b1c98 --- /dev/null +++ b/www/extras/calendar/calendar-system.css @@ -0,0 +1,243 @@ +/* The main calendar widget. DIV containing a table. */ + +.calendar { + position: relative; + display: none; + border: 1px solid; + border-color: #fff #000 #000 #fff; + font-size: 11px; + cursor: default; + background: Window; + color: WindowText; + font-family: tahoma,verdana,sans-serif; +} + +.calendar table { + border: 1px solid; + border-color: #fff #000 #000 #fff; + font-size: 11px; + cursor: default; + background: Window; + color: WindowText; + 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: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; + background: ButtonFace; +} + +.calendar .nav { + background: ButtonFace 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: ActiveCaption; + color: CaptionText; + text-align: center; +} + +.calendar thead .headrow { /* Row containing navigation buttons */ +} + +.calendar thead .daynames { /* Row containing the day names */ +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid ButtonShadow; + padding: 2px; + text-align: center; + background: ButtonFace; + color: ButtonText; +} + +.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: 2px solid; + padding: 0px; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + border-width: 1px; + padding: 2px 0px 0px 2px; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +/* 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 table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid ButtonShadow; + background: ButtonFace; + color: ButtonText; +} + +.calendar tbody .rowhilite td { + background: Highlight; + color: HighlightText; +} + +.calendar tbody td.hilite { /* Hovered cells */ + 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 */ + padding: 2px 2px 0px 2px; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +.calendar tbody td.selected { /* Cell showing selected date */ + font-weight: bold; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; + padding: 2px 2px 0px 2px; + background: ButtonFace; + color: ButtonText; +} + +.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 td.disabled { color: GrayText; } + +.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) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + background: ButtonFace; + padding: 1px; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; + color: ButtonText; + 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: #e4e0d8; +} + +.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) */ + +.combo { + position: absolute; + display: none; + width: 4em; + top: 0px; + left: 0px; + cursor: default; + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; + background: Menu; + color: MenuText; + font-size: smaller; + padding: 1px; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .active { + padding: 0px; + border: 1px solid #000; +} + +.combo .hilite { + background: Highlight; + color: HighlightText; +} + +.calendar td.time { + border-top: 1px solid ButtonShadow; + padding: 1px 0px; + text-align: center; + background-color: ButtonFace; +} + +.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: Menu; +} + +.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: Highlight; + color: HighlightText; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} diff --git a/www/extras/calendar/calendar-win2k-1.css b/www/extras/calendar/calendar-win2k-1.css new file mode 100644 index 000000000..0d9e08aa4 --- /dev/null +++ b/www/extras/calendar/calendar-win2k-1.css @@ -0,0 +1,264 @@ +/* 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: #d4d0c8; + font-family: tahoma,verdana,sans-serif; + z-index: 10000; +} + +.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: #d4d0c8; + 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("/extras/calendar/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: #848078; + color: #fff; + text-align: center; +} + +.calendar thead .headrow { /* Row containing navigation buttons */ +} + +.calendar thead .daynames { /* Row containing the day names */ +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #000; + padding: 2px; + text-align: center; + background: #f4f0e8; +} + +.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: #e4e0d8; +} + +.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: #c4c0b8; +} + +/* 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 table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #f4f0e8; +} + +.calendar tbody .rowhilite td { + background: #e4e0d8; +} + +.calendar tbody .rowhilite td.wn { + background: #d4d0c8; +} + +.calendar tbody td.hilite { /* Hovered cells */ + 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 */ + 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: #e4e0d8; +} + +.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 in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + background: #f4f0e8; + padding: 1px; + border: 1px solid #000; + background: #848078; + 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: #e4e0d8; +} + +.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) */ + +.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: #e4e0d8; + font-size: smaller; + padding: 1px; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .active { + background: #c4c0b8; + padding: 0px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.combo .hilite { + background: #048; + 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; +} diff --git a/www/extras/calendar/calendar-win2k-2.css b/www/extras/calendar/calendar-win2k-2.css new file mode 100644 index 000000000..9727d1b9a --- /dev/null +++ b/www/extras/calendar/calendar-win2k-2.css @@ -0,0 +1,263 @@ +/* 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 containing navigation buttons */ +} + +.calendar thead .daynames { /* Row containing the day names */ +} + +.calendar thead .name { /* Cells 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 containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} + +.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 */ + 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 */ + 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 in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + 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) */ + +.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: smaller; + padding: 1px; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.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; +} + +.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; +} diff --git a/www/extras/calendar/calendar-win2k-cold-1.css b/www/extras/calendar/calendar-win2k-cold-1.css new file mode 100644 index 000000000..f3ca5e0d5 --- /dev/null +++ b/www/extras/calendar/calendar-win2k-cold-1.css @@ -0,0 +1,257 @@ +/* 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: #c8d0d4; + 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: #c8d0d4; + 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: #788084; + color: #fff; + text-align: center; +} + +.calendar thead .headrow { /* Row containing navigation buttons */ +} + +.calendar thead .daynames { /* Row containing the day names */ +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #000; + padding: 2px; + text-align: center; + background: #e8f0f4; +} + +.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: #d8e0e4; +} + +.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: #b8c0c4; +} + +/* 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 table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #e8f4f0; +} + +.calendar tbody .rowhilite td { + background: #d8e4e0; +} + +.calendar tbody .rowhilite td.wn { + background: #c8d4d0; +} + +.calendar tbody td.hilite { /* Hovered cells */ + padding: 1px 3px 1px 1px; + border: 1px solid; + border-color: #fff #000 #000 #fff; +} + +.calendar tbody td.active { /* Active (pressed) cells */ + padding: 2px 2px 0px 2px; + border: 1px solid; + border-color: #000 #fff #fff #000; +} + +.calendar tbody td.selected { /* Cell showing selected date */ + font-weight: bold; + padding: 2px 2px 0px 2px; + border: 1px solid; + border-color: #000 #fff #fff #000; + background: #d8e0e4; +} + +.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 in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + background: #e8f0f4; + padding: 1px; + border: 1px solid #000; + background: #788084; + 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: #d8e0e4; +} + +.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) */ + +.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: #d8e0e4; + font-size: smaller; + padding: 1px; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .active { + background: #c8d0d4; + padding: 0px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.combo .hilite { + background: #048; + color: #aef; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #e8f0f4; +} + +.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; +} diff --git a/www/extras/calendar/calendar-win2k-cold-2.css b/www/extras/calendar/calendar-win2k-cold-2.css new file mode 100644 index 000000000..b757ea66e --- /dev/null +++ b/www/extras/calendar/calendar-win2k-cold-2.css @@ -0,0 +1,263 @@ +/* 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: #c8d4d0; + 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: #c8d4d0; + 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: #788480; + color: #fff; + text-align: center; +} + +.calendar thead .headrow { /* Row containing navigation buttons */ +} + +.calendar thead .daynames { /* Row containing the day names */ +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #000; + padding: 2px; + text-align: center; + background: #e8f4f0; +} + +.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: #d8e4e0; +} + +.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: #b8c4c0; +} + +/* 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 table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #e8f4f0; +} + +.calendar tbody .rowhilite td { + background: #d8e4e0; +} + +.calendar tbody .rowhilite td.wn { + background: #c8d4d0; +} + +.calendar tbody td.hilite { /* Hovered cells */ + 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 */ + 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: #d8e4e0; +} + +.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 in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + background: #e8f4f0; + padding: 1px; + border: 1px solid #000; + background: #788480; + 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: #d8e4e0; +} + +.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) */ + +.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: #d8e4e0; + font-size: smaller; + padding: 1px; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .active { + background: #c8d4d0; + padding: 0px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.combo .hilite { + background: #048; + color: #aef; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #e8f0f4; +} + +.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; +} diff --git a/www/extras/calendar/calendar.js b/www/extras/calendar/calendar.js new file mode 100644 index 000000000..dde8b00ca --- /dev/null +++ b/www/extras/calendar/calendar.js @@ -0,0 +1,1641 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * ------------------------------------------------------------------ + * + * The DHTML Calendar, version 0.9.5 "Your favorite time, bis" + * + * 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 + */ + +// $Id$ + +/** The Calendar object constructor. */ +Calendar = function (mondayFirst, dateStr, onSelected, onClose) { + // member variables + 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; + // HTML elements + this.table = null; + this.element = null; + this.tbody = null; + this.firstdayname = null; + // Combo boxes + this.monthsCombo = null; + this.yearsCombo = null; + this.hilitedMonth = null; + this.activeMonth = null; + this.hilitedYear = null; + this.activeYear = null; + // Information + this.dateClicked = false; + + // one-time initializations + if (typeof Calendar._SDN == "undefined") { + // table of short day names + 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; + // table of short month names + 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; + } +}; + +// ** constants + +/// "static", needed for event handlers. +Calendar._C = null; + +/// detect a special case of "web browser" +Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && + !/opera/i.test(navigator.userAgent) ); + +/// detect Opera browser +Calendar.is_opera = /opera/i.test(navigator.userAgent); + +/// detect KHTML-based browsers +Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); + +// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate +// library, at some point. + +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) { // IE + el.attachEvent("on" + evname, func); + } else if (el.addEventListener) { // Gecko / W3C + el.addEventListener(evname, func, true); + } else { + el["on" + evname] = func; + } +}; + +Calendar.removeEvent = function(el, evname, func) { + if (el.detachEvent) { // IE + el.detachEvent("on" + evname, func); + } else if (el.removeEventListener) { // Gecko / W3C + el.removeEventListener(evname, func, true); + } else { + el["on" + evname] = null; + } +}; + +Calendar.createElement = function(type, parent) { + var el = null; + if (document.createElementNS) { + // use the XHTML namespace; IE won't normally get here unless + // _they_ "fix" the DOM2 implementation. + el = document.createElementNS("http://www.w3.org/1999/xhtml", type); + } else { + el = document.createElement(type); + } + if (typeof parent != "undefined") { + parent.appendChild(el); + } + return el; +}; + +// END: UTILITY FUNCTIONS + +// BEGIN: CALENDAR STATIC FUNCTIONS + +/** Internal -- adds a set of events to make some element behave like a button. */ +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"; + } +}; + +// event handlers + +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); + } +}; + +/** + * A generic "click" handler :) handles all types of buttons defined in this + * calendar. + */ +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; + // a date was clicked + 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); + // unless "today" was clicked, we assume no date was clicked so + // the selected handler will know not to close the calenar when + // in single-click mode. + // cal.dateClicked = (el.navtype == 0); + 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 { + // FIXME: this should be removed as soon as lang files get updated! + 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 < cal.maxYear) { + date.setFullYear(year + 1); + setMonth(0); + } + break; + case 2: + if (year < cal.maxYear) { + date.setFullYear(year + 1); + } + break; + case 100: + cal.setMondayFirst(!cal.mondayFirst); + return; + case 50: + var range = el._range; + var current = el.firstChild.data; + for (var i = range.length; --i >= 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: + // TODAY will bring us here + if ((typeof cal.getDateStatus == "function") && cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { + // remember, "date" was previously set to new + // Date() if TODAY was clicked; thus, it + // contains today date. + 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(); + } +}; + +// END: CALENDAR STATIC FUNCTIONS + +// BEGIN: CALENDAR OBJECT FUNCTIONS + +/** + * This function creates the calendar inside the given parent. If _par is + * null than it creates a popup calendar inside the BODY element. If _par is + * an element, be it BODY, then it creates a non-popup calendar (still + * hidden). Some properties need to be set before calling this function. + */ +Calendar.prototype.create = function (_par) { + var parent = null; + if (! _par) { + // default parent is the document body, in which case we create + // a popup calendar. + 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 { + // FIXME: dirty hack for entities + 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"]; + + // day names + 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; i < Calendar._MN.length; ++i) { + var mn = Calendar.createElement("div"); + mn.className = Calendar.is_ie ? "label-IEfix" : "label"; + mn.month = i; + mn.appendChild(document.createTextNode(Calendar._SMN[i])); + div.appendChild(mn); + } + + div = Calendar.createElement("div", this.element); + this.yearsCombo = div; + div.className = "combo"; + for (i = 12; i > 0; --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); +}; + +/** keyboard navigation, only for popup calendars */ +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: // KEY left + act && Calendar.cellClick(cal._nav_pm); + break; + case 38: // KEY up + act && Calendar.cellClick(cal._nav_py); + break; + case 39: // KEY right + act && Calendar.cellClick(cal._nav_nm); + break; + case 40: // KEY down + act && Calendar.cellClick(cal._nav_ny); + break; + default: + return false; + } + } else switch (ev.keyCode) { + case 32: // KEY space (now) + Calendar.cellClick(cal._nav_now); + break; + case 27: // KEY esc + act && cal.hide(); + break; + case 37: // KEY left + case 38: // KEY up + case 39: // KEY right + case 40: // KEY down + 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: // KEY left + (--date >= 0) && (ne = cal.ar_days[date]); + break; + case 38: // KEY up + date -= 7; + (date >= 0) && (ne = cal.ar_days[date]); + break; + case 39: // KEY right + (++date < cal.ar_days.length) && (ne = cal.ar_days[date]); + break; + case 40: // KEY down + date += 7; + (date < cal.ar_days.length) && (ne = cal.ar_days[date]); + break; + } + if (!ne) { + if (prev) { + Calendar.cellClick(cal._nav_pm); + } else { + Calendar.cellClick(cal._nav_nm); + } + date = (prev) ? cal.date.getMonthDays() : 1; + el = cal.currentDateEl; + ne = cal.ar_days[date - 1]; + } + Calendar.removeClass(el, "selected"); + Calendar.addClass(ne, "selected"); + cal.date.setDate(ne.caldate); + cal.callHandler(); + cal.currentDateEl = ne; + } + break; + case 13: // KEY enter + if (act) { + cal.callHandler(); + cal.hide(); + } + break; + default: + return false; + } + return Calendar.stopEvent(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. + */ +Calendar.prototype._init = function (mondayFirst, date) { + var today = new Date(); + var year = date.getFullYear(); + if (year < this.minYear) { + year = this.minYear; + date.setFullYear(year); + } else if (year > this.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 && j < wday) || iday > no_days) { + // cell.className = "emptycell"; + 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(); + // PROFILE + // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms"; +}; + +/** + * Calls _init function above for going to a certain date (but only if the + * date is different than the currently selected one). + */ +Calendar.prototype.setDate = function (date) { + if (!date.equalsTo(this.date)) { + this._init(this.mondayFirst, date); + } +}; + +/** + * Refreshes the calendar. Useful if the "disabledHandler" function is + * dynamic, meaning that the list of disabled date can change at runtime. + * Just * call this function if you think that the list of disabled dates + * should * change. + */ +Calendar.prototype.refresh = function () { + this._init(this.mondayFirst, this.date); +}; + +/** Modifies the "mondayFirst" parameter (EU/US style). */ +Calendar.prototype.setMondayFirst = function (mondayFirst) { + this._init(mondayFirst, this.date); + this._displayWeekdays(); +}; + +/** + * Allows customization of what dates are enabled. The "unaryFunction" + * parameter must be a function object that receives the date (as a JS Date + * object) and returns a boolean value. If the returned value is true then + * the passed date will be marked as disabled. + */ +Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { + this.getDateStatus = unaryFunction; +}; + +/** Customization of allowed year range for the calendar. */ +Calendar.prototype.setRange = function (a, z) { + this.minYear = a; + this.maxYear = z; +}; + +/** Calls the first user handler (selectedHandler). */ +Calendar.prototype.callHandler = function () { + if (this.onSelected) { + this.onSelected(this, this.date.print(this.dateFormat)); + } +}; + +/** Calls the second user handler (closeHandler). */ +Calendar.prototype.callCloseHandler = function () { + if (this.onClose) { + this.onClose(this); + } + this.hideShowCovered(); +}; + +/** Removes the calendar object from the DOM tree and destroys it. */ +Calendar.prototype.destroy = function () { + var el = this.element.parentNode; + el.removeChild(this.element); + Calendar._C = null; + window.calendar = null; +}; + +/** + * Moves the calendar element to a different section in the DOM tree (changes + * its parent). + */ +Calendar.prototype.reparent = function (new_parent) { + var el = this.element; + el.parentNode.removeChild(el); + new_parent.appendChild(el); +}; + +// This gets called when the user presses a mouse button anywhere in the +// document, if the calendar is shown. If the click was outside the open +// calendar this function closes it. +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) { + // calls closeHandler which should hide the calendar. + window.calendar.callCloseHandler(); + return Calendar.stopEvent(ev); + } +}; + +/** Shows the calendar. */ +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(); +}; + +/** + * Hides the calendar. Also removes any "hilite" from the class of any TD + * element. + */ +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(); +}; + +/** + * Shows the calendar at a given absolute position (beware that, depending on + * the calendar element style -- position property -- this might be relative + * to the parent's containing rectangle). + */ +Calendar.prototype.showAt = function (x, y) { + var s = this.element.style; + s.left = x + "px"; + s.top = y + "px"; + this.show(); +}; + +/** Shows the calendar near a given element. */ +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); + } + // vertical alignment + 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; // already there + } + // horizontal alignment + 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; // already there + } + 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(); +}; + +/** Customizes the date format. */ +Calendar.prototype.setDateFormat = function (str) { + this.dateFormat = str; +}; + +/** Customizes the tooltip date format. */ +Calendar.prototype.setTtDateFormat = function (str) { + this.ttDateFormat = str; +}; + +/** + * Tries to identify the date represented in a string. If successful it also + * calls this.setDate which moves the calendar to the given date. + */ +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; i < a.length; ++i) { + if (b[i] == "%a" || b[i] == "%A") { + continue; + } + if (b[i] == "%d" || b[i] == "%e") { + d = parseInt(a[i], 10); + } + if (b[i] == "%m") { + m = parseInt(a[i], 10) - 1; + } + if (b[i] == "%Y" || b[i] == "%y") { + y = parseInt(a[i], 10); + (y < 100) && (y += (y > 29) ? 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; i < a.length; ++i) { + if (a[i].search(/[a-zA-Z]+/) != -1) { + var t = -1; + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } + } + if (t != -1) { + if (m != -1) { + d = m+1; + } + m = t; + } + } else if (parseInt(a[i], 10) <= 12 && m == -1) { + m = a[i]-1; + } else if (parseInt(a[i], 10) > 31 && 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") { // Gecko, W3C + if (!Calendar.is_khtml) + value = document.defaultView. + getComputedStyle(obj, "").getPropertyValue("visibility"); + else + value = ''; + } else if (obj.currentStyle) { // IE + 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) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = cc.__msh_save_visibility; + } else { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = "hidden"; + } + } + } + }; + if (Calendar.is_khtml) + setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); + else + Calendar.continuation_for_the_fucking_khtml_browser(); +}; + +/** 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 cell = this.firstdayname; + 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"]; + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + if (i == SUN || i == SAT) { + Calendar.addClass(cell, "weekend"); + } + cell.firstChild.data = Calendar._SDN[i + 1 - MON]; + cell = cell.nextSibling; + } +}; + +/** Internal function. Hides all combo boxes that might be displayed. */ +Calendar.prototype._hideCombos = function () { + this.monthsCombo.style.display = "none"; + this.yearsCombo.style.display = "none"; +}; + +/** Internal function. Starts dragging the element. */ +Calendar.prototype._dragStart = function (ev) { + if (this.dragging) { + return; + } + this.dragging = true; + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posY = ev.clientY + window.scrollY; + posX = ev.clientX + window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + with (Calendar) { + addEvent(document, "mousemove", calDragIt); + addEvent(document, "mouseover", stopEvent); + addEvent(document, "mouseup", calDragEnd); + } +}; + +// BEGIN: DATE OBJECT PATCHES + +/** Adds the number of days array to the Date object. */ +Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); + +/** Constants used for time computations */ +Date.SECOND = 1000 /* milliseconds */; +Date.MINUTE = 60 * Date.SECOND; +Date.HOUR = 60 * Date.MINUTE; +Date.DAY = 24 * Date.HOUR; +Date.WEEK = 7 * Date.DAY; + +/** Returns the number of days in the current month */ +Date.prototype.getMonthDays = function(month) { + var year = this.getFullYear(); + if (typeof month == "undefined") { + month = this.getMonth(); + } + if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { + return 29; + } else { + return Date._MD[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 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); +}; + +/** Checks dates equality (ignores time) */ +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())); +}; + +/** Prints the date in a string according to the given format. */ +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]; // abbreviated weekday name [FIXME: I18N] + s["%A"] = Calendar._DN[w]; // full weekday name + s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] + s["%B"] = Calendar._MN[m]; // full month name + // FIXME: %c : preferred date and time representation for the current locale + s["%C"] = 1 + Math.floor(y / 100); // the century number + s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) + s["%e"] = d; // the day of the month (range 1 to 31) + // FIXME: %D : american date style: %m/%d/%y + // FIXME: %E, %F, %G, %g, %h (man strftime) + s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) + s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) + s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) + s["%k"] = hr; // hour, range 0 to 23 (24h format) + s["%l"] = ir; // hour, range 1 to 12 (12h format) + s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 + s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 + s["%n"] = "\n"; // a newline character + s["%p"] = pm ? "PM" : "AM"; + s["%P"] = pm ? "pm" : "am"; + // FIXME: %r : the time in am/pm notation %I:%M:%S %p + // FIXME: %R : the time in 24-hour notation %H:%M + s["%s"] = Math.floor(this.getTime() / 1000); + s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 + s["%t"] = "\t"; // a tab character + // FIXME: %T : the time in 24-hour notation (%H:%M:%S) + s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; + s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) + s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) + // FIXME: %x : preferred date representation for the current locale without the time + // FIXME: %X : preferred time representation for the current locale without the date + 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'); + } + return str.replace(re, function(match, par) { return s[par]; }); +}; + +// END: DATE OBJECT PATCHES + +// global object that remembers the calendar +window.calendar = null; diff --git a/www/extras/calendar/calendar_stripped.js b/www/extras/calendar/calendar_stripped.js new file mode 100644 index 000000000..029496a74 --- /dev/null +++ b/www/extras/calendar/calendar_stripped.js @@ -0,0 +1,12 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * ------------------------------------------------------------------ + * + * The DHTML Calendar, version 0.9.5 "Your favorite time, bis" + * + * 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 + */ + 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 diff --git a/www/extras/calendar/doc/html/reference-Z-S.css b/www/extras/calendar/doc/html/reference-Z-S.css new file mode 100644 index 000000000..e69de29bb diff --git a/www/extras/calendar/doc/html/reference.css b/www/extras/calendar/doc/html/reference.css new file mode 100644 index 000000000..42e928353 --- /dev/null +++ b/www/extras/calendar/doc/html/reference.css @@ -0,0 +1,34 @@ +html { margin: 0px; padding: 0px; background-color: #08f; color: #444; font-family: georgia,serif; } +body { margin: 2em 8%; background-color: #fff; padding: 1em; border: 2px ridge #048; } + +a:link, a:visited { text-decoration: none; color: #00f; } +a:hover { color: #f00; text-decoration: underline; } +a:active { color: #f84; } + +h1, h2, h3, h4, h5, h6 { font-family: tahoma,verdana,sans-serif; } + +h2, h3 { font-weight: normal; } + +h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { text-decoration: none; } + +h1 { font-size: 170%; border: 2px ridge #048; letter-spacing: 2px; color: #000; margin-left: -2em; margin-right: -2em; +background-color: #fff; padding: 2px 1em; background-color: #def; } +h2 { font-size: 140%; color: #222; } +h3 { font-size: 120%; color: #444; } + +h1.title { font-size: 300%; font-family: georgia,serif; font-weight: normal; color: #846; letter-spacing: -1px; +border: none; +padding: none; +background-color: #fff; +border-bottom: 3px double #624; padding-bottom: 2px; margin-left: 8%; margin-right: 8%; } + +.colophon { padding-top: 2em; color: #999; font-size: 90%; font-family: georgia,"times new roman",serif; } +.colophon a:link, .colophon a:visited { color: #755; } +.colophon a:hover { color: #422; text-decoration: underline; } + +.footnote { font-size: 90%; font-style: italic; font-family: georgia,"times new roman",serif; margin: 0px 3em; } +.footnote sup { font-size: 120%; padding: 0px 0.3em; position: relative; top: -0.2em; } + +.small { font-size: 90%; } + +.verbatim { background-color: #eee; padding: 0.2em 1em; border: 1px solid #aaa; } diff --git a/www/extras/calendar/doc/html/reference.html b/www/extras/calendar/doc/html/reference.html new file mode 100644 index 000000000..9c0c856ff --- /dev/null +++ b/www/extras/calendar/doc/html/reference.html @@ -0,0 +1,1290 @@ + + + + + +DHTML Calendar Widget + + + + + + +

+

+

+

+

+

+

+

+

+

+

+ + + +

+

+ + + +

+

+ + +

+

+

+

+

+



DHTML Calendar Widget

+

+
+Mihai Bazon, <mishoo@infoiasi.ro>

November 5, 2003

+

+

+calendar version: 0.9.5 “Your favorite time, bis” +

+
+

+

+$Id$ +

+
+
+ +
+ +
+ +

Contents

+

+    1  Overview
+        1.1  How does this thing work?
+        1.2  Project files
+        1.3  License
+

+

+    2  Quick startup
+        2.1  Installing a popup calendar
+        2.2  Installing a flat calendar
+        2.3  Calendar.setup in detail
+

+

+    3  The Calendar object overview
+        3.1  Creating a calendar
+        3.2  Order does matter ;-)
+        3.3  Caching the object
+        3.4  Callback functions
+

+

+    4  The Calendar object API reference
+        4.1  Calendar constructor
+        4.2  Useful member variables (properties)
+        4.3  Public methods
+            4.3.1  Calendar.create
+            4.3.2  Calendar.callHandler
+            4.3.3  Calendar.callCloseHandler
+            4.3.4  Calendar.hide
+            4.3.5  Calendar.setDateFormat
+            4.3.6  Calendar.setTtDateFormat
+            4.3.7  Calendar.setDisabledHandler
+            4.3.8  Calendar.setDateStatusHandler
+            4.3.9  Calendar.show
+            4.3.10  Calendar.showAt
+            4.3.11  Calendar.showAtElement
+            4.3.12  Calendar.setDate
+            4.3.13  Calendar.setMondayFirst
+            4.3.14  Calendar.parseDate
+            4.3.15  Calendar.setRange
+

+

+    5  Side effects
+

+

+    6  Credits
+

+

+

+

+

+ +

1  Overview

The DHTML Calendar widget1 +is an (HTML) user interface element that gives end-users a friendly way to +select date and time. It works in a web browser. The first versions only provided +support for popup calendars, while starting with version 0.9 it also supports +“flat” display. A “flat” calendar is a calendar that stays visible in the +page all the time. In this mode it could be very useful for “blog” pages and +other pages that require the calendar to be always present.

+

+The calendar is compatible with most popular browsers nowadays. While it’s +created using web standards and it should generally work with any compliant +browser, the following browsers were found to work: Mozilla (the +development platform), Netscape 6.0 or better, all other Gecko-based browsers, +Internet Explorer 5.0 or better for Windows2, Opera 73 and Konqueror 3.1.2 (with pretty much the +same dysfunctions as in Opera).

+

+You can find the latest info and version at the calendar homepage:

+

+

+ +

+

+ +

1.1  How does this thing work?

DHTML is not “another kind of HTML”. It’s merely a naming convention. DHTML +refers to the combination of HTML, CSS, JavaScript and DOM. DOM (Document +Object Model) is a set of interfaces that glues the other three together. In +other words, DOM allows dynamic modification of an HTML page through a program. +JavaScript is our programming language, since that’s what browsers like. CSS +is a way to make it look good ;-). So all this soup is generically known as +DHTML.

+

+Using DOM calls, the program dynamically creates a <table> element +that contains a calendar for the given date and then inserts it in the document +body. Then it shows this table at a specified position. Usually the position +is related to some element in which the date needs to be displayed/entered, +such as an input field.

+

+By assigning a certain CSS class to the table we can control the look of the +calendar through an external CSS file; therefore, in order to change the +colors, backgrounds, rollover effects and other stuff, you can only change a +CSS file—modification of the program itself is not necessary.

+

+

+ +

1.2  Project files

Here’s a description of the project files, excluding documentation and example +files.

+

+

+

    +

    +
  • the main program file (calendar.js). This defines all the logic +behind the calendar widget.

    +

    +

    +
  • the CSS files (calendar-*.css). Loading one of them is +necessary in order to see the calendar as intended.

    +

    +

    +
  • the language definition files (lang/calendar-*.js). They are +plain JavaScript files that contain all texts that are displayed by the +calendar. Loading one of them is necessary.

    +

    +

    +
  • helper functions for quick setup of the calendar +(calendar-setup.js). You can do fine without it, but starting with +version 0.9.3 this is the recommended way to setup a calendar.

    +

    +

    +

+

+

+ +

1.3  License

+
+ +© Mihai Bazon, 2002 – 2003, <mishoo@infoiasi.ro>
+http://dynarch.com/mishoo/ +
+

+The calendar is released under the +GNU Lesser General Public License. You +can read the entire license text +here.

+

+

+ +

2  Quick startup

+

+Installing the calendar used to be quite a task until version 0.9.3. Starting +with 0.9.3 I have included the file calendar-setup.js whose goal is to +assist you to setup a popup or flat calendar in minutes. You are +encouraged to modify this file and not calendar.js if you need +extra customization, but you’re on your own.

+

+First you have to include the needed scripts and style-sheet. Make sure you do +this in your document’s <head> section, also make sure you put the +correct paths to the scripts.

+

+

+
<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>
+

+

+

+ +

2.1  Installing a popup calendar

+

+Now suppose you have the following HTML:

+

+

+
<form ...>
+  <input type="text" id="data" name="data" />
+  <button id="trigger">...</button>
+</form>
+

+

+You want the button to popup a calendar widget when clicked? Just +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
+    }
+  );
+</script>
+

+

+The Calendar.setup function, defined in calendar-setup.js +takes care of “patching” the button to display a calendar when clicked. The +calendar is by default in single-click mode and linked with the given input +field, so that when the end-user selects a date it will update the input field +with the date in the given format and close the calendar. If you are a +long-term user of the calendar you probably remember that for doing this you +needed to write a couple functions and add an “onclick” handler for the +button by hand.

+

+By looking at the example above we can see that the function +Calendar.setup receives only one parameter: a JavaScript object. +Further, that object can have lots of properties that tell to the setup +function how would we like to have the calendar. For instance, if we would +like a calendar that closes at double-click instead of single-click we would +also include the following: singleClick:false.

+

+For a list of all supported parameters please see the section +2.3.

+

+

+ +

2.2  Installing a flat calendar

+

+Here’s how to configure a flat calendar, using the same Calendar.setup +function. First, you should have an empty element with an ID. This element +will act as a container for the calendar. It can be any block-level element, +such as DIV, TABLE, etc. We will use a DIV in this example.

+

+

+
<div id="calendar-container"></div>
+

+

+Then there is the JavaScript code that sets up the calendar into the +“calendar-container” DIV. The code can occur anywhere in HTML +after the DIV element.

+

+

+
<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>
+

+

+

+ +

2.3  Calendar.setup in detail

+

+Following there is the complete list of properties interpreted by +Calendar.setup. All of them have default values, so you can pass only those +which you would like to customize. Anyway, you must pass at least one +of inputField, displayArea or button, for a popup +calendar, or flat for a flat calendar. Otherwise you will get a +warning message saying that there’s nothing to setup.

+

+

+ + + + + + + + + + + + + + + + + + + + + +
property type description default +
inputField +string The ID of your input field. +null +
displayArea +string This is the ID of a <span>, <div>, or any other element that you would like to use to display the current date. This is generally useful only if the input field is hidden, as an area to display the date. +null +
button +string The ID of the calendar “trigger”. This is an element (ordinarily a button or an image) that will dispatch a certain event (usually “click”) to the function that creates and displays the calendar. +null +
eventName +string The name of the event that will trigger the calendar. The name should be without the “on” prefix, such as “click” instead of “onclick”. Virtually all users will want to let this have the default value (“click”). Anyway, it could be useful if, say, you want the calendar to appear when the input field is focused and have no trigger button (in this case use “focus” as the event name). +“click” +
ifFormat +string The format string that will be used to enter the date in the input field. This format will be honored even if the input field is hidden. +“%Y/%m/%d” +
daFormat +string Format of the date displayed in the displayArea (if specified). +“%Y/%m/%d” +
singleClick +boolean Wether the calendar is in “single-click mode” or “double-click mode”. If true (the default) the calendar will be created in single-click mode. +true +
disableFunc +function A function that receives a JS Date object. It should return +true if that date has to be disabled, false otherwise. +DEPRECATED (see below). +null +
dateStatusFunc +function A function that receives a JS Date object and returns a boolean +or a string. This function allows one to set a certain CSS class to some +date, therefore making it look different. If it returns true then +the date will be disabled. If it returns false nothing special +happens with the given date. If it returns a string then that will be taken +as a CSS class and appended to the date element. If this string is +“disabled” then the date is also disabled (therefore is like returning +true). For more information please also refer to section +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 +
weekNumbers +boolean If “true” then the calendar will display week numbers. +true +
align +string Alignment of the calendar, relative to the reference element. The +reference element is dynamically chosen like this: if a displayArea is +specified then it will be the reference element. Otherwise, the input field +is the reference element. For the meaning of the alignment characters +please section 4.3.11. +“Bl” +
range +array An array having exactly 2 elements, integers. (!) The first [0] element is the minimum year that is available, and the second [1] element is the maximum year that the calendar will allow. +[1900, 2999] +
flat +string If you want a flat calendar, pass the ID of the parent object in +this property. If not, pass null here (or nothing at all as +null is the default value). +null +
flatCallback +function You should provide this function if the calendar is flat. It +will be called when the date in the calendar is changed with a reference to +the calendar object. See section 2.2 for an example +of how to setup a flat calendar. +null +
onSelect +function If you provide a function handler here then you have to manage +the “click-on-date” event by yourself. Look in the calendar-setup.js and +take as an example the onSelect handler that you can see there. +null +
onClose +function This handler will be called when the calendar needs to close. +You don’t need to provide one, but if you do it’s your responsibility to +hide/destroy the calendar. You’re on your own. Check the calendar-setup.js +file for an example. +null +
onUpdate +function If you supply a function handler here, it will be called right +after the target field is updated with a new date. You can use this to +chain 2 calendars, for instance to setup a default date in the second just +after a date was selected in the first. +null +
date +date This allows you to setup an initial date where the calendar will be +positioned to. If absent then the calendar will open to the today date. +null +
showsTime +boolean If this is set to true then the calendar will also +allow time selection. +false +
timeFormat +string Set this to “12” or “24” to configure the way that the +calendar will display time. +“24” + +
+ +

+

+ +

3  The Calendar object overview

+

+Basically you should be able to setup the calendar with the function presented +in the previous section. However, if for some reason Calendar.setup +doesn’t provide all the functionality that you need and you want to tweak into +the process of creating and configuring the calendar “by hand”, then this +section is the way to go.

+

+The file calendar.js implements the functionality of the calendar. +All (well, almost all) functions and variables are embedded in the JavaScript +object “Calendar”.

+

+You can instantiate a Calendar object by calling the constructor, like +this: var cal = new Calendar(...). We will discuss the parameters +later. After creating the object, the variable cal will contain a +reference to it. You can use this reference to access further options of the +calendar, for instance:

+

+

+
cal.weekNumbers = false; // do not display week numbers
+cal.showsTime = true;    // include a time selector
+cal.setDateFormat("%Y.%m.%d %H:%M"); // set this format: 2003.12.31 23:59
+cal.setDisabledHandler(function(date, year, month, day) {
+  // verify date and return true if it has to be disabled
+  // ``date'' is a JS Date object, but if you only need the
+  // year, month and/or day you can get them separately as
+  // next 3 parameters, as you can see in the declaration
+  if (year == 2004) {
+    // disable all dates from 2004
+    return true;
+  }
+  return false;
+});
+

+

+etc. Prior to version +0.9.3 this was the only way to configure it. The Calendar.setup +function, documented in section 2, basically does the same +things (actually more) in order to setup the calendar, based on the parameters +that you provided.

+

+

+ +

3.1  Creating a calendar

The calendar is created by following some steps (even the function +Calendar.setup, described in section 2, does the +same). While you can skip optional (marked “opt”) steps if you’re happy with +the defaults, please respect the order below.

+

+

+

    +

    +
  1. Instantiate a Calendar object. Details about this in +section 4.1.

    +

    +

    +
  2. opt   Set the weekNumbers property to false if you don’t want +the calendar to display week numbers.

    +

    +

    +
  3. opt   Set the showsTime property to true if you +want the calendar to also provide a time selector.

    +

    +

    +
  4. opt   Set the time24 property to false if you want +the time selector to be in 12-hour format. Default is 24-hour format. This +property only has effect if you also set showsTime to +true.

    +

    +

    +
  5. opt   Set the range of years available for selection (see section +4.3.15). The default range is [1970..2050].

    +

    +

    +
  6. opt   Set the getDateStatus property. You should pass +here a function that receives a JavaScript Date object and returns +true if the given date should be disabled, false otherwise (details in +section 4.3.7).

    +

    +

    +
  7. opt   Set a date format. Your handler function, passed to the +calendar constructor, will be called when a date is selected with a reference +to the calendar and a date string in this format.

    +

    +

    +
  8. Create the HTML elements related to the calendar. This step +practically puts the calendar in your HTML page. You simply call +Calendar.create(). You can give an optional parameter if you wanna +create a flat calendar (details in section 4.3.1).

    +

    +

    +
  9. opt   Initialize the calendar to a certain date, for instance from +the input field.

    +

    +

    +
  10. Show the calendar (details in section 4.3.9).

    +

    +

    +

+

+

+ +

3.2  Order does matter ;-)

As you could see in the previous section, there are more steps to be followed +in order to setup the calendar. This happens because there are two different +things that need to be accomplished: first there is the JavaScript object, that +is created with new Calendar(...). Secondly there are the HTML +elements that actually lets you see and manipulate the calendar.

+

+

+[ Those that did UI4 programming, no matter in what +language and on what platform, may be familiar with this concept. First there +is the object in memory that lets you manipulate the UI element, and secondly +there is the UI element (known as “control”, “window”, “widget”, etc.), +also in memory but you don’t usually access it directly. ] +

+By instantiating the calendar we create the JavaScript object. It lets us +configure some properties and it also knows how to create the UI element (the +HTML elements actually) that will eventually be what the end-user sees on +screen. Creation of the HTML element is accomplished by the function +Calendar.create. It knows how to create popup or flat calendars. +This function is described in section 4.3.1.

+

+Some properties need to be set prior to creating the HTML elements, because +otherwise they wouldn’t have any effect. Such a property is +weekNumbers—it has the default value “true”, and if you don’t +want the calendar to display the week numbers you have to set it to false. If, +however, you do that after calling Calendar.create the calendar +would still display the week numbers, because the HTML elements are already +created (including the <td>-s in the <table> element that +should contain the week numbers). For this reason the order of the steps above +is important.

+

+Another example is when you want to show the calendar. The “create” function +does create the HTML elements, but they are initially hidden (have the style +“display: none”) unless the calendar is a flat calendar that should be always +visible in the page. Obviously, the Calendar.show function should be +called after calling Calendar.create.

+

+

+ +

3.3  Caching the object

Suppose the end-user has popped up a calendar and selects a date. The calendar +then closes. What really happens now?

+

+There are two approaches. The first (used in very old versions of the +calendar) was to drop completely the Calendar object and when the end-user pops +up the calendar again to create another one. This approach is bad for more +reasons:

+

+

+

    +

    +
  • creating the JavaScript object and HTML elements is time-consuming

    +

    +

    +
  • we may loose some end-user preferences (i.e. he might prefer to have +Monday for the first day of week and probably already clicked it the first time +when the calendar was opened, but now he has to do it again)

    +

    +

    +

+

+The second approach, implemented by the Calendar.setup function, is to +cache the JavaScript object. It does this by checking the global variable +window.calendar and if it is not null it assumes it is the created +Calendar object. When the end-user closes the calendar, our code will only +call “hide” on it, therefore keeping the JavaScript object and the +HTML elements in place.

+

+CAVEAT:     Since time selection support was introduced, this +“object caching” mechanism has the following drawback: if you once created +the calendar with the time selection support, then other items that may not +require this functionality will still get a calendar with the time selection +support enabled. And reciprocal. ;-) Hopefully this will be corrected in a +later version, but for now it doesn’t seem such a big problem.

+

+

+ +

3.4  Callback functions

You might rightfully wonder how is the calendar related to the input field? +Who tells it that it has to update that input field when a date is +selected, or that it has to jump to that URL when a date is clicked in +flat mode?

+

+All this magic is done through callback functions. The calendar doesn’t know +anything about the existence of an input field, nor does it know where to +redirect the browser when a date is clicked in flat mode. It just calls your +callback when a particular event is happening, and you’re responsible to handle +it from there. For a general purpose library I think this is the best model of +making a truly reusable thing.

+

+The calendar supports the following user callbacks:

+

+

+

    +

    +
  • onSelect   — this gets called when the end-user changes the date in the +calendar. Documented in section 4.1.

    +

    +

    +
  • onClose   — this gets called when the calendar should close. It’s +user’s responsibility to close the calendar. Details in section +4.1.

    +

    +

    +
  • getDateStatus   — this function gets called for any day in a month, +just before displaying the month. It is called with a JavaScript Date +object and should return true if that date should be disabled, false +if it’s an ordinary date and no action should be taken, or it can return a +string in which case the returned value will be appended to the element’s CSS +class (this way it provides a powerful way to make some dates “special”, +i.e. highlight them differently). Details in section +4.3.8.

    +

    +

    +

+

+

+ +

4  The Calendar object API reference

+

+

+ +

4.1  Calendar constructor

+

+Synopsis:

+

+

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

+

+Parameters are as follows:

+

+

+

    +

    +
  • mondayFirst   — boolean, if it’s true the calendar will have +Monday as first day of week, if false weeks start on Sunday.

    +

    +

    +
  • date   — a JavaScript Date object or null. If null +is passed then the calendar will default to today date. Otherwise it will +initialize on the given date.

    +

    +

    +
  • onSelect   — your callback for the “onChange” event. See above.

    +

    +

    +
  • onClose   — your callback for the “onClose” event. See above.

    +

    +

    +

+

+

+ +

The onSelect event

+

+Here is a typical implementation of this function:

+

+

+
function onSelect(calendar, date) {
+  var input_field = document.getElementById("date");
+  input_field.value = date;
+};
+

+

+date is in the format selected with calendar.setDateFormat +(see section 4.3.5). This code simply updates the +input field. If you want the calendar to be in single-click mode then you +should also close the calendar after you updated the input field, so we come to +the following version:

+

+

+
function onSelect(calendar, date) {
+  var input_field = document.getElementById("date");
+  input_field.value = date;
+  if (calendar.dateClicked) {
+    calendar.callCloseHandler(); // this calls "onClose" (see above)
+  }
+};
+

+

+Note that we checked the member variable dateClicked and +only hide the calendar if it’s true. If this variable is false it +means that no date was actually selected, but the user only changed the +month/year using the navigation buttons or the menus. We don’t want to hide +the calendar in that case.

+

+

+ +

The onClose event

+

+This event is triggered when the calendar should close. It should hide or +destroy the calendar object—the calendar itself just triggers the event, but +it won’t close itself.

+

+A typical implementation of this function is the following:

+

+

+
function onClose(calendar) {
+  calendar.hide();
+  // or calendar.destroy();
+};
+

+

+

+ +

4.2  Useful member variables (properties)

+

+After creating the Calendar object you can access the following properties:

+

+

+

    +

    +
  • date — is a JavaScript Date object. It will always +reflect the date shown in the calendar (yes, even if the calendar is hidden).

    +

    +

    +
  • isPopup — if this is true then the current Calendar object is +a popup calendar. Otherwise (false) we have a flat calendar. This variable is +set from Calendar.create and has no meaning before this function was +called.

    +

    +

    +
  • dateClicked — particularly useful in the onSelect +handler, this variable tells us if a date was really clicked. That’s because +the onSelect handler is called even if the end-user only changed the +month/year but did not select a date. We don’t want to close the calendar in +that case.

    +

    +

    +
  • weekNumbers — if true (default) then the calendar +displays week numbers. If you don’t want week numbers you have to set this +variable to false before calling Calendar.create.

    +

    +

    +
  • showsTime – if you set this to true (it is +false by default) then the calendar will also include a time selector.

    +

    +

    +
  • time24 – if you set this to false then the time +selector will be in 12-hour format. It is in 24-hour format by default.

    +

    +

    +
  • mondayFirst — if true then the calendar uses Monday +as first day of week, otherwise Sunday. This variable is set from constructor, +but you still have a chance to modify it before calling +Calendar.create.

    +

    +

    +

+

+There are lots of other member variables, but one should access them only +through member functions so I won’t document them here.

+

+

+ +

4.3  Public methods

+ +

4.3.1  Calendar.create

+

+This function creates the afferent HTML elements that are needed to display the +calendar. You should call it after setting the calendar properties. Synopsis: +

+
calendar.create(); // creates a popup calendar
+  // -- or --
+calendar.create(document.getElementById(parent_id)); // makes a flat calendar
+

+

+It can create a popup calendar or a flat calendar. If the “parent” argument +is present (it should be a reference—not ID—to an HTML element) then +a flat calendar is created and it is inserted in the given element.

+

+At any moment, given a reference to a calendar object, we can inspect if it’s a +popup or a flat calendar by checking the boolean member variable +isPopup:

+

+

+
if (calendar.isPopup) {
+   // this is a popup calendar
+} else {
+   // this is a flat calendar
+}
+

+

+

+ +

4.3.2  Calendar.callHandler

+

+This function calls the first user callback (the +onSelect handler) with the required parameters.

+

+

+ +

4.3.3  Calendar.callCloseHandler

+

+This function calls the second user callback (the +onClose handler). It’s useful when you want to have a +“single-click” calendar—just call this in your onSelect handler, +if a date was clicked.

+

+

+ +

4.3.4  Calendar.hide

+

+Call this function to hide the calendar. The calendar object and HTML elements +will not be destroyed, thus you can later call one of the show +functions on the same element.

+

+

+ +

4.3.5  Calendar.setDateFormat

+

+This function configures the format in which the calendar reports the date to +your “onSelect” handler. Call it like this:

+

+

+
calendar.setDateFormat("%y/%m/%d");
+

+

+As you can see, it receives only one parameter, the required format. The magic +characters are the following:

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
%a abbreviated weekday name
%A full weekday name
%b abbreviated month name
%B full month name
%C century number
%d the day of the month ( 00 .. 31 )
%e the day of the month ( 0 .. 31 )
%H hour ( 00 .. 23 )
%I hour ( 01 .. 12 )
%j day of the year ( 000 .. 366 )
%k hour ( 0 .. 23 )
%l hour ( 1 .. 12 )
%m month ( 01 .. 12 )
%M minute ( 00 .. 59 )
%n a newline character
%p “PM” or “AM”
%P “pm” or “am”
%S second ( 00 .. 59 )
%s number of seconds since Epoch (since Jan 01 1970 00:00:00 UTC)
%t a tab character
%U, %W, %V the week number
%u the day of the week ( 1 .. 7, 1 = MON )
%w the day of the week ( 0 .. 6, 0 = SUN )
%y year without the century ( 00 .. 99 )
%Y year including the century ( ex. 1979 )
%% a literal % character +

+There are more algorithms for computing the week number. All +three specifiers currently implement the same one, as defined by ISO 8601: +“the week 01 is the week that has the Thursday in the current year, which is +equivalent to the week that contains the fourth day of January. Weeks start on +Monday.

+

+

+ +

4.3.6  Calendar.setTtDateFormat

+

+Has the same prototype as Calendar.setDateFormat, but refers to the +format of the date displayed in the “status bar” when the mouse is over some +date.

+

+

+ +

4.3.7  Calendar.setDisabledHandler

+

+This function allows you to specify a callback function that checks if a +certain date must be disabled by the calendar. You are responsible to write +the callback function. Synopsis:

+

+

+
function disallowDate(date) {
+  // date is a JS Date object
+  if (  date.getFullYear() == 2003 &&
+        date.getMonth()    == 6 /* July, it's zero-based */ &&
+        date.getDate()     == 5  ) {
+    return true; // disable July 5 2003
+  }
+  return false; // enable other dates
+};
+
+calendar.setDisabledHandler(disallowDate);
+

+

+If you change this function in “real-time”, meaning, without creating a new +calendar, then you have to call calendar.refresh() to make it +redisplay the month and take into account the new disabledHandler. +Calendar.setup does this, so you have no such trouble with it.

+

+Note that disallowDate should be very fast, as it is called for each +date in the month. Thus, it gets called, say, 30 times before displaying the +calendar, and 30 times when the month is changed. Tests I’ve done so far show +that it’s still good, but in the future I might switch it to a different design +(for instance, to call it once per month and to return an array of dates that +must be disabled).

+

+This function should be considered deprecated in the favor of +Calendar.setDateStatusHandler, described below.

+

+

+ +

4.3.8  Calendar.setDateStatusHandler

+

+This function obsoletes Calendar.setDisabledHandler. You call it with +a function parameter, but this function can return a boolean +or a string. If the return value is a boolean (true or +false) then it behaves just like setDisabledHandler, +therefore disabling the date if the return value is true.

+

+If the returned value is a string then the given date will gain an additional +CSS class, namely the returned value. You can use this to highlight some dates +in some way. Note that you are responsible for defining the CSS class that you +return. If you return the string “disabled” then that date will be disabled, +just as if you returned true.

+

+Here is a simple scenario that shows what you can do with this function. The +following should be present in some of your styles, or in the document head in +a STYLE tag (but put it after the place where the calendar styles were +loaded):

+

+

+
.special { background-color: #000; color: #fff; }
+

+

+And you would use the following code before calling Calendar.create():

+

+

+
// this table holds your special days, so that we can automatize
+// things a bit:
+var SPECIAL_DAYS = {
+    0 : [ 13, 24 ],             // special days in January
+    2 : [ 1, 6, 8, 12, 18 ],    // special days in March
+    8 : [ 21, 11 ],             // special days in September
+   11 : [ 25, 28 ]              // special days in December
+};
+
+// this function returns true if the passed date is special
+function dateIsSpecial(year, month, day) {
+    var m = SPECIAL_DAYS[month];
+    if (!m) return false;
+    for (var i in m) if (m[i] == day) return true;
+    return false;
+}
+
+// this is the actual date status handler.  Note that it receives the
+// date object as well as separate values of year, month and date, for
+// your confort.
+function dateStatusHandler(date, y, m, d) {
+    if (dateIsSpecial(y, m, d)) return ``special'';
+    else return false;
+    // return true above if you want to disable other dates
+}
+
+// configure it to the calendar
+calendar.setDateStatusHandler(dateStatusHandler);
+

+

+The above code adds the “special” class name to some dates that are defined +in the SPECIAL_DAYS table. Other dates will simply be displayed as default, +enabled.

+

+

+ +

4.3.9  Calendar.show

+

+Call this function do show the calendar. It basically sets the CSS “display” +property to “block”. It doesn’t modify the calendar position.

+

+This function only makes sense when the calendar is in popup mode.

+

+

+ +

4.3.10  Calendar.showAt

+

+Call this to show the calendar at a certain (x, y) position. Prototype:

+

+

+
calendar.showAt(x, y);
+

+

+The parameters are absolute coordinates relative to the top left +corner of the page, thus they are page coordinates not screen +coordinates.

+

+After setting the given coordinates it calls Calendar.show. This function only +makes sense when the calendar is in popup mode.

+

+

+ +

4.3.11  Calendar.showAtElement

+

+This function is useful if you want to display the calendar near some element. +You call it like this:

+

+

+
calendar.showAtElement(element, align);
+

+

+where element is a reference to your element (for instance it can be the input +field that displays the date) and align is an optional parameter, of type string, +containing one or two characters. For instance, if you pass "Br" as +align, the calendar will appear below the element and with its right +margin continuing the element’s right margin.

+

+As stated above, align may contain one or two characters. The first character +dictates the vertical alignment, relative to the element, and the second +character dictates the horizontal alignment. If the second character is +missing it will be assumed "l" (the left margin of the calendar will +be at the same horizontal position as the left margin of the element).

+

+The characters given for the align parameters are case sensitive. This +function only makes sense when the calendar is in popup mode. After computing +the position it uses Calendar.showAt to display the calendar there.

+

+

+ +

Vertical alignment

The first character in “align” can take one of the following values:

+

+

+

    +

    +
  • T — completely above the reference element (bottom margin of +the calendar aligned to the top margin of the element).

    +

    +

    +
  • t — above the element but may overlap it (bottom margin of the calendar aligned to +the bottom margin of the element).

    +

    +

    +
  • c — the calendar displays vertically centered to the reference +element. It might overlap it (that depends on the horizontal alignment).

    +

    +

    +
  • b — below the element but may overlap it (top margin of the calendar aligned to +the top margin of the element).

    +

    +

    +
  • B — completely below the element (top margin of the calendar +aligned to the bottom margin of the element).

    +

    +

    +

+

+

+ +

Horizontal alignment

The second character in “align” can take one of the following values:

+

+

+

    +

    +
  • L — completely to the left of the reference element (right +margin of the calendar aligned to the left margin of the element).

    +

    +

    +
  • l — to the left of the element but may overlap it (left margin +of the calendar aligned to the left margin of the element).

    +

    +

    +
  • c — horizontally centered to the element. Might overlap it, +depending on the vertical alignment.

    +

    +

    +
  • r — to the right of the element but may overlap it (right +margin of the calendar aligned to the right margin of the element).

    +

    +

    +
  • R — completely to the right of the element (left margin of the +calendar aligned to the right margin of the element).

    +

    +

    +

+

+

+ +

Default values

If the “align” parameter is missing the calendar will choose +“Bl”. This resembles the behavior of older versions (prior to +0.9.3) which did not support custom alignment.

+

+

+ +

4.3.12  Calendar.setDate

+

+Receives a JavaScript Date object. Sets the given date in the +calendar. If the calendar is visible the new date is displayed immediately.

+

+

+
calendar.setDate(new Date()); // go today
+

+

+

+ +

4.3.13  Calendar.setMondayFirst

+

+Changes the first day of week. If the parameter is true then Monday +will be the first day of week, otherwise Sunday.

+

+

+
calendar.setMondayFirst(false); // use Sunday
+

+

+

+ +

4.3.14  Calendar.parseDate

+

+Use this function to parse a date given as string and to move the calendar to +that date.

+

+The algorithm tries to parse the date according to the format that was +previously set with Calendar.setDateFormat; if that fails, it still +tries to get some valid date out of it (it doesn’t read your thoughts, though).

+

+

+
calendar.parseDate("2003/07/06");
+

+

+

+ +

4.3.15  Calendar.setRange

+

+Sets the range of years that are allowed in the calendar. Synopsis:

+

+

+
calendar.setRange(1970, 2050);
+

+

+

+ +

5  Side effects

The calendar code was intentionally embedded in an object to make it have as +less as possible side effects. However, there are some—not harmful, after +all. Here is a list of side effects; you can count they already happened after +calendar.js was loaded.

+

+

+

    +

    +
  1. The global variable window.calendar will be set to null. This +variable is used by the calendar code, especially when doing drag & drop for +moving the calendar. In the future I might get rid of it, but for now it +didn’t harm anyone.

    +

    +

    +
  2. The JavaScript Date object is modified. We add some properties +and functions that are very useful to our calendar. It made more sense to add +them directly to the Date object than to the calendar itself. +Complete list:

    +

    +

    +

      +

      +
    1. Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); +

      +
    2. Date.SECOND = 1000 /* milliseconds */; +

      +
    3. Date.MINUTE = 60 * Date.SECOND; +

      +
    4. Date.HOUR = 60 * Date.MINUTE; +

      +
    5. Date.DAY = 24 * Date.HOUR; +

      +
    6. Date.WEEK = 7 * Date.DAY;

      +

      +

      +
    7. Date.prototype.getMonthDays(month) — returns the number of days +of the given month, or of the current date object if no month was given.

      +

      +

      +
    8. Date.prototype.getWeekNumber() — returns the week number of the +date in the current object.

      +

      +

      +
    9. Date.prototype.equalsTo(other_date) — compare the current date +object with other_date and returns true if the dates are +equal. It ignores time.

      +

      +

      +
    10. Date.prototype.print(format) — returns a string with the +current date object represented in the given format. It implements the format +specified in section 4.3.5.

      +

      +

      +

    +

    +

    +

+

+

+ +

6  Credits

The following people either sponsored, donated money to the project or bought +commercial licenses (listed in reverse chronological order). Your name could +be here too! If you wish to sponsor the project (for instance request a +feature and pay me for implementing it) or donate some money please +please contact me at mishoo@infoiasi.ro.

+

+

+

+

+

+
+ +Thank you!
+— mishoo@infoiasi.ro +
+

+

+

+

1 +by the term “widget” I understand a single element of user interface. +But that’s in Linux world. For those that did lots of Windows +programming the term “control” might be more familiar +

+

2 people report that the calendar does +not work with IE5/Mac. I don’t have access to a Macintosh, +therefore—sorry—I can’t fix it.

+

3 under Opera 7 the calendar still lacks some functionality, such as +keyboard navigation; also Opera doesn’t seem to allow disabling text +selection when one drags the mouse on the page; despite all that, the +calendar is still highly functional under Opera 7 and looks as good as +in other supported browsers.

+

4 user interface

+
+
+Last modified: Wed, Nov 5, 2003, 7:30 pm
+HTML conversion by TeX2page 4r8f
+
+ + diff --git a/www/extras/calendar/doc/reference.pdf b/www/extras/calendar/doc/reference.pdf new file mode 100644 index 000000000..31d569803 Binary files /dev/null and b/www/extras/calendar/doc/reference.pdf differ diff --git a/www/extras/calendar/img.gif b/www/extras/calendar/img.gif new file mode 100644 index 000000000..e15a4a444 Binary files /dev/null and b/www/extras/calendar/img.gif differ diff --git a/www/extras/calendar/index.html b/www/extras/calendar/index.html new file mode 100644 index 000000000..2690fb3b6 --- /dev/null +++ b/www/extras/calendar/index.html @@ -0,0 +1,326 @@ + + + + + + + +The Coolest DHTML Calendar - Online Demo + + + + + + + + + + + + + + + + + + + + + + + + + +

jscalendar-0.9.5 +"Your favorite time, bis"

+ +

+

+Theme:
+winter +| +summer +| +green +
+win2k-1 +| +win2k-2 +| +win2k-cold-1 +| +win2k-cold-2 +
+system + +
+Release notes. +
+Set it up in minutes: + popup calendar, + flat calendar. +
+Documentation: + HTML, + PDF. +
+Donate! Keep me on it! Details on the Calendar website. +

+ +
+ +
+ + + + + + + + +
+ +
+
+Popup examples +
+ +
+ +Date #1: %Y-%m-%d [%W] %H:%M -- single +click
+ +Date #2: %a, %b %e, %Y [%I:%M%p] +-- double click + +

+ + +this select should hide when the calendar is above it. +

+ +Date #3: %d/%m/%Y +-- single click +
+ +Date #4: %A, %B %e, %Y -- +double click + +
+ +

This is release 0.9.5. Works on MSIE/Win 5.0 or better, Opera 7, +Mozilla, Netscape 6.x, 7.0 and all other Gecko-s, Konqueror and Safari.

+ +

You can click on "Mo"/"Su" (first day name displayed) to +change the first day of week (Sunday/Monday) (since 0.8 this is also mapped +on the "-" button in the top-left corner). Use the navigation buttons +("<<", "<", "Today", ">", ">>") to move to the prev/next +year/month. Keep the mouse button pressed for a short time over one of +these buttons to get a menu for faster selection. You can drag the "status +bar" (that's where the tooltips appear) or title bar (that's where the +currently selected month/year shows up) to move the whole calendar.

+ +

Keyboard navigation

+ +

Starting with version 0.9.2, you can also use the keyboard to select +dates (only for popup calendars; does not work with Opera +7 or Konqueror/Safari). The following keys are available:

+ +
    + +
  • , , + , -- select date
  • +
  • CTRL + , + -- select month
  • +
  • CTRL + , + -- select year
  • +
  • SPACE -- go to today date
  • +
  • ENTER -- accept the currently selected date
  • +
  • ESC -- cancel selection
  • + +
+ +
+ +
+ Flat calendar +
+ +

A non-popup version will appear below as soon + as the page is loaded. Note that it doesn't show the week number.

+ + +
+
+ +

+ The example above uses the setDisabledHandler() member function + to setup a handler that would only enable days withing a range of 10 days, + forward or backward, from the current date. +

+ + + +
+ +
dynarch.com 2002-2003
+Author: Mihai +Bazon
Distributed under the GNU LGPL.
+ +

If you use this script on a public page it +would be nice if you would let me +know.

+ + diff --git a/www/extras/calendar/lang/calendar-af.js b/www/extras/calendar/lang/calendar-af.js new file mode 100644 index 000000000..aeda58197 --- /dev/null +++ b/www/extras/calendar/lang/calendar-af.js @@ -0,0 +1,39 @@ +// ** I18N Afrikaans +Calendar._DN = new Array +("Sondag", + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrydag", + "Saterdag", + "Sondag"); +Calendar._MN = new Array +("Januarie", + "Februarie", + "Maart", + "April", + "Mei", + "Junie", + "Julie", + "Augustus", + "September", + "Oktober", + "November", + "Desember"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Verander eerste dag van die week"; +Calendar._TT["PREV_YEAR"] = "Vorige jaar (hou vir keuselys)"; +Calendar._TT["PREV_MONTH"] = "Vorige maand (hou vir keuselys)"; +Calendar._TT["GO_TODAY"] = "Gaan na vandag"; +Calendar._TT["NEXT_MONTH"] = "Volgende maand (hou vir keuselys)"; +Calendar._TT["NEXT_YEAR"] = "Volgende jaar (hou vir keuselys)"; +Calendar._TT["SEL_DATE"] = "Kies datum"; +Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te skuif"; +Calendar._TT["PART_TODAY"] = " (vandag)"; +Calendar._TT["MON_FIRST"] = "Vertoon Maandag eerste"; +Calendar._TT["SUN_FIRST"] = "Display Sunday first"; +Calendar._TT["CLOSE"] = "Close"; +Calendar._TT["TODAY"] = "Today"; diff --git a/www/extras/calendar/lang/calendar-br.js b/www/extras/calendar/lang/calendar-br.js new file mode 100644 index 000000000..d7db4b46e --- /dev/null +++ b/www/extras/calendar/lang/calendar-br.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado", + "Domingo"); +Calendar._MN = new Array +("Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Altera primeiro dia da semana"; +Calendar._TT["PREV_YEAR"] = "Ano anterior(hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Mês anterior (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Hoje"; +Calendar._TT["NEXT_MONTH"] = "Mês seguinte (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "ano seguinte (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Seleciona uma data"; +Calendar._TT["DRAG_TO_MOVE"] = "Arrasta calendário"; +Calendar._TT["PART_TODAY"] = " (hoje)"; +Calendar._TT["MON_FIRST"] = "Inicia na segunda-feira"; +Calendar._TT["SUN_FIRST"] = "Inicia no domingo"; +Calendar._TT["CLOSE"] = "Fechar"; +Calendar._TT["TODAY"] = "Hoje"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; +Calendar._TT["TT_DATE_FORMAT"] = "DD, dd de MM de y"; + +Calendar._TT["WK"] = "sem"; diff --git a/www/extras/calendar/lang/calendar-ca.js b/www/extras/calendar/lang/calendar-ca.js new file mode 100644 index 000000000..3498d7659 --- /dev/null +++ b/www/extras/calendar/lang/calendar-ca.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Diumenge", + "Dilluns", + "Dimarts", + "Dimecres", + "Dijous", + "Divendres", + "Dissabte", + "Diumenge"); +Calendar._MN = new Array +("Gener", + "Febrer", + "Març", + "Abril", + "Maig", + "Juny", + "Juliol", + "Agost", + "Setembre", + "Octubre", + "Novembre", + "Desembre"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Canvia el primer dia de la setmana"; +Calendar._TT["PREV_YEAR"] = "Any anterior (mantenir per a menu)"; +Calendar._TT["PREV_MONTH"] = "Mes anterior (mantenir per a menu)"; +Calendar._TT["GO_TODAY"] = "Anar a avui"; +Calendar._TT["NEXT_MONTH"] = "Mes següent (mantenir per a menu)"; +Calendar._TT["NEXT_YEAR"] = "Any següent (mantenir per a menu)"; +Calendar._TT["SEL_DATE"] = "Seleccionar data"; +Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar per a moure"; +Calendar._TT["PART_TODAY"] = " (avui)"; +Calendar._TT["MON_FIRST"] = "Mostrar dilluns primer"; +Calendar._TT["SUN_FIRST"] = "Mostrar diumenge primer"; +Calendar._TT["CLOSE"] = "Tancar"; +Calendar._TT["TODAY"] = "Avui"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-yy"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "sem"; diff --git a/www/extras/calendar/lang/calendar-cs-win.js b/www/extras/calendar/lang/calendar-cs-win.js new file mode 100644 index 000000000..b34213f50 --- /dev/null +++ b/www/extras/calendar/lang/calendar-cs-win.js @@ -0,0 +1,34 @@ +/* + calendar-cs-win.js + language: Czech + encoding: windows-1250 + author: Lubos Jerabek (xnet@seznam.cz) +*/ + +// ** I18N +Calendar._DN = new Array('Nedìle','Pondìlí','Úterý','Støeda','Ètvrtek','Pátek','Sobota','Nedìle'); +Calendar._DN3 = new Array('Ne','Po','Út','St','Èt','Pá','So','Ne'); +Calendar._MN = new Array('Leden','Únor','Bøezen','Duben','Kvìten','Èerven','Èervenec','Srpen','Záøí','Øíjen','Listopad','Prosinec'); +Calendar._MN3 = new Array('Led','Úno','Bøe','Dub','Kvì','Èrv','Èvc','Srp','Záø','Øíj','Lis','Pro'); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Zmìna prvního dne v týdnu"; +Calendar._TT["PREV_YEAR"] = "Pøedchozí rok (pøidrž pro menu)"; +Calendar._TT["PREV_MONTH"] = "Pøedchozí mìsíc (pøidrž pro menu)"; +Calendar._TT["GO_TODAY"] = "Dnešní datum"; +Calendar._TT["NEXT_MONTH"] = "Další mìsíc (pøidrž pro menu)"; +Calendar._TT["NEXT_YEAR"] = "Další rok (pøidrž pro menu)"; +Calendar._TT["SEL_DATE"] = "Vyber datum"; +Calendar._TT["DRAG_TO_MOVE"] = "Chy a táhni, pro pøesun"; +Calendar._TT["PART_TODAY"] = " (dnes)"; +Calendar._TT["MON_FIRST"] = "Ukaž jako první Pondìlí"; +Calendar._TT["SUN_FIRST"] = "Ukaž jako první Nedìli"; +Calendar._TT["CLOSE"] = "Zavøít"; +Calendar._TT["TODAY"] = "Dnes"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy"; +Calendar._TT["TT_DATE_FORMAT"] = "DD, 5.MM y"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-da.js b/www/extras/calendar/lang/calendar-da.js new file mode 100644 index 000000000..f0fff7e74 --- /dev/null +++ b/www/extras/calendar/lang/calendar-da.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Søndag", + "Mandag", + "Tirsdag", + "Onsdag", + "Torsdag", + "Fredag", + "Lørdag", + "Søndag"); +Calendar._MN = new Array +("January", + "Februar", + "Marts", + "April", + "Maj", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "December"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Skift første ugedag"; +Calendar._TT["PREV_YEAR"] = "Ét år tilbage (hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Én måned tilbage (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Gå til i dag"; +Calendar._TT["NEXT_MONTH"] = "Én måned frem (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "Ét år frem (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Vælg dag"; +Calendar._TT["DRAG_TO_MOVE"] = "Træk vinduet"; +Calendar._TT["PART_TODAY"] = " (i dag)"; +Calendar._TT["MON_FIRST"] = "Vis mandag først"; +Calendar._TT["SUN_FIRST"] = "Vis søndag først"; +Calendar._TT["CLOSE"] = "Luk vinduet"; +Calendar._TT["TODAY"] = "I dag"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D d. M, y"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-de.js b/www/extras/calendar/lang/calendar-de.js new file mode 100644 index 000000000..de41860ec --- /dev/null +++ b/www/extras/calendar/lang/calendar-de.js @@ -0,0 +1,100 @@ +// Author: Hartwig Weinkauf h_weinkauf@gmx.de +// Überarbeitet und fehlende Texte hinzugefügt von Gerhard Neinert (gerhard at neinert punkt de) +// Feel free to use / redistribute under the GNU LGPL. +// ** I18N + +// short day names +Calendar._SDN = new Array +("So", + "Mo", + "Di", + "Mi", + "Do", + "Fr", + "Sa", + "So"); + +// full day names +Calendar._DN = new Array +("Sonntag", + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag", + "Sonntag"); + +// short day names only use 2 letters instead of 3 +Calendar._SDN_len = 2; + +// full month names +Calendar._MN = new Array +("Januar", + "Februar", + "März", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember"); + +// short month names +Calendar._SMN = new Array +("Jan", + "Feb", + "Mär", + "Apr", + "Mai", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Dez"); + +// tooltips +Calendar._TT = {}; + +Calendar._TT["ABOUT"] = +"DHTML Datum/Zeit Selector\n" + +"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) +"Donwload neueste Version: http://dynarch.com/mishoo/calendar.epl\n" + +"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + +"\n\n" + +"Datumsauswahl:\n" + +"- Jahr auswählen mit \xab und \xbb\n" + +"- Monat auswählen mit " + String.fromCharCode(0x2039) + " und " + String.fromCharCode(0x203a) + "\n" + +"- Für Auswahl aus Liste Maustaste gedrückt halten."; + +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Zeit wählen:\n" + +"- Stunde/Minute weiter mit Mausklick\n" + +"- Stunde/Minute zurück mit Shift-Mausklick\n" + +"- oder für schnellere Auswahl nach links oder rechts ziehen."; + + +Calendar._TT["TOGGLE"] = "Ersten Tag der Woche waehlen"; +Calendar._TT["PREV_YEAR"] = "Jahr zurück (halten -> Auswahlmenue)"; +Calendar._TT["PREV_MONTH"] = "Monat zurück (halten -> Auswahlmenue)"; +Calendar._TT["GO_TODAY"] = "Gehe zum heutigen Datum"; +Calendar._TT["NEXT_MONTH"] = "Monat vor (halten -> Auswahlmenue)"; +Calendar._TT["NEXT_YEAR"] = "Jahr vor (halten -> Auswahlmenue)"; +Calendar._TT["SEL_DATE"] = "Datum auswaehlen"; +Calendar._TT["DRAG_TO_MOVE"] = "Klicken und halten um zu verschieben"; +Calendar._TT["PART_TODAY"] = " (heute)"; +Calendar._TT["MON_FIRST"] = "Wochenanzeige mit Montag beginnen"; +Calendar._TT["SUN_FIRST"] = "Wochenanzeige mit Sonntag beginnen"; +Calendar._TT["CLOSE"] = "Schliessen"; +Calendar._TT["TODAY"] = "Heute"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; +Calendar._TT["TT_DATE_FORMAT"] = "Datum auswählen"; + +Calendar._TT["WK"] = "KW"; diff --git a/www/extras/calendar/lang/calendar-du.js b/www/extras/calendar/lang/calendar-du.js new file mode 100644 index 000000000..220044805 --- /dev/null +++ b/www/extras/calendar/lang/calendar-du.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Zondag", + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrijdag", + "Zaterdag", + "Zondag"); +Calendar._MN = new Array +("Januari", + "Februari", + "Maart", + "April", + "Mei", + "Juni", + "Juli", + "Augustus", + "September", + "Oktober", + "November", + "December"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Toggle startdag van de week"; +Calendar._TT["PREV_YEAR"] = "Vorig jaar (indrukken voor menu)"; +Calendar._TT["PREV_MONTH"] = "Vorige month (indrukken voor menu)"; +Calendar._TT["GO_TODAY"] = "Naar Vandaag"; +Calendar._TT["NEXT_MONTH"] = "Volgende Maand (indrukken voor menu)"; +Calendar._TT["NEXT_YEAR"] = "Volgend jaar (indrukken voor menu)"; +Calendar._TT["SEL_DATE"] = "Selecteer datum"; +Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te verplaatsen"; +Calendar._TT["PART_TODAY"] = " (vandaag)"; +Calendar._TT["MON_FIRST"] = "Toon Maandag eerst"; +Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst"; +Calendar._TT["CLOSE"] = "Sluiten"; +Calendar._TT["TODAY"] = "Vandaag"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-el.js b/www/extras/calendar/lang/calendar-el.js new file mode 100644 index 000000000..2fe938792 --- /dev/null +++ b/www/extras/calendar/lang/calendar-el.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("ÊõñéáêÞ", + "ÄåõôÝñá", + "Ôñßôç", + "ÔåôÜñôç", + "ÐÝìðôç", + "ÐáñáóêåõÞ", + "ÓÜââáôï", + "ÊõñéáêÞ"); +Calendar._MN = new Array +("ÉáíïõÜñéïò", + "ÖåâñïõÜñéïò", + "ÌÜñôéïò", + "Áðñßëéïò", + "ÌÜúïò", + "Éïýíéïò", + "Éïýëéïò", + "Áýãïõóôïò", + "ÓåðôÝìâñéïò", + "Ïêôþâñéïò", + "ÍïÝìâñéïò", + "ÄåêÝìâñéïò"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "ÌðÜñá ðñþôçò çìÝñáò ôçò åâäïìÜäáò"; +Calendar._TT["PREV_YEAR"] = "Ðñïçã. Ýôïò (êñáôÞóôå ãéá ôï ìåíïý)"; +Calendar._TT["PREV_MONTH"] = "Ðñïçã. ìÞíáò (êñáôÞóôå ãéá ôï ìåíïý)"; +Calendar._TT["GO_TODAY"] = "ÓÞìåñá"; +Calendar._TT["NEXT_MONTH"] = "Åðüìåíïò ìÞíáò (êñáôÞóôå ãéá ôï ìåíïý)"; +Calendar._TT["NEXT_YEAR"] = "Åðüìåíï Ýôïò (êñáôÞóôå ãéá ôï ìåíïý)"; +Calendar._TT["SEL_DATE"] = "ÅðéëÝîôå çìåñïìçíßá"; +Calendar._TT["DRAG_TO_MOVE"] = "Óýñôå ãéá íá ìåôáêéíÞóåôå"; +Calendar._TT["PART_TODAY"] = " (óÞìåñá)"; +Calendar._TT["MON_FIRST"] = "ÅìöÜíéóç ÄåõôÝñáò ðñþôá"; +Calendar._TT["SUN_FIRST"] = "ÅìöÜíéóç ÊõñéáêÞò ðñþôá"; +Calendar._TT["CLOSE"] = "Êëåßóéìï"; +Calendar._TT["TODAY"] = "ÓÞìåñá"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; +Calendar._TT["TT_DATE_FORMAT"] = "D, d M"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-en.js b/www/extras/calendar/lang/calendar-en.js new file mode 100644 index 000000000..e9291e1b7 --- /dev/null +++ b/www/extras/calendar/lang/calendar-en.js @@ -0,0 +1,114 @@ +// ** I18N + +// Calendar EN language +// Author: Mihai Bazon, +// Encoding: any +// Distributed under the same terms as the calendar itself. + +// For translators: please use UTF-8 if possible. We strongly believe that +// Unicode is the answer to a real internationalized world. Also please +// include your contact information in the header, as can be seen above. + +// full day names +Calendar._DN = new Array +("Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday"); + +// Please note that the following array of short day names (and the same goes +// for short month names, _SMN) isn't absolutely necessary. We give it here +// for exemplification on how one can customize the short day names, but if +// they are simply the first N letters of the full name you can simply say: +// +// Calendar._SDN_len = N; // short day name length +// Calendar._SMN_len = N; // short month name length +// +// If N = 3 then this is not needed either since we assume a value of 3 if not +// present, to be compatible with translation files that were written before +// this feature. + +// short day names +Calendar._SDN = new Array +("Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat", + "Sun"); + +// full month names +Calendar._MN = new Array +("January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December"); + +// short month names +Calendar._SMN = new Array +("Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "About the calendar"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) +"For latest version visit: http://dynarch.com/mishoo/calendar.epl\n" + +"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + +"\n\n" + +"Date selection:\n" + +"- Use the \xab, \xbb buttons to select year\n" + +"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + +"- Hold mouse button on any of the above buttons for faster selection."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Time selection:\n" + +"- Click on any of the time parts to increase it\n" + +"- or Shift-click to decrease it\n" + +"- or click and drag for faster selection."; + +Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Go Today"; +Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Select date"; +Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; +Calendar._TT["PART_TODAY"] = " (today)"; +Calendar._TT["MON_FIRST"] = "Display Monday first"; +Calendar._TT["SUN_FIRST"] = "Display Sunday first"; +Calendar._TT["CLOSE"] = "Close"; +Calendar._TT["TODAY"] = "Today"; +Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; +Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-es.js b/www/extras/calendar/lang/calendar-es.js new file mode 100644 index 000000000..a8d52ea39 --- /dev/null +++ b/www/extras/calendar/lang/calendar-es.js @@ -0,0 +1,114 @@ +// ** I18N + +// Calendar EN language +// Author: Mihai Bazon, +// Encoding: any +// Distributed under the same terms as the calendar itself. + +// For translators: please use UTF-8 if possible. We strongly believe that +// Unicode is the answer to a real internationalized world. Also please +// include your contact information in the header, as can be seen above. + +// full day names +Calendar._DN = new Array +("Domingo", + "Lunes", + "Martes", + "Miircoles", + "Jueves", + "Viernes", + "Sabado", + "Domingo"); + +// Please note that the following array of short day names (and the same goes +// for short month names, _SMN) isn't absolutely necessary. We give it here +// for exemplification on how one can customize the short day names, but if +// they are simply the first N letters of the full name you can simply say: +// +// Calendar._SDN_len = N; // short day name length +// Calendar._SMN_len = N; // short month name length +// +// If N = 3 then this is not needed either since we assume a value of 3 if not +// present, to be compatible with translation files that were written before +// this feature. + +// short day names +Calendar._SDN = new Array +("Dom", + "Lun", + "Mar", + "Mii", + "Jue", + "Vie", + "Sab", + "Dom"); + +// full month names +Calendar._MN = new Array +("Enero", + "Febrero", + "Marzo", + "Abril", + "Mayo", + "Junio", + "Julio", + "Agosto", + "Septiembre", + "Octubre", + "Noviembre", + "Diciembre"); + +// short month names +Calendar._SMN = new Array +("Ene", + "Feb", + "Mar", + "Abr", + "May", + "Jun", + "Jul", + "Ago", + "Sep", + "Oct", + "Nov", + "Dic"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "Acerca del calendario"; + +Calendar._TT["ABOUT"] = +"Selector DHTML de Fecha/Hora\n" + +"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) +"Para conseguir la zltima versisn visite: http://dynarch.com/mishoo/calendar.epl\n" + +"Distribuido bajo licencia GNU LGPL. Visite http://gnu.org/licenses/lgpl.html para mas detalles." + +"\n\n" + +"Seleccisn de fecha:\n" + +"- Use los botones \xab, \xbb para seleccionar el aqo\n" + +"- Use los botones " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" + +"- Mantenga pulsado el ratsn en cualquiera de estos botones para una seleccisn rapida."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Seleccisn de hora:\n" + +"- Pulse en cualquiera de las partes de la hora para incrementarla\n" + +"- s pulse las mayzsculas mientras hace clic para decrementarla\n" + +"- s haga clic y arrastre el ratsn para una seleccisn mas rapida."; + +Calendar._TT["PREV_YEAR"] = "Aqo anterior (mantener para menu)"; +Calendar._TT["PREV_MONTH"] = "Mes anterior (mantener para menu)"; +Calendar._TT["GO_TODAY"] = "Ir a hoy"; +Calendar._TT["NEXT_MONTH"] = "Mes siguiente (mantener para menu)"; +Calendar._TT["NEXT_YEAR"] = "Aqo siguiente (mantener para menu)"; +Calendar._TT["SEL_DATE"] = "Seleccionar fecha"; +Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar para mover"; +Calendar._TT["PART_TODAY"] = " (hoy)"; +Calendar._TT["MON_FIRST"] = "Mostrar lunes primero"; +Calendar._TT["SUN_FIRST"] = "Mostrar domingo primero"; +Calendar._TT["CLOSE"] = "Cerrar"; +Calendar._TT["TODAY"] = "Hoy"; +Calendar._TT["TIME_PART"] = "(Mayzscula-)Clic o arrastre para cambiar valor"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; +Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y"; + +Calendar._TT["WK"] = "sem"; diff --git a/www/extras/calendar/lang/calendar-fr.js b/www/extras/calendar/lang/calendar-fr.js new file mode 100644 index 000000000..aa15d5043 --- /dev/null +++ b/www/extras/calendar/lang/calendar-fr.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Dimanche", + "Lundi", + "Mardi", + "Mercredi", + "Jeudi", + "Vendredi", + "Samedi", + "Dimanche"); +Calendar._MN = new Array +("Janvier", + "Février", + "Mars", + "Avril", + "Mai", + "Juin", + "Juillet", + "Août", + "Septembre", + "Octobre", + "Novembre", + "Décembre"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Changer le premier jour de la semaine"; +Calendar._TT["PREV_YEAR"] = "Année préc. (maintenir pour menu)"; +Calendar._TT["PREV_MONTH"] = "Mois préc. (maintenir pour menu)"; +Calendar._TT["GO_TODAY"] = "Atteindre date du jour"; +Calendar._TT["NEXT_MONTH"] = "Mois suiv. (maintenir pour menu)"; +Calendar._TT["NEXT_YEAR"] = "Année suiv. (maintenir pour menu)"; +Calendar._TT["SEL_DATE"] = "Choisir une date"; +Calendar._TT["DRAG_TO_MOVE"] = "Déplacer"; +Calendar._TT["PART_TODAY"] = " (Aujourd'hui)"; +Calendar._TT["MON_FIRST"] = "Commencer par lundi"; +Calendar._TT["SUN_FIRST"] = "Commencer par dimanche"; +Calendar._TT["CLOSE"] = "Fermer"; +Calendar._TT["TODAY"] = "Aujourd'hui"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-hr-utf8.js b/www/extras/calendar/lang/calendar-hr-utf8.js new file mode 100644 index 000000000..d569cfd92 --- /dev/null +++ b/www/extras/calendar/lang/calendar-hr-utf8.js @@ -0,0 +1,49 @@ +/* Croatian language file for the DHTML Calendar version 0.9.2 +* Author Krunoslav Zubrinic , June 2003. +* Feel free to use this script under the terms of the GNU Lesser General +* Public License, as long as you do not remove or alter this notice. +*/ +Calendar._DN = new Array +("Nedjelja", + "Ponedjeljak", + "Utorak", + "Srijeda", + "ÄŒetvrtak", + "Petak", + "Subota", + "Nedjelja"); +Calendar._MN = new Array +("SijeÄanj", + "VeljaÄa", + "Ožujak", + "Travanj", + "Svibanj", + "Lipanj", + "Srpanj", + "Kolovoz", + "Rujan", + "Listopad", + "Studeni", + "Prosinac"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Promjeni dan s kojim poÄinje tjedan"; +Calendar._TT["PREV_YEAR"] = "Prethodna godina (dugi pritisak za meni)"; +Calendar._TT["PREV_MONTH"] = "Prethodni mjesec (dugi pritisak za meni)"; +Calendar._TT["GO_TODAY"] = "Idi na tekući dan"; +Calendar._TT["NEXT_MONTH"] = "Slijedeći mjesec (dugi pritisak za meni)"; +Calendar._TT["NEXT_YEAR"] = "Slijedeća godina (dugi pritisak za meni)"; +Calendar._TT["SEL_DATE"] = "Izaberite datum"; +Calendar._TT["DRAG_TO_MOVE"] = "Pritisni i povuci za promjenu pozicije"; +Calendar._TT["PART_TODAY"] = " (today)"; +Calendar._TT["MON_FIRST"] = "Prikaži ponedjeljak kao prvi dan"; +Calendar._TT["SUN_FIRST"] = "Prikaži nedjelju kao prvi dan"; +Calendar._TT["CLOSE"] = "Zatvori"; +Calendar._TT["TODAY"] = "Danas"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; +Calendar._TT["TT_DATE_FORMAT"] = "DD, dd.mm.y"; + +Calendar._TT["WK"] = "Tje"; \ No newline at end of file diff --git a/www/extras/calendar/lang/calendar-hr.js b/www/extras/calendar/lang/calendar-hr.js new file mode 100644 index 000000000..6c27f60c4 Binary files /dev/null and b/www/extras/calendar/lang/calendar-hr.js differ diff --git a/www/extras/calendar/lang/calendar-hu.js b/www/extras/calendar/lang/calendar-hu.js new file mode 100644 index 000000000..64b38d621 --- /dev/null +++ b/www/extras/calendar/lang/calendar-hu.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Vasárnap", + "Hétfõ", + "Kedd", + "Szerda", + "Csütörtök", + "Péntek", + "Szombat", + "Vasárnap"); +Calendar._MN = new Array +("január", + "február", + "március", + "április", + "május", + "június", + "július", + "augusztus", + "szeptember", + "október", + "november", + "december"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "A hét elsõ napjának beállítása"; +Calendar._TT["PREV_YEAR"] = "Elõzõ év (tartsa nyomva a menühöz)"; +Calendar._TT["PREV_MONTH"] = "Elõzõ hónap (tartsa nyomva a menühöz)"; +Calendar._TT["GO_TODAY"] = "Mai napra ugrás"; +Calendar._TT["NEXT_MONTH"] = "Köv. hónap (tartsa nyomva a menühöz)"; +Calendar._TT["NEXT_YEAR"] = "Köv. év (tartsa nyomva a menühöz)"; +Calendar._TT["SEL_DATE"] = "Válasszon dátumot"; +Calendar._TT["DRAG_TO_MOVE"] = "Húzza a mozgatáshoz"; +Calendar._TT["PART_TODAY"] = " (ma)"; +Calendar._TT["MON_FIRST"] = "Hétfõ legyen a hét elsõ napja"; +Calendar._TT["SUN_FIRST"] = "Vasárnap legyen a hét elsõ napja"; +Calendar._TT["CLOSE"] = "Bezár"; +Calendar._TT["TODAY"] = "Ma"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "M d, D"; + +Calendar._TT["WK"] = "hét"; diff --git a/www/extras/calendar/lang/calendar-it.js b/www/extras/calendar/lang/calendar-it.js new file mode 100644 index 000000000..bb43449fc --- /dev/null +++ b/www/extras/calendar/lang/calendar-it.js @@ -0,0 +1,79 @@ +// ** I18N +Calendar._DN = new Array +("Domenica", + "Lunedì", + "Martedì", + "Mercoledì", + "Giovedì", + "Venerdì", + "Sabato", + "Domenica"); +Calendar._MN = new Array +("Gennaio", + "Febbraio", + "Marzo", + "Aprile", + "Maggio", + "Giugno", + "Luglio", + "Agosto", + "Settembre", + "Ottobre", + "Novembre", + "Dicembre"); + +// short month names +Calendar._SMN = new Array +("Gen", + "Feb", + "Mar", + "Apr", + "Mag", + "Giu", + "Lug", + "Ago", + "Set", + "Ott", + "Nov", + "Dic"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "a proposito del calendario"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) +"Per le ultime versioni vai a: http://dynarch.com/mishoo/calendar.epl\n" + +"Distribuito su licenza GNU LGPL. Vedi http://gnu.org/licenses/lgpl.html per i dettagli." + +"\n\n" + +"selezione della data:\n" + +"- Usa i bottoni \xab, \xbb per selezionare l'anno\n" + +"- Usa i bottoni " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per selezionare il mese\n" + +"- Utilizza il mouse per una selezione rapida."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"selezione dell'ora:\n" + +"- Clicca sull'ora visualizzata per aumentarla\n" + +"- o Shift-click per diminuirla\n" + +"- o click a trascina per la selezione rapida."; + + +Calendar._TT["TOGGLE"] = "Modifica il primo giorno della settimana"; +Calendar._TT["PREV_YEAR"] = "Anno prec. (tieni premuto per menu)"; +Calendar._TT["PREV_MONTH"] = "Mese prec. (tieni premuto per menu)"; +Calendar._TT["GO_TODAY"] = "Vai a oggi"; +Calendar._TT["NEXT_MONTH"] = "Mese succ. (tieni premuto per menu)"; +Calendar._TT["NEXT_YEAR"] = "Anno succ. (tieni premuto per menu)"; +Calendar._TT["SEL_DATE"] = "Seleziona data"; +Calendar._TT["DRAG_TO_MOVE"] = "Trascina per spostare"; +Calendar._TT["PART_TODAY"] = " (oggi)"; +Calendar._TT["MON_FIRST"] = "Parti da lunedì"; +Calendar._TT["SUN_FIRST"] = "Parti da domenica"; +Calendar._TT["CLOSE"] = "Chiudi"; +Calendar._TT["TODAY"] = "Oggi"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; +Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b "; + +Calendar._TT["WK"] = "Setti"; diff --git a/www/extras/calendar/lang/calendar-jp.js b/www/extras/calendar/lang/calendar-jp.js new file mode 100644 index 000000000..2dbec7552 --- /dev/null +++ b/www/extras/calendar/lang/calendar-jp.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("“ú", + "ŒŽ", + "‰Î", + "…", + "–Ø", + "‹à", + "“y", + "“ú"); +Calendar._MN = new Array +("1ŒŽ", + "2ŒŽ", + "3ŒŽ", + "4ŒŽ", + "5ŒŽ", + "6ŒŽ", + "7ŒŽ", + "8ŒŽ", + "9ŒŽ", + "10ŒŽ", + "11ŒŽ", + "12ŒŽ"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "T‚Ìʼn‚Ì—j“ú‚ðØ‚è‘Ö‚¦"; +Calendar._TT["PREV_YEAR"] = "‘O”N"; +Calendar._TT["PREV_MONTH"] = "‘OŒŽ"; +Calendar._TT["GO_TODAY"] = "¡“ú"; +Calendar._TT["NEXT_MONTH"] = "—‚ŒŽ"; +Calendar._TT["NEXT_YEAR"] = "—‚”N"; +Calendar._TT["SEL_DATE"] = "“ú•t‘I‘ð"; +Calendar._TT["DRAG_TO_MOVE"] = "ƒEƒBƒ“ƒhƒE‚̈ړ®"; +Calendar._TT["PART_TODAY"] = " (¡“ú)"; +Calendar._TT["MON_FIRST"] = "ŒŽ—j“ú‚ðæ“ª‚É"; +Calendar._TT["SUN_FIRST"] = "“ú—j“ú‚ðæ“ª‚É"; +Calendar._TT["CLOSE"] = "•‚¶‚é"; +Calendar._TT["TODAY"] = "¡“ú"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "M d“ú (D)"; + +Calendar._TT["WK"] = "T"; diff --git a/www/extras/calendar/lang/calendar-nl.js b/www/extras/calendar/lang/calendar-nl.js new file mode 100644 index 000000000..2ddc68be4 --- /dev/null +++ b/www/extras/calendar/lang/calendar-nl.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Zondag", + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrijdag", + "Zaterdag", + "Zondag"); +Calendar._MN = new Array +("Januari", + "Februari", + "Maart", + "April", + "Mei", + "Juni", + "Juli", + "Augustus", + "September", + "Oktober", + "November", + "December"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Selecteer de eerste week-dag"; +Calendar._TT["PREV_YEAR"] = "Vorig jaar (ingedrukt voor menu)"; +Calendar._TT["PREV_MONTH"] = "Vorige maand (ingedrukt voor menu)"; +Calendar._TT["GO_TODAY"] = "Ga naar Vandaag"; +Calendar._TT["NEXT_MONTH"] = "Volgende maand (ingedrukt voor menu)"; +Calendar._TT["NEXT_YEAR"] = "Volgend jaar (ingedrukt voor menu)"; +Calendar._TT["SEL_DATE"] = "Selecteer datum"; +Calendar._TT["DRAG_TO_MOVE"] = "Klik en sleep om te verplaatsen"; +Calendar._TT["PART_TODAY"] = " (vandaag)"; +Calendar._TT["MON_FIRST"] = "Toon Maandag eerst"; +Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst"; +Calendar._TT["CLOSE"] = "Sluiten"; +Calendar._TT["TODAY"] = "Vandaag"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; +Calendar._TT["TT_DATE_FORMAT"] = "DD, d MM"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-no.js b/www/extras/calendar/lang/calendar-no.js new file mode 100644 index 000000000..3325e34a4 --- /dev/null +++ b/www/extras/calendar/lang/calendar-no.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Søndag", + "Mandag", + "Tirsdag", + "Onsdag", + "Torsdag", + "Fredag", + "Lørdag", + "Søndag"); +Calendar._MN = new Array +("Januar", + "Februar", + "Mars", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Desember"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Skift første ukedag"; +Calendar._TT["PREV_YEAR"] = "Et år tilbake (hold for meny)"; +Calendar._TT["PREV_MONTH"] = "En måned tilbake (hold for meny)"; +Calendar._TT["GO_TODAY"] = "Gå til i dag"; +Calendar._TT["NEXT_MONTH"] = "En måned fram (hold for meny)"; +Calendar._TT["NEXT_YEAR"] = "Et år fram (hold for meny)"; +Calendar._TT["SEL_DATE"] = "Velg dag"; +Calendar._TT["DRAG_TO_MOVE"] = "Dra vinduet"; +Calendar._TT["PART_TODAY"] = " (i dag)"; +Calendar._TT["MON_FIRST"] = "Vis mandag først"; +Calendar._TT["SUN_FIRST"] = "Vis søndag først"; +Calendar._TT["CLOSE"] = "Lukk vinduet"; +Calendar._TT["TODAY"] = "I dag"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D d. M, y"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-pl.js b/www/extras/calendar/lang/calendar-pl.js new file mode 100644 index 000000000..c1ef76929 --- /dev/null +++ b/www/extras/calendar/lang/calendar-pl.js @@ -0,0 +1,46 @@ +// Polish| dariush pietrzak, eyck@ghost.anime.pl +// ** I18N +Calendar._DN = new Array +("Niedziela", + "Poniedzia³ek", + "Wtorek", + "¦roda", + "Czwartek", + "Pi±tek", + "Sobota", + "Niedziela"); +Calendar._MN = new Array +("Styczeñ", + "Luty", + "Marzec", + "Kwiecieñ", + "Maj", + "Czerwiec", + "Lipiec", + "Sierpieñ", + "Wrzesieñ", + "Pa¼dziernik", + "Listopad", + "Grudzieñ"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Zmieñ pierwszy dzieñ tygodnia"; +Calendar._TT["PREV_YEAR"] = "Poprzedni rok (przytrzymaj dla menu)"; +Calendar._TT["PREV_MONTH"] = "Poprzedni miesi±c (przytrzymaj dla menu)"; +Calendar._TT["GO_TODAY"] = "Id¼ do dzisiaj"; +Calendar._TT["NEXT_MONTH"] = "Nastêpny miesi±c (przytrzymaj dla menu)"; +Calendar._TT["NEXT_YEAR"] = "Nastêpny rok (przytrzymaj dla menu)"; +Calendar._TT["SEL_DATE"] = "Wybierz datê"; +Calendar._TT["DRAG_TO_MOVE"] = "Przeci±gnij by przesun±æ"; +Calendar._TT["PART_TODAY"] = " (dzisiaj)"; +Calendar._TT["MON_FIRST"] = "Wy¶wietl poniedzia³ek jako pierwszy"; +Calendar._TT["SUN_FIRST"] = "Wy¶wietl niedzielê jako pierwsz±"; +Calendar._TT["CLOSE"] = "Zamknij"; +Calendar._TT["TODAY"] = "Dzisiaj"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "wk"; diff --git a/www/extras/calendar/lang/calendar-pt.js b/www/extras/calendar/lang/calendar-pt.js new file mode 100644 index 000000000..1184dfa6d --- /dev/null +++ b/www/extras/calendar/lang/calendar-pt.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado", + "Domingo"); +Calendar._MN = new Array +("Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Trocar o primeiro dia da semana"; +Calendar._TT["PREV_YEAR"] = "Ano Anterior (mantenha para menu)"; +Calendar._TT["PREV_MONTH"] = "Mês Anterior (mantenha para menu)"; +Calendar._TT["GO_TODAY"] = "Ir para hoje"; +Calendar._TT["NEXT_MONTH"] = "Próximo Mês (mantenha para menu)"; +Calendar._TT["NEXT_YEAR"] = "Próximo Ano (mantenha para menu)"; +Calendar._TT["SEL_DATE"] = "Escolha Data"; +Calendar._TT["DRAG_TO_MOVE"] = "Arraste para mover"; +Calendar._TT["PART_TODAY"] = " (hoje)"; +Calendar._TT["MON_FIRST"] = "Mostrar Segunda primeiro"; +Calendar._TT["SUN_FIRST"] = "Mostrar Domingo primeiro"; +Calendar._TT["CLOSE"] = "Fechar"; +Calendar._TT["TODAY"] = "Hoje"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "a-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "sm"; diff --git a/www/extras/calendar/lang/calendar-ro.js b/www/extras/calendar/lang/calendar-ro.js new file mode 100644 index 000000000..e7baa7bbb --- /dev/null +++ b/www/extras/calendar/lang/calendar-ro.js @@ -0,0 +1,65 @@ +// ** I18N +Calendar._DN = new Array +("Duminică", + "Luni", + "MarÅ£i", + "Miercuri", + "Joi", + "Vineri", + "Sâmbătă", + "Duminică"); +Calendar._SDN_len = 2; +Calendar._MN = new Array +("Ianuarie", + "Februarie", + "Martie", + "Aprilie", + "Mai", + "Iunie", + "Iulie", + "August", + "Septembrie", + "Octombrie", + "Noiembrie", + "Decembrie"); + +// tooltips +Calendar._TT = {}; + +Calendar._TT["INFO"] = "Despre calendar"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) +"Pentru ultima versiune vizitaÅ£i: http://dynarch.com/mishoo/calendar.epl\n" + +"Distribuit sub GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + +"\n\n" + +"SelecÅ£ia datei:\n" + +"- FolosiÅ£i butoanele \xab, \xbb pentru a selecta anul\n" + +"- FolosiÅ£i butoanele " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pentru a selecta luna\n" + +"- TineÅ£i butonul mouse-ului apăsat pentru selecÅ£ie mai rapidă."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"SelecÅ£ia orei:\n" + +"- Click pe ora sau minut pentru a mări valoarea cu 1\n" + +"- Sau Shift-Click pentru a micÅŸora valoarea cu 1\n" + +"- Sau Click ÅŸi drag pentru a selecta mai repede."; + +Calendar._TT["PREV_YEAR"] = "Anul precedent (lung pt menu)"; +Calendar._TT["PREV_MONTH"] = "Luna precedentă (lung pt menu)"; +Calendar._TT["GO_TODAY"] = "Data de azi"; +Calendar._TT["NEXT_MONTH"] = "Luna următoare (lung pt menu)"; +Calendar._TT["NEXT_YEAR"] = "Anul următor (lung pt menu)"; +Calendar._TT["SEL_DATE"] = "Selectează data"; +Calendar._TT["DRAG_TO_MOVE"] = "Trage pentru a miÅŸca"; +Calendar._TT["PART_TODAY"] = " (astăzi)"; +Calendar._TT["MON_FIRST"] = "Prima zi -> Luni"; +Calendar._TT["SUN_FIRST"] = "Prima zi -> Duminică"; +Calendar._TT["CLOSE"] = "ÃŽnchide"; +Calendar._TT["TODAY"] = "Astăzi"; +Calendar._TT["TIME_PART"] = "(Shift-)Click sau drag pentru a selecta"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; +Calendar._TT["TT_DATE_FORMAT"] = "%A, %d %B"; + +Calendar._TT["WK"] = "spt"; diff --git a/www/extras/calendar/lang/calendar-ru.js b/www/extras/calendar/lang/calendar-ru.js new file mode 100644 index 000000000..459cec579 --- /dev/null +++ b/www/extras/calendar/lang/calendar-ru.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Âîñêðåñåíüå", + "Ïîíåäåëüíèê", + "Âòîðíèê", + "Ñðåäà", + "×åòâåðã", + "Ïÿòíèöà", + "Ñóááîòà", + "Âîñêðåñåíüå"); +Calendar._MN = new Array +("ßíâàðü", + "Ôåâðàëü", + "Ìàðò", + "Àïðåëü", + "Ìàé", + "Èþíü", + "Èþëü", + "Àâãóñò", + "Ñåíòÿáðü", + "Îêòÿáðü", + "Íîÿáðü", + "Äåêàáðü"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Ñìåíèòü äåíü íà÷àëà íåäåëè (ÏÍ/ÂÑ)"; +Calendar._TT["PREV_YEAR"] = "Ïðåä. ãîä (óäåðæèâàòü äëÿ ìåíþ)"; +Calendar._TT["PREV_MONTH"] = "Ïðåä. ìåñÿö (óäåðæèâàòü äëÿ ìåíþ)"; +Calendar._TT["GO_TODAY"] = "Íà ñåãîäíÿ"; +Calendar._TT["NEXT_MONTH"] = "Ñëåä. ìåñÿö (óäåðæèâàòü äëÿ ìåíþ)"; +Calendar._TT["NEXT_YEAR"] = "Ñëåä. ãîä (óäåðæèâàòü äëÿ ìåíþ)"; +Calendar._TT["SEL_DATE"] = "Âûáðàòü äàòó"; +Calendar._TT["DRAG_TO_MOVE"] = "Ïåðåòàùèòü"; +Calendar._TT["PART_TODAY"] = " (ñåãîäíÿ)"; +Calendar._TT["MON_FIRST"] = "Ïîêàçàòü ïîíåäåëüíèê ïåðâûì"; +Calendar._TT["SUN_FIRST"] = "Ïîêàçàòü âîñêðåñåíüå ïåðâûì"; +Calendar._TT["CLOSE"] = "Çàêðûòü"; +Calendar._TT["TODAY"] = "Ñåãîäíÿ"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "íåä"; diff --git a/www/extras/calendar/lang/calendar-sk.js b/www/extras/calendar/lang/calendar-sk.js new file mode 100644 index 000000000..9b2dfc31c --- /dev/null +++ b/www/extras/calendar/lang/calendar-sk.js @@ -0,0 +1,99 @@ +// ** I18N + +// Calendar SK language +// Author: Peter Valach (pvalach@gmx.net) +// Encoding: utf-8 +// Last update: 2003/10/29 +// Distributed under the same terms as the calendar itself. + +// full day names +Calendar._DN = new Array +("NedeÄľa", + "Pondelok", + "Utorok", + "Streda", + "Ĺ tvrtok", + "Piatok", + "Sobota", + "NedeÄľa"); + +// short day names +Calendar._SDN = new Array +("Ned", + "Pon", + "Uto", + "Str", + "Ĺ tv", + "Pia", + "Sob", + "Ned"); + +// full month names +Calendar._MN = new Array +("Január", + "Február", + "Marec", + "AprĂ­l", + "Máj", + "JĂşn", + "JĂşl", + "August", + "September", + "OktĂłber", + "November", + "December"); + +// short month names +Calendar._SMN = new Array +("Jan", + "Feb", + "Mar", + "Apr", + "Máj", + "JĂşn", + "JĂşl", + "Aug", + "Sep", + "Okt", + "Nov", + "Dec"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "O kalendári"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2003\n" + +"PoslednĂş verziu nájdete na: http://dynarch.com/mishoo/calendar.epl\n" + +"DistribuovanĂ© pod GNU LGPL. ViÄŹ http://gnu.org/licenses/lgpl.html pre detaily." + +"\n\n" + +"VÄ‚Ëber dátumu:\n" + +"- PouĹľite tlaÄŤidlá \xab, \xbb pre vÄ‚Ëber roku\n" + +"- PouĹľite tlaÄŤidlá " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pre vÄ‚Ëber mesiaca\n" + +"- Ak ktorĂ©koÄľvek z tÄ‚Ëchto tlaÄŤidiel podržíte dlhšie, zobrazĂ­ sa rÄ‚Ëchly vÄ‚Ëber."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"VÄ‚Ëber ÄŤasu:\n" + +"- Kliknutie na niektorĂş poloĹľku ÄŤasu ju zvĂ˚i\n" + +"- Shift-klik ju znĂ­Ĺľi\n" + +"- Ak podržíte tlaÄŤĂ­tko stlaÄŤenĂ©, posĂşvanĂ­m menĂ­te hodnotu."; + +Calendar._TT["PREV_YEAR"] = "PredošlÄ‚Ë rok (podrĹľte pre menu)"; +Calendar._TT["PREV_MONTH"] = "PredošlÄ‚Ë mesiac (podrĹľte pre menu)"; +Calendar._TT["GO_TODAY"] = "PrejsĹĄ na dnešok"; +Calendar._TT["NEXT_MONTH"] = "Nasl. mesiac (podrĹľte pre menu)"; +Calendar._TT["NEXT_YEAR"] = "Nasl. rok (podrĹľte pre menu)"; +Calendar._TT["SEL_DATE"] = "ZvoÄľte dátum"; +Calendar._TT["DRAG_TO_MOVE"] = "PodrĹľanĂ­m tlaÄŤĂ­tka zmenĂ­te polohu"; +Calendar._TT["PART_TODAY"] = " (dnes)"; +Calendar._TT["MON_FIRST"] = "ZobraziĹĄ pondelok ako prvÄ‚Ë"; +Calendar._TT["SUN_FIRST"] = "ZobraziĹĄ nedeÄľu ako prvĂş"; +Calendar._TT["CLOSE"] = "ZavrieĹĄ"; +Calendar._TT["TODAY"] = "Dnes"; +Calendar._TT["TIME_PART"] = "(Shift-)klik/ĹĄahanie zmenĂ­ hodnotu"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "$d. %m. %Y"; +Calendar._TT["TT_DATE_FORMAT"] = "%a, %e. %b"; + +Calendar._TT["WK"] = "tÄ‚ËĹľ"; diff --git a/www/extras/calendar/lang/calendar-sp.js b/www/extras/calendar/lang/calendar-sp.js new file mode 100644 index 000000000..14a356d37 --- /dev/null +++ b/www/extras/calendar/lang/calendar-sp.js @@ -0,0 +1,45 @@ +// ** I18N +Calendar._DN = new Array +("Domingo", + "Lunes", + "Martes", + "Miercoles", + "Jueves", + "Viernes", + "Sabado", + "Domingo"); +Calendar._MN = new Array +("Enero", + "Febrero", + "Marzo", + "Abril", + "Mayo", + "Junio", + "Julio", + "Augosto", + "Septiembre", + "Octubrer", + "Noviembre", + "Diciembre"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Primer dia de la semana"; +Calendar._TT["PREV_YEAR"] = "Año anterior (Presione para menu)"; +Calendar._TT["PREV_MONTH"] = "Mes Anterior (Presione para menu)"; +Calendar._TT["GO_TODAY"] = "Ir a Hoy"; +Calendar._TT["NEXT_MONTH"] = "Mes Siguiente (Presione para menu)"; +Calendar._TT["NEXT_YEAR"] = "Año Siguiente (Presione para menu)"; +Calendar._TT["SEL_DATE"] = "Seleccione fecha"; +Calendar._TT["DRAG_TO_MOVE"] = "Arrastre y mueva"; +Calendar._TT["PART_TODAY"] = " (Hoy)"; +Calendar._TT["MON_FIRST"] = "Lunes Primero"; +Calendar._TT["SUN_FIRST"] = "Domingo Primero"; +Calendar._TT["CLOSE"] = "Cerrar"; +Calendar._TT["TODAY"] = "Hoy"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-yy"; +Calendar._TT["TT_DATE_FORMAT"] = "D, d M"; + +Calendar._TT["WK"] = "Smn"; diff --git a/www/extras/calendar/lang/calendar-sv.js b/www/extras/calendar/lang/calendar-sv.js new file mode 100644 index 000000000..dc0a0729e --- /dev/null +++ b/www/extras/calendar/lang/calendar-sv.js @@ -0,0 +1,93 @@ +// ** I18N + +// Calendar SV language (Swedish, svenska) +// Author: Mihai Bazon, +// Translation team: +// Translator: Leonard Norrgård +// Last translator: Leonard Norrgård +// Encoding: iso-latin-1 +// Distributed under the same terms as the calendar itself. + +// For translators: please use UTF-8 if possible. We strongly believe that +// Unicode is the answer to a real internationalized world. Also please +// include your contact information in the header, as can be seen above. + +// full day names +Calendar._DN = new Array +("söndag", + "måndag", + "tisdag", + "onsdag", + "torsdag", + "fredag", + "lördag", + "söndag"); + +// Please note that the following array of short day names (and the same goes +// for short month names, _SMN) isn't absolutely necessary. We give it here +// for exemplification on how one can customize the short day names, but if +// they are simply the first N letters of the full name you can simply say: +// +// Calendar._SDN_len = N; // short day name length +// Calendar._SMN_len = N; // short month name length +// +// If N = 3 then this is not needed either since we assume a value of 3 if not +// present, to be compatible with translation files that were written before +// this feature. +Calendar._SDN_len = 2; +Calendar._SMN_len = 3; + +// full month names +Calendar._MN = new Array +("januari", + "februari", + "mars", + "april", + "maj", + "juni", + "juli", + "augusti", + "september", + "oktober", + "november", + "december"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "Om kalendern"; + +Calendar._TT["ABOUT"] = +"DHTML Datum/tid-väljare\n" + +"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) +"För senaste version gå till: http://dynarch.com/mishoo/calendar.epl\n" + +"Distribueras under GNU LGPL. Se http://gnu.org/licenses/lgpl.html för detaljer." + +"\n\n" + +"Val av datum:\n" + +"- Använd knapparna \xab, \xbb för att välja år\n" + +"- Använd knapparna " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " för att välja månad\n" + +"- Håll musknappen nedtryckt på någon av ovanstående knappar för snabbare val."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Val av tid:\n" + +"- Klicka på en del av tiden för att öka den delen\n" + +"- eller skift-klicka för att minska den\n" + +"- eller klicka och drag för snabbare val."; + +Calendar._TT["PREV_YEAR"] = "Föregående år (håll för menu)"; +Calendar._TT["PREV_MONTH"] = "Föregående månad (håll för menu)"; +Calendar._TT["GO_TODAY"] = "Gå till dagens datum"; +Calendar._TT["NEXT_MONTH"] = "Följande månad (håll för menu)"; +Calendar._TT["NEXT_YEAR"] = "Följande år (håll för menu)"; +Calendar._TT["SEL_DATE"] = "Välj datum"; +Calendar._TT["DRAG_TO_MOVE"] = "Drag för att flytta"; +Calendar._TT["PART_TODAY"] = " (idag)"; +Calendar._TT["MON_FIRST"] = "Visa måndag först"; +Calendar._TT["SUN_FIRST"] = "Visa söndag först"; +Calendar._TT["CLOSE"] = "Stäng"; +Calendar._TT["TODAY"] = "Idag"; +Calendar._TT["TIME_PART"] = "(Skift-)klicka eller drag för att ändra tid"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; +Calendar._TT["TT_DATE_FORMAT"] = "%A %d %b %Y"; + +Calendar._TT["WK"] = "vecka"; diff --git a/www/extras/calendar/lang/calendar-tr.js b/www/extras/calendar/lang/calendar-tr.js new file mode 100644 index 000000000..2164687fb --- /dev/null +++ b/www/extras/calendar/lang/calendar-tr.js @@ -0,0 +1,58 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// Turkish Translation by Nuri AKMAN +// Location: Ankara/TURKEY +// e-mail : nuriakman@hotmail.com +// Date : April, 9 2003 +// +// Note: if Turkish Characters does not shown on you screen +// please include falowing line your html code: +// +// +// +////////////////////////////////////////////////////////////////////////////////////////////// + +// ** I18N +Calendar._DN = new Array +("Pazar", + "Pazartesi", + "Salý", + "Çarþamba", + "Perþembe", + "Cuma", + "Cumartesi", + "Pazar"); +Calendar._MN = new Array +("Ocak", + "Þubat", + "Mart", + "Nisan", + "Mayýs", + "Haziran", + "Temmuz", + "Aðustos", + "Eylül", + "Ekim", + "Kasým", + "Aralýk"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Haftanýn ilk gününü kaydýr"; +Calendar._TT["PREV_YEAR"] = "Önceki Yýl (Menü için basýlý tutunuz)"; +Calendar._TT["PREV_MONTH"] = "Önceki Ay (Menü için basýlý tutunuz)"; +Calendar._TT["GO_TODAY"] = "Bugün'e git"; +Calendar._TT["NEXT_MONTH"] = "Sonraki Ay (Menü için basýlý tutunuz)"; +Calendar._TT["NEXT_YEAR"] = "Sonraki Yýl (Menü için basýlý tutunuz)"; +Calendar._TT["SEL_DATE"] = "Tarih seçiniz"; +Calendar._TT["DRAG_TO_MOVE"] = "Taþýmak için sürükleyiniz"; +Calendar._TT["PART_TODAY"] = " (bugün)"; +Calendar._TT["MON_FIRST"] = "Takvim Pazartesi gününden baþlasýn"; +Calendar._TT["SUN_FIRST"] = "Takvim Pazar gününden baþlasýn"; +Calendar._TT["CLOSE"] = "Kapat"; +Calendar._TT["TODAY"] = "Bugün"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; +Calendar._TT["TT_DATE_FORMAT"] = "d MM y, DD"; + +Calendar._TT["WK"] = "Hafta"; diff --git a/www/extras/calendar/lang/calendar-zh.js b/www/extras/calendar/lang/calendar-zh.js new file mode 100644 index 000000000..c0c545600 --- /dev/null +++ b/www/extras/calendar/lang/calendar-zh.js @@ -0,0 +1,45 @@ +// ** Translated by ATang ** I18N +Calendar._DN = new Array +("ÐÇÆÚÈÕ", + "ÐÇÆÚÒ»", + "ÐÇÆÚ¶þ", + "ÐÇÆÚÈý", + "ÐÇÆÚËÄ", + "ÐÇÆÚÎå", + "ÐÇÆÚÁù", + "ÐÇÆÚÈÕ"); +Calendar._MN = new Array +("Ò»ÔÂ", + "¶þÔÂ", + "ÈýÔÂ", + "ËÄÔÂ", + "ÎåÔÂ", + "ÁùÔÂ", + "ÆßÔÂ", + "°ËÔÂ", + "¾ÅÔÂ", + "Ê®ÔÂ", + "ʮһÔÂ", + "Ê®¶þÔÂ"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Çл»ÖÜ¿ªÊ¼µÄÒ»Ìì"; +Calendar._TT["PREV_YEAR"] = "ÉÏÒ»Äê (°´×¡³ö²Ëµ¥)"; +Calendar._TT["PREV_MONTH"] = "ÉÏÒ»Ô (°´×¡³ö²Ëµ¥)"; +Calendar._TT["GO_TODAY"] = "µ½½ñÈÕ"; +Calendar._TT["NEXT_MONTH"] = "ÏÂÒ»Ô (°´×¡³ö²Ëµ¥)"; +Calendar._TT["NEXT_YEAR"] = "ÏÂÒ»Äê (°´×¡³ö²Ëµ¥)"; +Calendar._TT["SEL_DATE"] = "Ñ¡ÔñÈÕÆÚ"; +Calendar._TT["DRAG_TO_MOVE"] = "Í϶¯"; +Calendar._TT["PART_TODAY"] = " (½ñÈÕ)"; +Calendar._TT["MON_FIRST"] = "Ê×ÏÈÏÔʾÐÇÆÚÒ»"; +Calendar._TT["SUN_FIRST"] = "Ê×ÏÈÏÔʾÐÇÆÚÈÕ"; +Calendar._TT["CLOSE"] = "¹Ø±Õ"; +Calendar._TT["TODAY"] = "½ñÈÕ"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; + +Calendar._TT["WK"] = "ÖÜ"; diff --git a/www/extras/calendar/menuarrow.gif b/www/extras/calendar/menuarrow.gif new file mode 100644 index 000000000..ed2dee0e6 Binary files /dev/null and b/www/extras/calendar/menuarrow.gif differ diff --git a/www/extras/calendar/release-notes.html b/www/extras/calendar/release-notes.html new file mode 100644 index 000000000..147cf33ae --- /dev/null +++ b/www/extras/calendar/release-notes.html @@ -0,0 +1,233 @@ + + + + jscalendar release notes + + + + + +

jscalendar release notes

+ +

This release compiled at Wednesday, 5 Nov 2003 (19:30).

+ +

0.9.5

+ +

+ 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. +

+ +

Other changes:

+ +
    + +
  • + Fixed an annoying bug that prevented the calendar to display + correctly when it was configured for an input field inside a + scrolling area. Many thanks to Ian Barrack (Simban.com) who pointed it up and + donated quote some money for the Calendar project! +
  • + +
  • + All examples use UTF-8 now; the translations may not be all + up-to-date, but I strongly 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 not + anymore 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. +
  • + +
  • + Fixed small bug in the documentation (one footnote didn't appear + where it should have). +
  • + +
  • + Updated translations: DE, ES, HU, IT, RO. Thanks to everyone who + sent translations! +
  • + +
+ +

0.9.4

+ +

New stuff

+ +
    + +
  • Supports time selection. Yes. ;-) This work has been largely + sponsored by Himanshukumar Shah (thank you!). See + the docs and example files for details on how to setup.
  • + +
  • Easy to link 2 or more fields by using the new + onUpdate parameter of Calendar.setup. 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 simple-1.html.
  • + +
  • Other Calendar.setup low-level parameters, for those + wanting to have the complete control: onSelect and + onClose. The handlers are called when something is + selected in the calendar or when the calendar is closed.
  • + +
  • 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.
  • + +
  • Implemented a nice way to make some dates "special" (look + different). Specifically, the setDisabledHandler method + was replaced with the more general setDateStatusHandler + method (the old one is still available for backwards compatibility but + will be removed). More details about this in the + documentation. Also see simple-3.html + for a live sample.
  • + +
  • Date parsing and formatting engine is now rewritten and supports a + subset of strftime 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. + Please note that the new engine is not compatibile with older + calendar releases!
  • + +
  • 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.
  • + +
  • "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 + exactly as it should.. But they're going to be fixed, + right? ;-)
  • + +
  • 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.
  • + +
+ +

Translation files

+ +

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 ;-).

+ +

Specifically, they need the following:

+ +
    + +
  • Correct date format, according with the new format specifiers + introduced in 0.9.4. Details about the available format specifiers + in the documentation
  • + +
  • Short day or month names, if required. 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 ;-)
  • + +
  • We have some new texts that shows short usage information as well + as copyright information.
  • + +
+ +

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.

+ +

Bug status

+ +

Check SourceForge, + I didn't keep track. However, there were a lot of bugfixes.

+ +

0.9.3

+ +

New stuff

+ +
    + +
  • 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.
  • + +
  • 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 + showAtElement.
  • + +
  • Added dateClicked 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 need to check this for "single-click" calendars and + only close/hide the calendar if it's true.
  • + +
  • Full documentation in HTML + and PDF format is now available in the + distribution archive.
  • + +
  • New language definition files: HU, HR, PT, ZH. Thanks those who + submitted!
  • + +
+ +

Bug status

+ +

This covers only those bugs that have been reported at SourceForge.

+ +
    + +
  1. #703,238 — fixed
  2. +
  3. #703,814 — fixed
  4. +
  5. #716,777 — closed (was fixed already in 0.9.2-1)
  6. +
  7. #723,335 — fixed
  8. +
  9. #715,122 — feature request; implemented.
  10. +
  11. #721,206 — fixed (added "refresh()" function)
  12. +
  13. #721,833 — fixed (bug concerning the "yy" format + parsing)
  14. +
  15. #721,833 — won't fix (we won't set the time to + midnight; time might actually be useful when we implement support + for time selection). + +
+ +
+
Mihai Bazon
+ + +Last modified on Wed Oct 29 02:37:07 2003 + + + + + + diff --git a/www/extras/calendar/simple-1.html b/www/extras/calendar/simple-1.html new file mode 100644 index 000000000..b53a5e62f --- /dev/null +++ b/www/extras/calendar/simple-1.html @@ -0,0 +1,241 @@ + + + + + +Simple calendar setups [popup calendar] + + + + + + + + + + + + + + + + + +

DHTML Calendar — for the impatient

+ +
+

+ This page lists some common setups for the popup calendar. In + order to see how to do any of them please see the source of this + page. For each example it's structured like this: there's the + <form> that contains the input field, and following there is + the JavaScript snippet that setups that form. An example of + flat calendar is available in another page. +

+

+ 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 that impatient, ;-) complete documenation is + available. +

+
+ + + +
+ +

Basic setup: one input per calendar. Clicking in the input field +activates the calendar. The date format is "%m/%d/%Y %I:%M %p". The +calendar defaults to "single-click mode".

+ +

The example below has been updated to show you how to create "linked" +fields. Basically, when some field is filled with a date, the other +is updated so that the difference between them remains one week. The +property useful here is "onUpdate".

+ +
+ + +
+ + + + + +
+ +

Input field with a trigger button. Clicking the button activates +the calendar. Note that this one needs double-click (singleClick parameter +is explicitely set to false).

+ +
+ +
+ + + + + +
+ +

Input field with a trigger image. Note that the Calendar.setup +function doesn't care if the trigger is a button, image, or anything else. +Also in this example we setup a different alignment, just to show how it's +done. The input field is read-only (that is set from HTML).

+ +
+ + + +
+
+ + + + + +
+ +

Hidden field, display area. The calendar now puts the date into 2 +elements: one is an input field of type "hidden"—so that the user +can't directly see or modify it— and one is a <span> element in +which the date is displayed. Note that if the trigger is not specified the +calendar will use the displayArea (or inputField as in the first example). +The display area can have it's own format. This is useful if, for instance, +we need to store one format in the database (thus pass it in the input +field) but we wanna show a friendlier format to the end-user.

+ +
+ +
+ +

Your birthday: + Click to open date selector.

+ + + + + +
+ +

Hidden field, display area, trigger image. Very similar to the +previous example. The difference is that we also have a trigger image.

+ +
+ +
+ +

Your birthday: -- not entered -- .

+ + + + + +
+ +

Hidden field, display area. Very much like the previous examples, +but we now disable some dates (all weekends, that is, Saturdays and +Sundays).

+ +
+ +
+ +

Your birthday: + Click to open date selector.

+ + + + + + diff --git a/www/extras/calendar/simple-2.html b/www/extras/calendar/simple-2.html new file mode 100644 index 000000000..b55bae85b --- /dev/null +++ b/www/extras/calendar/simple-2.html @@ -0,0 +1,108 @@ + + + + + +Simple calendar setup [flat calendar] + + + + + + + + + + + + + + + + + +

DHTML Calendar — for the impatient

+ +
+

+ This page demonstrates how to setup a flat calendar. Examples of + popup calendars are available in another page. +

+

+ 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 that impatient, ;-) complete documenation is + available. +

+
+ + + +
+ +
+ + + +

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".

+ +

Following there is the code that has been used to create this calendar. +You can find the full description of the Calendar.setup() function +in the calendar documenation.

+ +
<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>
+ + + diff --git a/www/extras/calendar/simple-3.html b/www/extras/calendar/simple-3.html new file mode 100644 index 000000000..c096e872b --- /dev/null +++ b/www/extras/calendar/simple-3.html @@ -0,0 +1,130 @@ + + + + + +Simple calendar setup [flat calendar] + + + + + + + + + + + + + + + + + + + +

DHTML Calendar — for the impatient

+ +
+

+ This page demonstrates how to setup a flat calendar. Examples of + popup calendars are available in another page. +

+

+ 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 that impatient, ;-) complete documenation is + available. +

+
+ + + +
+ +
+ + + +

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".

+ +

Following there is the code that has been used to create this calendar. +You can find the full description of the Calendar.setup() function +in the calendar documenation.

+ +
<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>
+ + + diff --git a/www/extras/calendar/simple-4.html b/www/extras/calendar/simple-4.html new file mode 100644 index 000000000..db84b28da --- /dev/null +++ b/www/extras/calendar/simple-4.html @@ -0,0 +1,330 @@ + + + + +Simple calendar setups [popup calendar] + + + + + + + + + + + + + + + + + + + + + +
+ +

DHTML Calendar — for the impatient

+ +
+

+ This page lists some common setups for the popup calendar. In + order to see how to do any of them please see the source of this + page. For each example it's structured like this: there's the + <form> that contains the input field, and following there is + the JavaScript snippet that setups that form. An example of + flat calendar is available in another page. +

+

+ 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 that impatient, ;-) complete documenation is + available. +

+
+ + + +
+ +

Basic setup: one input per calendar. Clicking in the input field +activates the calendar. The date format is "%m/%d/%Y %I:%M %p". The +calendar defaults to "single-click mode".

+ +

The example below has been updated to show you how to create "linked" +fields. Basically, when some field is filled with a date, the other +is updated so that the difference between them remains one week. The +property useful here is "onUpdate".

+ +
+ + +
+ + + + + +
+ +

Input field with a trigger button. Clicking the button activates +the calendar. Note that this one needs double-click (singleClick parameter +is explicitely set to false).

+ +
+ +
+ + + + + +
+ +

Input field with a trigger image. Note that the Calendar.setup +function doesn't care if the trigger is a button, image, or anything else. +Also in this example we setup a different alignment, just to show how it's +done. The input field is read-only (that is set from HTML).

+ +
+ + + +
+
+ + + + + +
+ +

Hidden field, display area. The calendar now puts the date into 2 +elements: one is an input field of type "hidden"—so that the user +can't directly see or modify it— and one is a <span> element in +which the date is displayed. Note that if the trigger is not specified the +calendar will use the displayArea (or inputField as in the first example). +The display area can have it's own format. This is useful if, for instance, +we need to store one format in the database (thus pass it in the input +field) but we wanna show a friendlier format to the end-user.

+ +
+ +
+ +

Your birthday: + Click to open date selector.

+ + + + + +
+ +

Hidden field, display area, trigger image. Very similar to the +previous example. The difference is that we also have a trigger image.

+ +
+ +
+ +

Your birthday: -- not entered -- .

+ + + + + +
+ +

Hidden field, display area. Very much like the previous examples, +but we now disable some dates (all weekends, that is, Saturdays and +Sundays).

+ +
+ +
+ +

Your birthday: + Click to open date selector.

+ + +
+
+ +
+ + + diff --git a/www/extras/coolmenus/advanced_example1.html b/www/extras/coolmenus/advanced_example1.html new file mode 100644 index 000000000..d712efd40 --- /dev/null +++ b/www/extras/coolmenus/advanced_example1.html @@ -0,0 +1,279 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+Click me to show a menu +
+
+
+
+
+
+
+ + + + diff --git a/www/extras/coolmenus/advanced_example2.html b/www/extras/coolmenus/advanced_example2.html new file mode 100644 index 000000000..0aef47386 --- /dev/null +++ b/www/extras/coolmenus/advanced_example2.html @@ -0,0 +1,274 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+Click me to show a menu +
+
+
+
+
+
+
+ + + + diff --git a/www/extras/coolmenus/advanced_example3.html b/www/extras/coolmenus/advanced_example3.html new file mode 100644 index 000000000..8f7a98ed3 --- /dev/null +++ b/www/extras/coolmenus/advanced_example3.html @@ -0,0 +1,253 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + +
+
+
+
+
+
+
+Change alignment of the first menu:
+bottom +top +
+
+Change the rows of the second item:
+On +Off + + + + diff --git a/www/extras/coolmenus/advanced_example4.html b/www/extras/coolmenus/advanced_example4.html new file mode 100644 index 000000000..d437a4d21 --- /dev/null +++ b/www/extras/coolmenus/advanced_example4.html @@ -0,0 +1,270 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+Hide subs example:
+Turn of sub "0sub10" - oM.m['0sub10'].hide=1 +
+Turn on sub "0sub10" - oM.m['0sub10'].hide=0 +
+Turn of sub "0sub11" - oM.m['0sub11'].hide=1 +
+Turn on sub "0sub11" - oM.m['0sub11'].hide=0 +
+
+
+
+ + diff --git a/www/extras/coolmenus/advanced_exampleDTD.html b/www/extras/coolmenus/advanced_exampleDTD.html new file mode 100644 index 000000000..69c590144 --- /dev/null +++ b/www/extras/coolmenus/advanced_exampleDTD.html @@ -0,0 +1,167 @@ + + + + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + +

+
+
+
+ +Small example using a "proper" xhtml DTD. +
+
+This will work in all browsers but NS4 will not show a proper background-color because of the missing layer-background-color +in the stylesheet. +
+
+The output for NS4 will not validate because of the name attribute added to images, but then again NS4 is the only +browser that will see that (NS4 also writes all tags upper-case when you use document.write). You +can see the NS4 output here. +
+
+The output for Opera will not validate either because I have to use border="0" on the image tags. You can +see the Opera output here +
+
+The output for IE4 and IE5 (and IE5.5 and IE6 if you don't use dom creation) will validate. +You can see the output here +
+
+The output for the DOM browsers is a little worse to display. But if your using mozilla you can try the dom +inspector on this page. +
+
+You have to view source on the source pages to see the actual output. The script creation is removed so +the pages will not work. +

+ + diff --git a/www/extras/coolmenus/asp-example/jscript.asp b/www/extras/coolmenus/asp-example/jscript.asp new file mode 100644 index 000000000..ca9de095d --- /dev/null +++ b/www/extras/coolmenus/asp-example/jscript.asp @@ -0,0 +1,272 @@ +<%@LANGUAGE = "JAVASCRIPT"%> + + + ASP example + + + + + +
+
+
+ +This file is a simple example of how to get items from a access database. I code ASP with javascript so the example +is in javascript. I will make a more advances example later. The table consist of 4 simple columns: +
+
+menuID - Autonumber - the id of the menuitem.
+mName - String - The menu name
+mLink - String - The link
+parent - Number - a recursive relation to menuID.
+
+
+This can rather easily be converted to control the entire menu and by adding a server-side admin *anyone* could +easily change the menu. The new menumaker that I will hopefully soon have time +to make will probably use something like this. +
+
+On this site I use a similar approuch, the only difference is that I make a js file everytime I update, that way +I don't have to get the items from the database on every visit. I will try and make an example like that as well later. +
+
+ +ASP source-code: +
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ASP CODE START - READING ITEMS FROM THE DATABASE
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+function readItemsFromDatabase(){
+  //The path to your database:
+  var db ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("menu.mdb")
+  
+  var q = "SELECT menuID,mName,mLink,parent from tblMenu ORDER BY parent,menuID ASC"
+  
+  var rs=Server.CreateObject("ADODB.Recordset")
+  rs.CacheSize = 25; 		// Cache data fetching
+  rs.CursorType = 3
+  rs.LockType = 3
+  
+  //Opening database --- --
+  rs.Open(q,db)
+  
+  //Now using getRows because that's so sexy :}
+  if(!rs.EOF){
+    var rsarr = rs.GetRows();
+    rsarr = rsarr.toArray();
+    var cols= rs.Fields.Count //Setting how much to add to row each for
+  }else var rsarr=new Array()
+  
+  //Closing database, we don't need it anymore - we have the info in the array
+  rs.close()
+  rs = null
+  
+  var menuID,mName,mLink,parent
+  
+  for(row=0;row<rsarr.length;row+=cols){ //Looping rows
+    //Setting variables 
+    menuID = "m" + rsarr[row]
+    mName = rsarr[row+1]
+    mLink = String(rsarr[row+2])
+    if(mLink=="null") mLink="" 
+    parent = rsarr[row+3]
+    if(parent!=0) parent = "m" + parent
+    else parent=""
+    //Making menu item
+    Response.write("oCMenu.makeMenu('"+menuID+"','"+parent+"','"+mName+"','"+mLink+"')\n")
+  }
+}
+//Calling function
+readItemsFromDatabase()
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ASP CODE END - READING ITEMS FROM THE DATABASE
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+ + diff --git a/www/extras/coolmenus/asp-example/menu.mdb b/www/extras/coolmenus/asp-example/menu.mdb new file mode 100644 index 000000000..e94114d0a Binary files /dev/null and b/www/extras/coolmenus/asp-example/menu.mdb differ diff --git a/www/extras/coolmenus/asp-example/vbscript.asp b/www/extras/coolmenus/asp-example/vbscript.asp new file mode 100644 index 000000000..b01f071e4 --- /dev/null +++ b/www/extras/coolmenus/asp-example/vbscript.asp @@ -0,0 +1,283 @@ +<%@LANGUAGE = "VBSCRIPT"%> + + + ASP example + + + + + +
+
+
+ +This file is a simple example of how to get items from a access database. It's more or less +the same as the javascript example, only coded in VBSCRIPT. I will make a more advanced example later. The table consist of 4 simple columns: +
+
+menuID - Autonumber - the id of the menuitem.
+mName - String - The menu name
+mLink - String - The link
+parent - Number - a recursive relation to menuID.
+
+
+This can rather easily be converted to control the entire menu and by adding a server-side admin *anyone* could +easily change the menu. The new menumaker that I will hopefully soon have time +to make will probably use something like this. +
+
+On this site I use a similar approuch, the only difference is that I make a js file everytime I update, that way +I don't have to get the items from the database on every visit. I will try and make an example like that as well later. +
+
+ +ASP source-code: +
+'*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+'ASP CODE START - READING ITEMS FROM THE DATABASE
+'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Sub readItemsFromDatabase
+  'The path to your database:
+  Dim db,q,rs,rsarr,menuID,mName,mLink,parent,cols,max
+	
+	db ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("menu.mdb")
+  
+  q = "SELECT menuID,mName,mLink,parent from tblMenu ORDER BY parent,menuID ASC"
+  
+  Set rs=Server.CreateObject("ADODB.Recordset")
+  rs.CacheSize = 25 		' Cache data fetching
+  rs.CursorType = 3
+  rs.LockType = 3
+  
+  'Opening database --- --
+  rs.Open q,db
+  
+  'Now using getRows because that's so sexy :}
+  if NOT rs.EOF then
+    rsarr = rs.GetRows()
+		max = Ubound(rsarr,2)
+  else 
+		max = 0
+  end if
+  'Closing database, we don't need it anymore - we have the info in the array
+  rs.close()
+  Set rs = Nothing
+  
+	row=0
+	do while(row<=max) 'Looping rows
+    'Setting variables 
+    menuID = "m" & rsarr(0,row)
+    mName = rsarr(1,row)
+    mLink = rsarr(2,row)
+    if(mLink="null") then mLink="" 
+    parent = rsarr(3,row)
+    if(parent<>0) then
+			parent = "m" & parent
+    else 
+			parent=""
+    end if
+		'Making menu item
+    Response.write("oCMenu.makeMenu('" & menuID & "','" &parent & "','" & mName & "','" & mLink & "')" & vbcrlf)
+  	row = row + 1
+	loop
+End Sub
+
+'Calling sub
+call readItemsFromDatabase
+
+'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+'ASP CODE END - READING ITEMS FROM THE DATABASE
+'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ + diff --git a/www/extras/coolmenus/cm_addins.js b/www/extras/coolmenus/cm_addins.js new file mode 100644 index 000000000..dd48ce868 --- /dev/null +++ b/www/extras/coolmenus/cm_addins.js @@ -0,0 +1,262 @@ +/****************************************** +CM_ADD-IN - hideselectboxes (last updated: 11/13/02) +IE5+ and NS6+ only - ignores the other browsers + +Because of the selectbox bug in the browsers that makes +selectboxes have the highest z-index whatever you do +this script will check for selectboxes that interfear with +your menu items and then hide them. + +Just add this code to the coolmenus js file +or link the cm_addins.js file to your page as well. +*****************************************/ +if(bw.dom&&!bw.op){ + makeCM.prototype.sel=0 + makeCM.prototype.onshow+=";this.hideselectboxes(pm,pm.subx,pm.suby,maxw,maxh,pm.lev)" + makeCM.prototype.hideselectboxes=function(pm,x,y,w,h,l){ + var selx,sely,selw,selh,i + if(!this.sel){ + this.sel=this.doc.getElementsByTagName("SELECT") + this.sel.level=0 + } + var sel=this.sel + for(i=0;ix && selxy && selyc.fromTop&&c.scrollstop){ + for(i=0;ic.bar.x?c.bar.x:c.m[c.l[0].m[0]].b.x:c.m[c.l[0].m[0]].b.x; + var y = c.useBar?c.m[c.l[0].m[0]].b.y>c.bar.y?c.bar.y:c.m[c.l[0].m[0]].b.y:c.m[c.l[0].m[0]].b.y; + var maxw = c.useBar?c.bar.w:c.rows?c.totw:c.maxw; var maxh = c.useBar?c.bar.h:!c.rows?c.toth:c.maxh + c.hideselectboxes(0,x,y,maxw,maxh,0) + } + } + if(!bw.ie) setTimeout(c.name+".checkscrolled()",200) +} +/****************************************** +CM_ADD-IN - pagecheck (last updated: 08/02/02) + +Simple code that *tries* to keep the menus inside the +bounderies of the page. + +Code updated. It's still not perfect (obviosly) +but it will now do another check to try and place +the menus inside. + + +Just add this code to the coolmenus js file +or link the cm_addins.js file to your page. +*****************************************/ +makeCM.prototype.onshow+=";this.pagecheck(b,pm,pm.subx,pm.suby,maxw,maxh)" +makeCM.prototype.pagecheck=function(b,pm,x,y,w,h,n){ + var l=pm.lev+1,a=b.align; if(!n) n=1 + var ok=1 + if(xcmpage.x2){ pm.align=2; ok=0;} + else if(ycmpage.y2) {pm.align=4; ok=0;} + if(!ok) this.getcoords(pm,this.l[l-1].borderX,this.l[l-1].borderY,pm.b.x,pm.b.y,w,h,this.l[l-1].offsetX,this.l[l-1].offsetY) + x=pm.subx; y=pm.suby + //Added check --- still not ok? --- part of the code by Denny Caldwell (thanks) -- badly immplemented by me though + if(xcmpage.x2){ x = -(x+w-cmpage.x2);} + else if(ycmpage.y2) {y = -(y+h-cmpage.y2);} + if(xcmpage.x2){ x = -(x+w-cmpage.x2);} + else if(ycmpage.y2) {y = -(y+h-cmpage.y2);} + b.moveIt(x,y) +} +/****************************************** +CM_ADD-IN - pagecheck (last updated: 01/26/02) +Simple code that *tries* to keep the menus inside thebounderies of +the page.A more advanced version of this code will come later. +Just add this code to the coolmenus js fileor link the cm_addins. +js file to your page as well. +*****************************************/ +//makeCM.prototype.onshow+=";this.pagecheck2(b,pm,x,y,maxw,maxh)" +makeCM.prototype.pagecheck2=function(b,pm,x,y,w,h){ + var fixX = 0 + var fixY = 0 + var ok=1 + if(x+w>cmpage.x2) { + ; + ok=0; + }else if(xcmpage.y2){ + fixY = -(y+h-cmpage.y2); + ok=0; + }else if(y(end-px*px-px) && px>1) px-=px/5; this.moveIt(this.x,this.y+px) + this.clipTo(end-this.y,this.w,this.h,0) + this.tim=setTimeout(this.obj+".slide("+end+","+px+","+tim+","+c.name+","+l+",'"+name+"')",tim) + }else{this.moveIt(this.x,end)} +} +/****************** +CM_ADD-IN - clipout (last updated: 01/26/02) + +This works in all browsers, but it can be +unstable on all other browsers then Explorer. + +This function shows the submenus with a clipping +effect. If you use this add-in you get two +new level properties called "clippx" and +"cliptim". You have to specify this for +the levels you want this to happen on +(these properties will also be inherited though) + +"clippx" is the number of pixels you want the +div to slide each setTimout, while "cliptim" +is the setTimeout speed (in milliseconds) + +Example setting: +oCMenu.level[3].clippx=10 +oCMenu.level[3].cliptim=20 + +Just add this code to the coolmenus js file +or link the cm_addins.js file to your page as well. + +*****************/ +makeCM.prototype.onshow+="if(c.l[pm.lev].clippx){h=b.h; if(!rows) b.clipTo(0,maxw,0,0,1); else b.clipTo(0,0,maxh,0,1); b.clipxy=0; b.showIt(); clearTimeout(b.tim); b.clipout(c.l[pm.lev].clippx,!rows?maxw:maxh,!rows?maxh:maxw,c.l[pm.lev].cliptim,rows)}" +cm_makeObj.prototype.tim=10; +cm_makeLevel.prototype.clippx=null +cm_makeLevel.prototype.cliptim=30 +cm_makeObj.prototype.clipxy=0 +cm_makeObj.prototype.clipout=function(px,w,stop,tim,rows){ + if(!this.vis) return; if(this.clipxy-1 || window.sidebar) + this.ie=this.agent.indexOf("msie")>-1 && !this.op + if(this.op){ + this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1) + this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1) + this.op7=this.dom&&!this.op5&&!this.op6 //So all higher opera versions will use it + }else if(this.moz) this.ns6 = 1 + else if(this.ie){ + this.ie4 = !this.dom && document.all + this.ie5 = (this.agent.indexOf("msie 5")>-1) + this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1) + this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55 + } + this.mac=(this.agent.indexOf("mac")>-1) + this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7) + this.usedom= this.ns6||this.op7//Use dom creation + this.reuse = this.ie||this.op7||this.usedom //Reuse layers + this.px=this.dom&&!this.op5?"px":"" + return this +} +var bw=new cm_bwcheck() +/*Variable declaration*/ +var cmpage +/*Crossbrowser objects functions*/ +function cm_message(txt){alert(txt); return false} +function cm_makeObj(obj,nest,o,doc){ //Changed in v4.05 + if(!doc) doc=document + if(bw.usedom&&o) this.evnt=o + else{nest=(!nest) ? "doc.":'doc.layers.'+nest+'.' + this.evnt=bw.dom? doc.getElementById(obj): + bw.ie4?doc.all[obj]:bw.ns4?eval(nest+"layers." +obj):0; + } + if(!this.evnt) return cm_message('The layer does not exist ('+obj+')' + +'- \nIf your using Netscape please check the nesting of your tags (on the entire page)\nNest:'+nest) + this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; this.ok=0 + this.ref=bw.dom||bw.ie4?doc:this.css.document; + this.obj = obj + "Object"; eval(this.obj + "=this"); + this.x=0; this.y=0; this.w=0; this.h=0; this.vis=0; return this +} +cm_makeObj.prototype.moveIt = function(x,y){this.x=x;this.y=y; this.css.left=x+bw.px;this.css.top=y+bw.px} +cm_makeObj.prototype.showIt = function(o){this.css.visibility="visible"; this.vis=1; if(bw.op5&&this.arr){ this.arr.showIt(); }}//alert('showing arrow')}} +cm_makeObj.prototype.hideIt = function(no){this.css.visibility="hidden"; this.vis=0;} +cm_makeObj.prototype.clipTo = function(t,r,b,l,setwidth){ +this.w=r; this.h=b; if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r; this.css.clip.bottom=b;this.css.clip.left=l +}else{if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0; this.css.clip="rect("+t+bw.px+","+r+bw.px+","+b+bw.px+","+l+bw.px+")"; +if(setwidth){if(bw.op5||bw.op6){this.css.pixelWidth=r; this.css.pixelHeight=b;}else{this.css.width=r+bw.px; this.css.height=b+bw.px;}}}} +function cm_active(on,h){ + if(this.o.arr) on?this.o.arr.hideIt():bw.op5?this.o.arr.showIt():this.o.arr.css.visibility="inherit" + if(bw.reuse||bw.usedom){ + if(!this.img2) this.o.evnt.className=on?this.cl2:this.cl + else this.o.ref.images["img"+this.name].src=on?this.img2.src:this.img1.src; //Changed v4.05 + if(on && bw.ns6){this.o.hideIt(); this.o.css.visibility='inherit' }; //netscape 6 bug fix + }else{ + if(!this.img2){ if(on) this.o.over.showIt(); else this.o.over.hideIt(); + }else this.o.ref.images["img"+this.name].src=on?this.img2.src:this.img1.src; + }this.isactive=on?1:0 +} +/***Pageobject **/ +function cm_page(frame){ //Changed v4.05 + if(!frame) frame = self + this.x=0; this.x2 =(!bw.ie)?frame.innerWidth:frame.document.body.offsetWidth-20; + this.y=0; this.orgy=this.y2= (!bw.ie)?frame.innerHeight:frame.document.body.offsetHeight-6; + this.x50=this.x2/2; this.y50=this.y2/2; return this +} +/***check positions**/ +function cm_cp(num,w,minus){ + if(num){if(num.toString().indexOf("%")!=-1){var t = w?cmpage.x2:cmpage.y2; num=parseInt((t*parseFloat(num)/100)) + if(minus) num-=minus }else num=eval(num);} else num=0; return num +} +/**Level object**/ +function cm_makeLevel(){//changed 4.06 + var c=this, a=arguments; c.width=a[0]||null; c.height=a[1]||null; + c.regClass=a[2]||null; c.overClass=a[3]||null; c.borderX=a[4]>-1?a[4]:null; + c.borderY=a[5]>-1?a[5]:null; c.borderClass=a[6]||null; c.rows=a[7]>-1?a[7]:null; + c.align=a[8]||null; c.offsetX=a[9]||null; c.offsetY=a[10]||null; c.arrow=a[11]||null; + c.arrowWidth=a[12]||null; c.arrowHeight=a[13]||null; c.roundBorder=a[14]||null; return c +} +/***Making the main menu object**/ +function makeCM(name){ //Changed v4.06 + var c=this; c.mc=0; c.name = name; c.m=new Array(); c.scrollY=-1; c.level=new Array(); c.l=new Array(); c.tim=100; c.isresized=0; + c.isover=0; c.zIndex=100; c.frameStartLevel=1; c.bar=0; c.z=0; c.totw=0; c.toth=0; c.maxw=0; c.maxh=0; cmpage = new cm_page(); c.constructed = 0; + return this +}//events +makeCM.prototype.onshow=""; makeCM.prototype.onhide=""; makeCM.prototype.onconstruct=""; +/***Creating layers**/ +function cm_divCreate(id,cl,txt,w,c,app,ex,txt2){ + if(bw.usedom){var div=document.createElement("DIV"); div.className=cl; div.id=id; + if(txt) div.innerHTML=txt; if(app){app.appendChild(div); return div} + if(w) document.body.appendChild(div); return div + }else{var dstr='
',0,1) + }str+='
'; + if(l==0){if(arrow)str+=m.d3=cm_divCreate(id+'_a','clCMAbs','',0,1,d1); str+=""} + str+="\n"; if(!bw.reuse){m.txt=null; m.d2=null; m.d3=null;} + if(bw.usedom){ if(l==0) document.body.appendChild(d1); str=''} + return str +} +/***get align num from text (better to evaluate numbers later)**/ +function cm_checkalign(a){ + switch(a){ + case "right": return 1; break; case "left": return 2; break; + case "bottom": return 3; break; case "top": return 4; break; + case "righttop": return 5; break; case "lefttop": return 6; break; + case "bottomleft": return 7; break; case "topleft": return 8; break; + }return null +} +/**Making each individual menu **/ +makeCM.prototype.makeMenu=function(name,parent,txt,lnk,targ,w,h,img1,img2,cl,cl2,align,rows,nolink,onclick,onmouseover,onmouseout){ + var c = this; if(!name) name = c.name+""+c.mc; var p = parent!=""&&parent&&c.m[parent]?parent:0; + if(c.mc==0){ + //Added 4.07 - bug(?) in opera 7 - you cannot dom-add layers created in one document to another one (or so it seems) - so turn of usedom + if(bw.op7 && this.frames) bw.usedom=0 + var tmp=location.href; + if(tmp.indexOf('file:')>-1||tmp.charAt(1)==':') c.root=c.offlineRoot; else c.root=c.onlineRoot + if(c.useBar){if(!c.barBorderClass) c.barBorderClass=c.barClass; c.bar1 = cm_divCreate(c.name+'bbar_0',c.barClass,'',0,1); + c.bar = cm_divCreate(c.name+'bbar',c.barBorderClass,'',1,1,0,0,c.bar1); if(bw.usedom) c.bar.appendChild(c.bar1); + }}var create=1,img,arrow; var m = c.m[name] = new Object(); m.name=name; m.subs=new Array(); m.parent=p; m.arnum=0; m.arr=0 + var l = m.lev = p?c.m[p].lev+1:0; c.mc++; m.hide=0; + if(l>=c.l.length){ + var p1,p2=0; if(l>=c.level.length) p1=c.l[c.level.length-1]; + else p1=c.level[l]; c.l[l]=new Array(); if(!p2) p2=c.l[l-1] + if(l!=0){ if(isNaN(p1.align)) p1["align"]=cm_checkalign(p1.align) + for(var i in p1){if(i!="str"&&i!="m"){if(p1[i]==null) c.l[l][i]=p2[i]; else c.l[l][i]=p1[i] }} + }else{c.l[l]=c.level[0]; c.l[l].align=cm_checkalign(c.l[l].align)} + c.l[l]["str"]=''; c.l[l].m=new Array(); if(!c.l[l].borderClass) c.l[l].borderClass=c.l[l].regClass + c.l[l].app=0; c.l[l].max=0; c.l[l].arnum=0; c.l[l].o=new Array(); c.l[l].arr=new Array() + c.level[l]=p1=p2=null + if(l!=0) c.l[l].str=c.l[l].app=cm_divCreate(c.name+ '_' +l+'_0',c.l[l].borderClass,'') + }if(p){p = c.m[p]; p.subs[p.subs.length]=name; + if(p.subs.length==1&&c.l[l-1].arrow){ p.arr=1; + if(p.parent){c.m[p.parent].arnum++ + if(c.m[p.parent].arnum>c.l[l-1].arnum){ + c.l[l-1].str+=c.l[l-1].arr[c.l[l-1].arnum]=cm_divCreate(c.name+ '_a' +(l-1)+'_'+c.l[l-1].arnum,'clCMAbs','',0,1,c.l[l-1].app); c.l[l-1].arnum++ + }}}if(bw.reuse) if(p.subs.length>c.l[l].max) c.l[l].max = p.subs.length; else create=0 + }m.rows=rows>-1?rows:c.l[l].rows; m.w=cm_cp(w||c.l[l].width,1); m.h=cm_cp(h||c.l[l].height,0); m.txt=txt; m.lnk=lnk; + if(align) align=cm_checkalign(align); m.align=align||c.l[l].align; m.cl=cl=cl||c.l[l].regClass; + m.targ=targ; m.cl2=cl2||c.l[l].overClass; m.create=create; m.mover=onmouseover; m.mout=onmouseout; + m.onclck=onclick; m.active = cm_active; m.isactive=0; m.nolink=nolink + if(create) c.l[l].m[c.l[l].m.length]=name + if(img1){m.img1 = new Image(); m.img1.src=c.root+img1; if(!img2) img2=img1; m.img2 = new Image(); m.img2.src=c.root+img2; + m.cl="clCMAbs"; m.txt=''; if(!bw.reuse&&!nolink) m.txt = '';; + m.txt+='c.maxw) c.maxw=m.w; if(m.h>c.maxh) c.maxh=m.h; c.totw+=c.pxBetween+m.w+c.l[0].borderX;c.toth+=c.pxBetween+m.h+c.l[0].borderY} + if(lnk && !onmouseover){ + var path=lnk.indexOf("mailto:")>-1||lnk.indexOf("http://")>-1?"":c.root + m.mover="self.status='"+path+m.lnk+"'" + if(!m.mout) m.mout=""; m.mout+=";self.status='';" + } +} +/**Getting x/y coords for subs **/ +makeCM.prototype.getcoords=function(m,bx,by,x,y,maxw,maxh,ox,oy){ + var a=m.align; x+=m.o.x; y+=m.o.y + switch(a){ + case 1: x+=m.w+bx; break; case 2: x-=maxw+bx; break; + case 3: y+=m.h+by; break; case 4: y-=maxh+by; break; + case 5: x-=maxw+bx; y-=maxh-m.h; break; + case 6: x+=m.w+bx; y-=maxh-m.h; break; + case 7: y+=m.h+by; x-=maxw-m.w; break; + case 8: y-=maxh+by; x-=maxw-m.w+bx; break; + }//Added v4.05 + if(m.lev==this.frameStartLevel-1 && this.frames){ + switch(a){ + case 1: x=0; break; + case 2: x=this.cmpage.x2-maxw; break; + case 3: y=0; break; + case 4: y-=maxh+by; break; + case 5: x-=maxw+bx; y-=maxh-m.h; break; + case 6: x+=m.w+bx; y-=maxh-m.h; break; + case 7: y+=m.h+by; x-=maxw-m.w; break; + case 8: y-=maxh+by; x-=maxw-m.w+bx; break; + } + } + m.subx=x + ox; m.suby=y + oy +} +/**Showing sub elements**/ +makeCM.prototype.showsub=function(el){ //Changed v4.06 + var c=this,pm=c.m[el],m,o,nl + if(!pm.b||(c.isresized&&pm.lev>0)) pm.b=c.l[pm.lev].b; c.isover=1 + clearTimeout(c.tim); + var ln=pm.subs.length,l=pm.lev+1 + if(c.l[pm.lev].a==el&&l!=c.l.length && !c.openOnClick){if(c.l[pm.lev+1].a) c.hidesub(l+1,el); return} + c.hidesub(l,el); if(pm.mover) eval(pm.mover); if(!pm.isactive) pm.active(1); + c.l[pm.lev].a = el; if(ln==0) return; + if(c.openOnClick && !c.clicked) return//Added v4.06 + if(!c.l[l].b) return //Added v4.05 + var b = c.l[l].b, bx=c.l[l].borderX, by=c.l[l].borderY, rows=pm.rows + var rb=c.l[l].roundBorder;//added 4.06 + var x=bx+rb,y=by+rb,maxw=0,maxh=0,cn=0; b.hideIt() + for(var i=0;imaxw) maxw=m.w; maxh=y} + else{x+=m.w+bx; if(m.h>maxh) maxh=m.h; maxw=x;} + o.css.visibility="inherit"; if(bw.op5||bw.op6) o.showIt() + }else{o = c.m[c.l[l].m[i]].o; o.hideIt();} } + if(!rows) maxw+=bx*2+rb; else maxh+=by*2+rb; //changed 4.06 + if(rb){maxw+=rb; maxh+=rb}//added 4.06 + b.clipTo(0,maxw,maxh,0,1) + //Check frame scroll + if(c.chkscroll) c.chkscroll() //Added v4.05 - not the best solution + if(c.chkscroll||!pm.subx||!pm.suby||c.scrollY>-1||c.isresized) c.getcoords(pm,c.l[l-1].borderX,c.l[l-1].borderY,pm.b.x,pm.b.y,maxw,maxh,c.l[l-1].offsetX,c.l[l-1].offsetY) //Changed 4.06 + x=pm.subx; if(c.chkscroll&&l==c.frameStartLevel) pm.suby+=c.scrollY; y=pm.suby; b.moveIt(x,y); if(c.onshow) eval(c.onshow); b.showIt() +} +/**Hide sub elements **/ +makeCM.prototype.hidesub=function(l,el){ //Changed v4.05 + var c = this,tmp,m,i,j,hide + if(!l) {l=1; hide=1; c.clicked=0} + for(i=l-1;i0&&i>l-1) if(c.l[i].b) c.l[i].b.hideIt()//Changed v4.05 + if(c.l[i].a&&c.l[i].a!=el){ + m=c.m[c.l[i].a]; m.active(0,1); if(m.mout) eval(m.mout); c.l[i].a=0 + if(i>0&&i>l-1) if(bw.op5||bw.op6) for(j=0;jl){for(j=0;j0) this.body.appendChild(c.l[i].app) + if(!this.frames) c.l[i].str=null + }}c.z=c.zIndex+2 + for(i=st;i0){m.b = bobj; nest=i} + else{m.b = new cm_makeObj(c.name + "_"+name+"_0","",m.d1,this.doc); m.b.css.zIndex=c.z; m.b.clipTo(0,w+bx*2,h+by*2,0,1); nest=name} + id = c.name + "_"+name; nest=c.name + "_"+nest; + if(m.create){ + o=m.o=new cm_makeObj(id,nest+"_0",m.d2,this.doc); o.z=o.css.zIndex=c.z+1; if(bw.reuse){c.l[l].o[oc]=o; oc++}; + if(l==0&&m.img1) o.css.visibility='inherit'; if(bw.op5) o.showIt(); o.arr=0; + }if(!bw.reuse||l==0) o.clipTo(0,w,h,0,1); o.moveIt(bx,by); o.z=o.css.zIndex=c.z+2 + if(j"}} //Added 4.06 + c.makeObjects(nowrite); cmpage = new cm_page(); + var mpa,o,maxw=c.maxw,maxh=c.maxh,i,totw=c.totw,toth=c.toth,m,px=c.pxBetween + var bx=c.l[0].borderX,by=c.l[0].borderY,x=c.fromLeft,y=c.fromTop,mp=c.menuPlacement,rows=c.rows + if(rows){toth=maxh+by*2; totw=totw-px+bx;}else{totw=maxw+bx*2; toth=toth-px+by;} + switch(mp){ + case "center": x=cmpage.x2/2-totw/2; if(bw.ns4) x-=9; break; + case "right": x=cmpage.x2-totw; break; + case "bottom": case "bottomcenter": y=cmpage.y2-toth; if(mp=="bottomcenter") x=cmpage.x2/2-totw/2; break; + default: if(mp.toString().indexOf(",")>-1) mpa=1; break; + }for(var i=0;icmpage.x2+off || page2.y2>cmpage.orgy+off){ + if(bw.ie||bw.ns6||bw.op7||bw.ns4){ + cmpage=page2; this.isresized=1; + if(this.onresize) eval(this.onresize); this.construct(1); + if(this.onafterresize) eval(this.onafterresize); + }else{cm_inresize=1; location.reload()} + } +} +/**Onclick of an item**/ +makeCM.prototype.onclck=function(m){ //Changed v4.06 + m = this.m[m] + if(m.onclck) eval(m.onclck); + if(this.openOnClick && m.subs.length>0){ + this.clicked = 1; this.showsub(m.name); return + } + var lnk=m.lnk, targ=m.targ + if(lnk){ + if(lnk.indexOf("mailto")!=0 && lnk.indexOf("http")!=0) lnk=this.root+lnk + if(String(targ)=="undefined" || targ=="" || targ==0 || targ=="_self"){ + if(this.frames){ //Turning of all level 1 + vars + if(this.l[0].a){ + this.m[this.l[0].a].active(0,1) + this.l[0].a =0 + } + for(i=this.frameStartLevel;i + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + +
+
+This file is basically used for debugging. This does not work in Opera or NS4. +
+
+
Get window properties
+Get body properties
+Get menu properties
+Get level 0 properties
+Get item properties
+Get menubar (makeObj object) properties
+
+Get bw properties
+
+
+ +
+ + + + diff --git a/www/extras/coolmenus/dhtmlcentral.css b/www/extras/coolmenus/dhtmlcentral.css new file mode 100644 index 000000000..9c134f91e --- /dev/null +++ b/www/extras/coolmenus/dhtmlcentral.css @@ -0,0 +1,15 @@ +TD,P,B,INPUT,DIV{font-family:arial,helvetica; font-size:12px} +.clCMEvent{position:absolute; z-index:300; width:100%; height:100%; clip:rect(0,100%,100%,0); left:0; top:0; visibility:hidden} +.clCMAbs{position:absolute; width:10; height:10; left:0; top:0; visibility:hidden} + +.clT,.clTover,.clS,.clSover,.clS2,.clS2over{position:absolute; overflow:hidden; width:130; height:25; cursor:pointer; cursor:hand} +.clT,.clTover{padding:4px; font-size:12px; font-weight:bold} +.clT{color:white; } +.clTover{color:#FCCE55;} +.clS,.clSover{padding:2px; font-size:11px; font-weight:bold} +.clS2,.clS2over{padding:2px; font-size:11px;} +.clS,.clS2{color:#006699; background-color:#CDDBEB; layer-background-color:#CDDBEB;} +.clSover,.clS2over{color:#FCCE55;} +.clSover,.clS2over,.clTover,.clB,.clBar{layer-background-color:#336699; background-color:#336699;} +.clB{position:absolute; visibility:hidden; z-index:300} +.clBar{position:absolute; width:10; height:10; visibility:hidden; } diff --git a/www/extras/coolmenus/dhtmlcentral.html b/www/extras/coolmenus/dhtmlcentral.html new file mode 100644 index 000000000..773784616 --- /dev/null +++ b/www/extras/coolmenus/dhtmlcentral.html @@ -0,0 +1,38 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + diff --git a/www/extras/coolmenus/dhtmlcentral.js b/www/extras/coolmenus/dhtmlcentral.js new file mode 100644 index 000000000..8fd3294f1 --- /dev/null +++ b/www/extras/coolmenus/dhtmlcentral.js @@ -0,0 +1,49 @@ +oM=new makeCM("oM"); oM.resizeCheck=1; oM.rows=1; oM.onlineRoot=""; oM.pxBetween =0; +oM.fillImg="cm_fill.gif"; oM.fromTop=115; oM.fromLeft=155; oM.wait=300; oM.zIndex=400; +oM.useBar=1; oM.barWidth="100%"; oM.barHeight="menu"; oM.barX=0;oM.barY="menu"; oM.barClass="clBar"; +oM.barBorderX=0; oM.barBorderY=0; +oM.level[0]=new cm_makeLevel(90,21,"clT","clTover",1,1,"clB",0,"bottom",0,0,0,0,0); +oM.level[1]=new cm_makeLevel(102,22,"clS","clSover",1,1,"clB",0,"right",0,0,"menu_arrow.gif",10,10); +oM.level[2]=new cm_makeLevel(110,22,"clS2","clS2over"); +oM.level[3]=new cm_makeLevel(140,22); + +oM.makeMenu('m1','','News','/news/?m=1'); +oM.makeMenu('m2','','Projects','/projects/?m=2'); +oM.makeMenu('m3','','Scripts','/script/?m=3'); +oM.makeMenu('m4','','Tutorials','/tutorials/?m=4'); +oM.makeMenu('m5','','Forums','/forums/?m=5'); +oM.makeMenu('m6','','Resources','/resources/?m=6'); +oM.makeMenu('m7','','dhtmlcentral','/dhtmlcentral/?m=7'); +oM.makeMenu('m8','m1','Newest news','/news/?'); +oM.makeMenu('m9','m1','Archive','/news/?archive=1'); +oM.makeMenu('m10','m2','CoolMenus','/projects/coolmenus/?m=10','',120,0); +oM.makeMenu('m11','m2','DHTML Library','/projects/lib/?m=11','',120,0); +oM.makeMenu('m12','m2','DHTML Guestbook','/projects/guestbook/?m=12','',120,0); +oM.makeMenu('m13','m3','New scripts','/script/search.asp?new=1'); +oM.makeMenu('m14','m3','All scripts','/script/?m=14'); +oM.makeMenu('m15','m3','Categories','/txt/?m=15'); +oM.makeMenu('m16','m15','Menu','/script/search.asp?category=menu'); +oM.makeMenu('m17','m15','Text','/script/search.asp?category=text'); +oM.makeMenu('m18','m15','Animation','/script/search.asp?category=animation'); +oM.makeMenu('m19','m15','Other','/script/search.asp?category=other'); +oM.makeMenu('m20','m5','CoolMenus 3','/forums/forum.asp?FORUM_ID=2&CAT_ID=1&Forum_Title=CoolMenus+3'); +oM.makeMenu('m21','m5','General','/forums/forum.asp?FORUM_ID=6&CAT_ID=1&Forum_Title=General+DHTML+issues'); +oM.makeMenu('m22','m5','Scripts','/forums/forum.asp?FORUM_ID=4&CAT_ID=1&Forum_Title=DHTML+Scripts'); +oM.makeMenu('m23','m5','Crossbrowser','/forums/forum.asp?FORUM_ID=3&CAT_ID=1&Forum_Title=Crossbrowser+DHTML'); +oM.makeMenu('m24','m5','dhtmlcentral.com','/forums/forum.asp?FORUM_ID=5&CAT_ID=1&Forum_Title=dhtmlcentral%2Ecom'); +oM.makeMenu('m25','m5','Off topic','/forums/forum.asp?FORUM_ID=9&CAT_ID=1&Forum_Title=Off%2Dtopic'); +oM.makeMenu('m27','m6','Links','/resources/default.asp?m=27'); +oM.makeMenu('m28','m6','Web books','/resources/books.asp?m=28'); +oM.makeMenu('m29','m6','Web software','/resources/software.asp?m=29'); +oM.makeMenu('m39','m7','About','/txt/?m=39'); +oM.makeMenu('m40','m7','Advertise','/txt/?m=40'); +oM.makeMenu('m41','m7','Site sponsor','/txt/?m=41'); +oM.makeMenu('m42','m7','Contributors','/dhtmlcentral/contributors.asp?m=42'); +oM.makeMenu('m43','m7','Newsletter','/dhtmlcentral/newsletter.asp?m=43'); +oM.makeMenu('m44','m7','Members','/forums/members.asp?m=44'); +oM.makeMenu('m45','m7','Copyright','/txt/?m=45'); +oM.makeMenu('m26','m5','Active topics','/forums/active.asp?m=26'); + +//var avail="190+((cmpage.x2-235)/7)"; +//oM.menuPlacement=new Array(192,avail+"-11",avail+"*2-8",avail+"*3-12",avail+"*4-7",avail+"*5-9",avail+"*6+5") +oM.construct() diff --git a/www/extras/coolmenus/fixes4.06.txt b/www/extras/coolmenus/fixes4.06.txt new file mode 100644 index 000000000..ec1fe93fd --- /dev/null +++ b/www/extras/coolmenus/fixes4.06.txt @@ -0,0 +1,28 @@ +FIXED 11/14/02 + +1. Though the script worked fine in the new Opera 7 beta the script treated it as Explorer. + Therefore I choosed to update the browsercheck a little and now op7 runs more or less + the same way as mozilla (creating elements with DOM) (in the no-frame version) + NOTE: If you are using frames you should also update the browsercheck inside your + menu file (you don't have to though). +2. A lot of small fixes here and there: + f1. mmout - mout bug + f2. bug with using short-notation + f3. framelevel scroll bug + f4. status http://, mailto bug + f5. added onclick events (not really a bug but hey) + f6. updated selectbox-add-in to work in frames + f7. scroll-add_in bug + and some more things. +3. Added a level variable. It's called roundBorder and will give you a border around + all the elements in that level. Sweet. Check the example "menu_with_roundborder.html" + in the zip file for more info. +3. cm_addins.js: updated hideselectboxes add-in to work with frames +4. Remove link from statusbar on mouseout. +5. Fixed status message so it works also with mailto and http:// links. +6. Added to main variables (they should explain themselfs): + openOnClick + closeOnClick + +NEW ZIP: +http://www.dhtmlcentral.com/projects/coolmenus/coolmenus4_beta1_06.zip \ No newline at end of file diff --git a/www/extras/coolmenus/foldoutmenu_behaviour_mod.html b/www/extras/coolmenus/foldoutmenu_behaviour_mod.html new file mode 100644 index 000000000..e245b738c --- /dev/null +++ b/www/extras/coolmenus/foldoutmenu_behaviour_mod.html @@ -0,0 +1,228 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + +
+
+ + diff --git a/www/extras/coolmenus/frames_version/cm_fill.gif b/www/extras/coolmenus/frames_version/cm_fill.gif new file mode 100644 index 000000000..eda8af0b8 Binary files /dev/null and b/www/extras/coolmenus/frames_version/cm_fill.gif differ diff --git a/www/extras/coolmenus/frames_version/coolmenus.css b/www/extras/coolmenus/frames_version/coolmenus.css new file mode 100644 index 000000000..f3ada472a --- /dev/null +++ b/www/extras/coolmenus/frames_version/coolmenus.css @@ -0,0 +1,24 @@ +/* CoolMenus 4 - default styles - do not edit */ +.clCMAbs{position:absolute; visibility:hidden; left:0; top:0} +/* CoolMenus 4 - default styles - end */ + +/*Style for the background-bar*/ +.clBar{position:absolute; width:10; height:10; background-color:Navy; layer-background-color:Navy; visibility:hidden} + +/*Styles for level 0*/ +.clLevel0,.clLevel0over{position:absolute; padding:2px; font-family:tahoma,arial,helvetica; font-size:12px; font-weight:bold} +.clLevel0{background-color:Navy; layer-background-color:Navy; color:white;} +.clLevel0over{background-color:#336699; layer-background-color:#336699; color:Yellow; cursor:pointer; cursor:hand; } +.clLevel0border{position:absolute; visibility:hidden; background-color:#006699; layer-background-color:#006699} + +/*Styles for level 1*/ +.clLevel1, .clLevel1over{position:absolute; padding:2px; font-family:tahoma, arial,helvetica; font-size:11px; font-weight:bold} +.clLevel1{background-color:Navy; layer-background-color:Navy; color:white;} +.clLevel1over{background-color:#336699; layer-background-color:#336699; color:Yellow; cursor:pointer; cursor:hand; } +.clLevel1border{position:absolute; visibility:hidden; background-color:#006699; layer-background-color:#006699} + +/*Styles for level 2*/ +.clLevel2, .clLevel2over{position:absolute; padding:2px; font-family:tahoma,arial,helvetica; font-size:10px; font-weight:bold} +.clLevel2{background-color:Navy; layer-background-color:Navy; color:white;} +.clLevel2over{background-color:#0099cc; layer-background-color:#0099cc; color:Yellow; cursor:pointer; cursor:hand; } +.clLevel2border{position:absolute; visibility:hidden; background-color:#006699; layer-background-color:#006699} \ No newline at end of file diff --git a/www/extras/coolmenus/frames_version/coolmenus_frame.js b/www/extras/coolmenus/frames_version/coolmenus_frame.js new file mode 100644 index 000000000..7f3be5f48 --- /dev/null +++ b/www/extras/coolmenus/frames_version/coolmenus_frame.js @@ -0,0 +1,71 @@ +/********************************************************************* +Function to find a spesified frame - loops all frames 3 levels deep +(should be enough in most cases, I was to lazy to make a proper one) +*********************************************************************/ +function cm_findFrame(frameName){ + obj=top; var frameObj=0; + for(i=0;i + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/frameset2.html b/www/extras/coolmenus/frames_version/frameset2.html new file mode 100644 index 000000000..e8625a100 --- /dev/null +++ b/www/extras/coolmenus/frames_version/frameset2.html @@ -0,0 +1,10 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + \ No newline at end of file diff --git a/www/extras/coolmenus/frames_version/frameset3.html b/www/extras/coolmenus/frames_version/frameset3.html new file mode 100644 index 000000000..72deb67da --- /dev/null +++ b/www/extras/coolmenus/frames_version/frameset3.html @@ -0,0 +1,11 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/frameset4.html b/www/extras/coolmenus/frames_version/frameset4.html new file mode 100644 index 000000000..6f04763a0 --- /dev/null +++ b/www/extras/coolmenus/frames_version/frameset4.html @@ -0,0 +1,11 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/menu1.html b/www/extras/coolmenus/frames_version/menu1.html new file mode 100644 index 000000000..fe7936a22 --- /dev/null +++ b/www/extras/coolmenus/frames_version/menu1.html @@ -0,0 +1,188 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/menu2.html b/www/extras/coolmenus/frames_version/menu2.html new file mode 100644 index 000000000..41ceb865a --- /dev/null +++ b/www/extras/coolmenus/frames_version/menu2.html @@ -0,0 +1,184 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/menu3.html b/www/extras/coolmenus/frames_version/menu3.html new file mode 100644 index 000000000..f967ba7d9 --- /dev/null +++ b/www/extras/coolmenus/frames_version/menu3.html @@ -0,0 +1,185 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/menu4.html b/www/extras/coolmenus/frames_version/menu4.html new file mode 100644 index 000000000..12246793b --- /dev/null +++ b/www/extras/coolmenus/frames_version/menu4.html @@ -0,0 +1,190 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + diff --git a/www/extras/coolmenus/frames_version/test1.html b/www/extras/coolmenus/frames_version/test1.html new file mode 100644 index 000000000..3ca81b143 --- /dev/null +++ b/www/extras/coolmenus/frames_version/test1.html @@ -0,0 +1,30 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + +Test 1
+
+
+Test 1 +
+
+Test 1
+
+
+Test 1
+
+
+Test 1
+
+
+Test 1
+
+
+Test 1 + + \ No newline at end of file diff --git a/www/extras/coolmenus/frames_version/test2.html b/www/extras/coolmenus/frames_version/test2.html new file mode 100644 index 000000000..29a5e2c74 --- /dev/null +++ b/www/extras/coolmenus/frames_version/test2.html @@ -0,0 +1,45 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + +
+
+Test 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/www/extras/coolmenus/frames_version/test3.html b/www/extras/coolmenus/frames_version/test3.html new file mode 100644 index 000000000..9fec1e2e6 --- /dev/null +++ b/www/extras/coolmenus/frames_version/test3.html @@ -0,0 +1,41 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + +
+
+Test 3 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/www/extras/coolmenus/hide_selectbox_and_form_example.html b/www/extras/coolmenus/hide_selectbox_and_form_example.html new file mode 100644 index 000000000..efe0c5d26 --- /dev/null +++ b/www/extras/coolmenus/hide_selectbox_and_form_example.html @@ -0,0 +1,217 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + +
+
+ +
+
+ + + + +
+
+As you can see in this page there are form elements. In Netscape 4 and Opera there's a bug that makes ALL form elements +get the highest z-index. That means that the form elements "shines" trough the elements. In explorer, netscape 6 and opera this only goes +for select boxes. So I have made a check that you can turn on (oCMenu.checkselect) that checks for select boxes and +hides them if they come in the way of the menu. Unfortunatly this can not be done in Netscape so I have added another workaround to +that problem on this page. Surround your entire form with a ILAYER tag (ilayers are positioned relative by default). Add a id to +the layer and show it onshow and hide it onhide. I have also surronded it with a div called "formDiv" that I hide and show for Opera. +
+
+See the source-code for more information. + + diff --git a/www/extras/coolmenus/img1.gif b/www/extras/coolmenus/img1.gif new file mode 100644 index 000000000..5c47b8e37 Binary files /dev/null and b/www/extras/coolmenus/img1.gif differ diff --git a/www/extras/coolmenus/img1_on.gif b/www/extras/coolmenus/img1_on.gif new file mode 100644 index 000000000..c052f3fff Binary files /dev/null and b/www/extras/coolmenus/img1_on.gif differ diff --git a/www/extras/coolmenus/img_sub.gif b/www/extras/coolmenus/img_sub.gif new file mode 100644 index 000000000..ec1c31e38 Binary files /dev/null and b/www/extras/coolmenus/img_sub.gif differ diff --git a/www/extras/coolmenus/img_sub_on.gif b/www/extras/coolmenus/img_sub_on.gif new file mode 100644 index 000000000..4acb4b7f3 Binary files /dev/null and b/www/extras/coolmenus/img_sub_on.gif differ diff --git a/www/extras/coolmenus/menu1.html b/www/extras/coolmenus/menu1.html new file mode 100644 index 000000000..3497ee3e5 --- /dev/null +++ b/www/extras/coolmenus/menu1.html @@ -0,0 +1,184 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + diff --git a/www/extras/coolmenus/menu2.html b/www/extras/coolmenus/menu2.html new file mode 100644 index 000000000..d69dd536b --- /dev/null +++ b/www/extras/coolmenus/menu2.html @@ -0,0 +1,171 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + +

















+

















+

















+

















+ + diff --git a/www/extras/coolmenus/menu3.html b/www/extras/coolmenus/menu3.html new file mode 100644 index 000000000..b5647a14f --- /dev/null +++ b/www/extras/coolmenus/menu3.html @@ -0,0 +1,273 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + +

















+

















+

















+

















+ + diff --git a/www/extras/coolmenus/menu4.html b/www/extras/coolmenus/menu4.html new file mode 100644 index 000000000..2ed9a583f --- /dev/null +++ b/www/extras/coolmenus/menu4.html @@ -0,0 +1,189 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + +

















+

















+

















+

















+ + diff --git a/www/extras/coolmenus/menu_arrow.gif b/www/extras/coolmenus/menu_arrow.gif new file mode 100644 index 000000000..355225350 Binary files /dev/null and b/www/extras/coolmenus/menu_arrow.gif differ diff --git a/www/extras/coolmenus/menu_with_roundborder.html b/www/extras/coolmenus/menu_with_roundborder.html new file mode 100644 index 000000000..33011b52a --- /dev/null +++ b/www/extras/coolmenus/menu_with_roundborder.html @@ -0,0 +1,194 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + +
+
+
+
+
+ + + diff --git a/www/extras/coolmenus/open_onclick.html b/www/extras/coolmenus/open_onclick.html new file mode 100644 index 000000000..a289f935a --- /dev/null +++ b/www/extras/coolmenus/open_onclick.html @@ -0,0 +1,194 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + +
+
+
+asd
+
+
+as + + diff --git a/www/extras/coolmenus/table_placement1.html b/www/extras/coolmenus/table_placement1.html new file mode 100644 index 000000000..79317f291 --- /dev/null +++ b/www/extras/coolmenus/table_placement1.html @@ -0,0 +1,219 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + + + + +

Page heading


+ This is an exmaple where I try to simulate placing the menu inside a table. + For the menu to work properly the menu items have to be positioned absolute (if not + it will not work in NS4), therefore we CANNOT place the menu inside a table for real, but + we can make place it where it would have been if it was inside the table with a little extra + code. +
+ We use a fill image inside the TD to force the size of the TD to the size of the menu. We + know that the table is 100% so we can try to find out where to place the menu using the + cmpage object (it's an object that holds the size of the page, see the documentsize + tutorial at dhtmlcentral.com for more information). +
+
+ In this case the only position that changes is the left position, so we use cmpage.x2 which is + the total width of the page to figure out where the menu should be placed. +
+ If you look at this in different browsers, you'll see that it's not perfect, so in the code + of this example I made a little check that checks for NS4 and does some small changes. +
+ If the top position of the menu is supposed to change as well, depening on the content + or something we can do a little different approuch: +
+ +
+ Menu:
+ +
+ + diff --git a/www/extras/coolmenus/table_placement2.html b/www/extras/coolmenus/table_placement2.html new file mode 100644 index 000000000..a4eae4fc9 --- /dev/null +++ b/www/extras/coolmenus/table_placement2.html @@ -0,0 +1,244 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + + + + +

Page heading

This is text, this will change the top position of the menu depending on how big this + column is.. + This is text, this will change the top position of the menu depending on how big this + column is..
+ This is an exmaple where I try to simulate placing the menu inside a table. + For the menu to work properly the menu items have to be positioned absolute (if not + it will not work in NS4), therefore we CANNOT place the menu inside a table for real, but + we can make place it where it would have been if it was inside the table with a little extra + code. +
+ We use a fill image inside the TD to force the size of the TD to the size of the menu. + In this one we try to find the position of the div/layer surrounding the layer and + then places the menu where that layer/div is. +
+
+ For this to work the menucode have to be placed AFTER the table. Which again means that + it's VERY important that the code inside the table is correct (correctly nested tags, close all P tags and so on), if + not Netscape 4 WILL break. +
+ Menu:
+ +
+ +
+ +
+ + + diff --git a/www/extras/coolmenus/table_placement3.html b/www/extras/coolmenus/table_placement3.html new file mode 100644 index 000000000..25ea771a7 --- /dev/null +++ b/www/extras/coolmenus/table_placement3.html @@ -0,0 +1,231 @@ + + + Coolmenus example - CoolMenus4 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + + + + + + + + + + + + +

Page heading

+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ This one is more complicated then the previous because it tries to place + all the top items in different TD's. +
+ We use a fill image inside the TD's to force the size of the TD to the size of the menu. + Then we try to find the position of the div/layer surrounding the layer and + then places the menu where that layer/div is. We place a fill image inside + the TD to force the height of the items to the same as the height of the menuitems. +
+
+ For this to work the menucode have to be placed AFTER the table. Which again means that + it's VERY important that the code inside the table is correct (correctly nested tags, close all P tags and so on), if + not Netscape 4 WILL break. +
+
+ We set the width of the TD's and the top items to 20%. This technique can also be used to + place menus totally different places on the page. +
+
+
+ + + diff --git a/www/extras/coolmenus/twomenus.html b/www/extras/coolmenus/twomenus.html new file mode 100644 index 000000000..fd7249032 --- /dev/null +++ b/www/extras/coolmenus/twomenus.html @@ -0,0 +1,272 @@ + + + Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts. + + + + + + + diff --git a/www/extras/styles/webgui6/icon_site_map.gif b/www/extras/styles/webgui6/icon_site_map.gif new file mode 100644 index 000000000..d0e41878d Binary files /dev/null and b/www/extras/styles/webgui6/icon_site_map.gif differ