damagecontrol 0.5.0 → 0.5.0.1391
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +67 -11
- data/Rakefile +15 -6
- data/app/controllers/admin_controller.rb +0 -3
- data/app/controllers/application.rb +42 -163
- data/app/controllers/build_controller.rb +33 -0
- data/app/controllers/files_controller.rb +1 -1
- data/app/controllers/project_controller.rb +23 -65
- data/app/controllers/rails_ext.rb +247 -0
- data/app/controllers/rscm_ext.rb +52 -0
- data/app/helpers/build_helper.rb +2 -0
- data/app/views/build/email.rhtml +18 -0
- data/app/views/build/status.rhtml +20 -0
- data/app/views/build/tests.rhtml +2 -0
- data/app/views/layouts/{rscm.rhtml → default.rhtml} +10 -4
- data/app/views/project/_changesets_list.rhtml +2 -2
- data/app/views/project/_cvs.rhtml +4 -5
- data/app/views/project/_project.rhtml +9 -9
- data/app/views/project/_select_pane.rhtml +26 -0
- data/app/views/project/_tab_pane.rhtml +23 -0
- data/app/views/project/changeset.rhtml +35 -0
- data/app/views/project/view.rhtml +18 -32
- data/app/views/setup/welcome.rhtml +118 -0
- data/config/database.yml +20 -20
- data/config/environment.rb +66 -60
- data/config/environments/development.rb +3 -2
- data/config/environments/production.rb +3 -2
- data/config/environments/test.rb +3 -2
- data/config/routes.rb +15 -0
- data/lib/damagecontrol/app.rb +11 -40
- data/lib/damagecontrol/build.rb +50 -8
- data/lib/damagecontrol/directories.rb +7 -6
- data/lib/damagecontrol/poller.rb +11 -20
- data/lib/damagecontrol/project.rb +83 -16
- data/lib/damagecontrol/publisher/ambient_orb.rb +16 -0
- data/lib/damagecontrol/publisher/archive.rb +16 -0
- data/lib/damagecontrol/publisher/base.rb +25 -0
- data/lib/damagecontrol/publisher/build_duration.rb +16 -0
- data/lib/damagecontrol/publisher/email.rb +59 -0
- data/lib/damagecontrol/publisher/execute.rb +49 -0
- data/lib/damagecontrol/publisher/ftp.rb +16 -0
- data/lib/damagecontrol/publisher/growl.rb +44 -0
- data/lib/damagecontrol/publisher/irc.rb +31 -0
- data/lib/damagecontrol/publisher/jabber.rb +68 -0
- data/lib/damagecontrol/publisher/scp.rb +16 -0
- data/lib/damagecontrol/publisher/x10cm11a.rb +17 -0
- data/lib/damagecontrol/publisher/x10cm17a.rb +17 -0
- data/lib/damagecontrol/publisher/yahoo.rb +16 -0
- data/lib/damagecontrol/standard_persister.rb +2 -2
- data/lib/damagecontrol/tracker.rb +48 -6
- data/lib/damagecontrol/visitor/rss_writer.rb +1 -1
- data/lib/damagecontrol/visitor/yaml_persister.rb +10 -1
- data/public/404.html +5 -5
- data/public/500.html +5 -5
- data/public/dispatch.cgi +2 -2
- data/public/dispatch.fcgi +1 -1
- data/public/dispatch.rb +2 -2
- data/public/images/growlicon.png +0 -0
- data/public/images/megaphone.png +0 -0
- data/public/images/monotone-logo.png +0 -0
- data/public/images/publisher/ambient_orb.png +0 -0
- data/public/images/publisher/build_duration.png +0 -0
- data/public/images/publisher/email.png +0 -0
- data/public/images/publisher/execute.png +0 -0
- data/public/images/publisher/growl.png +0 -0
- data/public/images/publisher/irc.png +0 -0
- data/public/images/publisher/jabber.png +0 -0
- data/public/images/publisher/x10cm11a.png +0 -0
- data/public/images/publisher/x10cm17a.png +0 -0
- data/public/images/publisher/yahoo.png +0 -0
- data/public/index.html +70 -1
- data/public/javascripts/dateFormat.js +283 -0
- data/public/javascripts/jscalendar/ChangeLog +500 -0
- data/public/javascripts/jscalendar/README +33 -0
- data/public/javascripts/jscalendar/bugtest-hidden-selects.html +108 -0
- data/public/javascripts/jscalendar/calendar-blue.css +231 -0
- data/public/javascripts/jscalendar/calendar-blue2.css +235 -0
- data/public/javascripts/jscalendar/calendar-brown.css +224 -0
- data/public/javascripts/jscalendar/calendar-green.css +228 -0
- data/public/javascripts/jscalendar/calendar-setup.js +181 -0
- data/public/javascripts/jscalendar/calendar-setup_stripped.js +21 -0
- data/public/javascripts/jscalendar/calendar-system.css +250 -0
- data/public/javascripts/jscalendar/calendar-tas.css +238 -0
- data/public/javascripts/jscalendar/calendar-win2k-1.css +270 -0
- data/public/javascripts/jscalendar/calendar-win2k-2.css +270 -0
- data/public/javascripts/jscalendar/calendar-win2k-cold-1.css +264 -0
- data/public/javascripts/jscalendar/calendar-win2k-cold-2.css +270 -0
- data/public/javascripts/jscalendar/calendar.js +1715 -0
- data/public/javascripts/jscalendar/calendar.php +119 -0
- data/public/javascripts/jscalendar/calendar_stripped.js +12 -0
- data/public/javascripts/jscalendar/doc/html/reference-Z-S.css +0 -0
- data/public/javascripts/jscalendar/doc/html/reference.css +34 -0
- data/public/javascripts/jscalendar/doc/html/reference.html +1316 -0
- data/public/javascripts/jscalendar/doc/reference.pdf +0 -0
- data/public/javascripts/jscalendar/img.gif +0 -0
- data/public/javascripts/jscalendar/index.html +333 -0
- data/public/javascripts/jscalendar/lang/calendar-af.js +39 -0
- data/public/javascripts/jscalendar/lang/calendar-br.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-ca.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-cs-win.js +34 -0
- data/public/javascripts/jscalendar/lang/calendar-da.js +63 -0
- data/public/javascripts/jscalendar/lang/calendar-de.js +100 -0
- data/public/javascripts/jscalendar/lang/calendar-du.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-el.js +89 -0
- data/public/javascripts/jscalendar/lang/calendar-en.js +123 -0
- data/public/javascripts/jscalendar/lang/calendar-es.js +114 -0
- data/public/javascripts/jscalendar/lang/calendar-fi.js +98 -0
- data/public/javascripts/jscalendar/lang/calendar-fr.js +86 -0
- data/public/javascripts/jscalendar/lang/calendar-hr-utf8.js +49 -0
- data/public/javascripts/jscalendar/lang/calendar-hr.js +0 -0
- data/public/javascripts/jscalendar/lang/calendar-hu.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-it.js +79 -0
- data/public/javascripts/jscalendar/lang/calendar-jp.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-ko-utf8.js +120 -0
- data/public/javascripts/jscalendar/lang/calendar-ko.js +120 -0
- data/public/javascripts/jscalendar/lang/calendar-lt-utf8.js +114 -0
- data/public/javascripts/jscalendar/lang/calendar-lt.js +114 -0
- data/public/javascripts/jscalendar/lang/calendar-nl.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-no.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-pl-utf8.js +93 -0
- data/public/javascripts/jscalendar/lang/calendar-pl.js +56 -0
- data/public/javascripts/jscalendar/lang/calendar-pt.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-ro.js +66 -0
- data/public/javascripts/jscalendar/lang/calendar-ru.js +45 -0
- data/public/javascripts/jscalendar/lang/calendar-si.js +94 -0
- data/public/javascripts/jscalendar/lang/calendar-sk.js +99 -0
- data/public/javascripts/jscalendar/lang/calendar-sp.js +63 -0
- data/public/javascripts/jscalendar/lang/calendar-sv.js +93 -0
- data/public/javascripts/jscalendar/lang/calendar-tr.js +58 -0
- data/public/javascripts/jscalendar/lang/calendar-zh.js +45 -0
- data/public/javascripts/jscalendar/menuarrow.gif +0 -0
- data/public/javascripts/jscalendar/menuarrow2.gif +0 -0
- data/public/javascripts/jscalendar/release-notes.html +334 -0
- data/public/javascripts/jscalendar/simple-1.html +244 -0
- data/public/javascripts/jscalendar/simple-2.html +108 -0
- data/public/javascripts/jscalendar/simple-3.html +130 -0
- data/public/javascripts/jscalendar/test-position.html +40 -0
- data/public/javascripts/jscalendar/test.php +116 -0
- data/public/javascripts/toggle_div.js +18 -0
- data/public/stylesheets/niceones.txt +1 -0
- data/public/stylesheets/style.css +8 -1
- data/script/breakpointer +4 -5
- data/script/console +19 -27
- data/script/console_sandbox.rb +7 -0
- data/script/destroy +5 -0
- data/script/generate +3 -68
- data/script/server +6 -16
- data/test/damagecontrol/build_test.rb +8 -8
- data/test/damagecontrol/poller_test.rb +10 -18
- data/test/damagecontrol/project_test.rb +49 -13
- data/test/damagecontrol/publisher/base_test.rb +26 -0
- data/test/damagecontrol/publisher/build/email.rhtml +0 -0
- data/test/damagecontrol/publisher/email_test.rb +26 -0
- data/test/damagecontrol/publisher/fixture.rb +34 -0
- data/test/damagecontrol/publisher/growl_test.rb +15 -0
- data/test/damagecontrol/publisher/jabber_test.rb +15 -0
- data/test/damagecontrol/scm_web_test.rb +1 -1
- data/test/damagecontrol/visitor/changesets.rss +1 -1
- data/test/damagecontrol/visitor/diff_persister_test.rb +4 -4
- data/test/functional/build_controller_test.rb +17 -0
- data/test/test_helper.rb +13 -13
- metadata +185 -24
- data/app/views/project/_bugzilla.rhtml +0 -13
- data/app/views/project/_jira.rhtml +0 -19
- data/app/views/project/_mooky.rhtml +0 -23
- data/app/views/project/_rubyforge.rhtml +0 -19
- data/app/views/project/_scarab.rhtml +0 -19
- data/app/views/project/_scms.rhtml +0 -15
- data/app/views/project/_sourceforge.rhtml +0 -19
- data/app/views/project/_starteam.rhtml +0 -43
- data/app/views/project/_svn.rhtml +0 -22
- data/app/views/project/_trac.rhtml +0 -13
- data/app/views/project/_trackers.rhtml +0 -18
- data/app/views/project/changesets.rhtml +0 -31
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
|
|
2
|
+
* ---------------------------------------------------------------------------
|
|
3
|
+
*
|
|
4
|
+
* The DHTML Calendar
|
|
5
|
+
*
|
|
6
|
+
* Details and latest version at:
|
|
7
|
+
* http://dynarch.com/mishoo/calendar.epl
|
|
8
|
+
*
|
|
9
|
+
* This script is distributed under the GNU Lesser General Public License.
|
|
10
|
+
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
|
11
|
+
*
|
|
12
|
+
* This file defines helper functions for setting up the calendar. They are
|
|
13
|
+
* intended to help non-programmers get a working calendar on their site
|
|
14
|
+
* quickly. This script should not be seen as part of the calendar. It just
|
|
15
|
+
* shows you what one can do with the calendar, while in the same time
|
|
16
|
+
* providing a quick and simple method for setting it up. If you need
|
|
17
|
+
* exhaustive customization of the calendar creation process feel free to
|
|
18
|
+
* modify this code to suit your needs (this is recommended and much better
|
|
19
|
+
* than modifying calendar.js itself).
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// $Id: calendar-setup.js,v 1.15 2004/02/04 08:10:03 mishoo Exp $
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This function "patches" an input field (or other element) to use a calendar
|
|
26
|
+
* widget for date selection.
|
|
27
|
+
*
|
|
28
|
+
* The "params" is a single object that can have the following properties:
|
|
29
|
+
*
|
|
30
|
+
* prop. name | description
|
|
31
|
+
* -------------------------------------------------------------------------------------------------
|
|
32
|
+
* inputField | the ID of an input field to store the date
|
|
33
|
+
* displayArea | the ID of a DIV or other element to show the date
|
|
34
|
+
* button | ID of a button or other element that will trigger the calendar
|
|
35
|
+
* eventName | event that will trigger the calendar, without the "on" prefix (default: "click")
|
|
36
|
+
* ifFormat | date format that will be stored in the input field
|
|
37
|
+
* daFormat | the date format that will be used to display the date in displayArea
|
|
38
|
+
* singleClick | (true/false) wether the calendar is in single click mode or not (default: true)
|
|
39
|
+
* firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc.
|
|
40
|
+
* align | alignment (default: "Br"); if you don't know what's this see the calendar documentation
|
|
41
|
+
* range | array with 2 elements. Default: [1900, 2999] -- the range of years available
|
|
42
|
+
* weekNumbers | (true/false) if it's true (default) the calendar will display week numbers
|
|
43
|
+
* flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
|
|
44
|
+
* flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
|
|
45
|
+
* disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
|
|
46
|
+
* onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay)
|
|
47
|
+
* onClose | function that gets called when the calendar is closed. [default]
|
|
48
|
+
* onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar.
|
|
49
|
+
* date | the date that the calendar will be initially displayed to
|
|
50
|
+
* showsTime | default: false; if true the calendar will include a time selector
|
|
51
|
+
* timeFormat | the time format; can be "12" or "24", default is "12"
|
|
52
|
+
* electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
|
|
53
|
+
* step | configures the step of the years in drop-down boxes; default: 2
|
|
54
|
+
* position | configures the calendar absolute position; default: null
|
|
55
|
+
* cache | if "true" (but default: "false") it will reuse the same calendar object, where possible
|
|
56
|
+
* showOthers | if "true" (but default: "false") it will show days from other months too
|
|
57
|
+
*
|
|
58
|
+
* None of them is required, they all have default values. However, if you
|
|
59
|
+
* pass none of "inputField", "displayArea" or "button" you'll get a warning
|
|
60
|
+
* saying "nothing to setup".
|
|
61
|
+
*/
|
|
62
|
+
Calendar.setup = function (params) {
|
|
63
|
+
function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
|
|
64
|
+
|
|
65
|
+
param_default("inputField", null);
|
|
66
|
+
param_default("displayArea", null);
|
|
67
|
+
param_default("button", null);
|
|
68
|
+
param_default("eventName", "click");
|
|
69
|
+
param_default("ifFormat", "%Y/%m/%d");
|
|
70
|
+
param_default("daFormat", "%Y/%m/%d");
|
|
71
|
+
param_default("singleClick", true);
|
|
72
|
+
param_default("disableFunc", null);
|
|
73
|
+
param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined
|
|
74
|
+
param_default("firstDay", 0); // defaults to "Sunday" first
|
|
75
|
+
param_default("align", "Br");
|
|
76
|
+
param_default("range", [1900, 2999]);
|
|
77
|
+
param_default("weekNumbers", true);
|
|
78
|
+
param_default("flat", null);
|
|
79
|
+
param_default("flatCallback", null);
|
|
80
|
+
param_default("onSelect", null);
|
|
81
|
+
param_default("onClose", null);
|
|
82
|
+
param_default("onUpdate", null);
|
|
83
|
+
param_default("date", null);
|
|
84
|
+
param_default("showsTime", false);
|
|
85
|
+
param_default("timeFormat", "24");
|
|
86
|
+
param_default("electric", true);
|
|
87
|
+
param_default("step", 2);
|
|
88
|
+
param_default("position", null);
|
|
89
|
+
param_default("cache", false);
|
|
90
|
+
param_default("showOthers", false);
|
|
91
|
+
|
|
92
|
+
var tmp = ["inputField", "displayArea", "button"];
|
|
93
|
+
for (var i in tmp) {
|
|
94
|
+
if (typeof params[tmp[i]] == "string") {
|
|
95
|
+
params[tmp[i]] = document.getElementById(params[tmp[i]]);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (!(params.flat || params.inputField || params.displayArea || params.button)) {
|
|
99
|
+
alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function onSelect(cal) {
|
|
104
|
+
var p = cal.params;
|
|
105
|
+
var update = (cal.dateClicked || p.electric);
|
|
106
|
+
if (update && p.flat) {
|
|
107
|
+
if (typeof p.flatCallback == "function")
|
|
108
|
+
p.flatCallback(cal);
|
|
109
|
+
else
|
|
110
|
+
alert("No flatCallback given -- doing nothing.");
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (update && p.inputField) {
|
|
114
|
+
p.inputField.value = cal.date.print(p.ifFormat);
|
|
115
|
+
if (typeof p.inputField.onchange == "function")
|
|
116
|
+
p.inputField.onchange();
|
|
117
|
+
}
|
|
118
|
+
if (update && p.displayArea)
|
|
119
|
+
p.displayArea.innerHTML = cal.date.print(p.daFormat);
|
|
120
|
+
if (update && p.singleClick && cal.dateClicked)
|
|
121
|
+
cal.callCloseHandler();
|
|
122
|
+
if (update && typeof p.onUpdate == "function")
|
|
123
|
+
p.onUpdate(cal);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
if (params.flat != null) {
|
|
127
|
+
if (typeof params.flat == "string")
|
|
128
|
+
params.flat = document.getElementById(params.flat);
|
|
129
|
+
if (!params.flat) {
|
|
130
|
+
alert("Calendar.setup:\n Flat specified but can't find parent.");
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
|
|
134
|
+
cal.showsTime = params.showsTime;
|
|
135
|
+
cal.time24 = (params.timeFormat == "24");
|
|
136
|
+
cal.params = params;
|
|
137
|
+
cal.weekNumbers = params.weekNumbers;
|
|
138
|
+
cal.setRange(params.range[0], params.range[1]);
|
|
139
|
+
cal.setDateStatusHandler(params.dateStatusFunc);
|
|
140
|
+
cal.create(params.flat);
|
|
141
|
+
cal.show();
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var triggerEl = params.button || params.displayArea || params.inputField;
|
|
146
|
+
triggerEl["on" + params.eventName] = function() {
|
|
147
|
+
var dateEl = params.inputField || params.displayArea;
|
|
148
|
+
var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
|
|
149
|
+
var mustCreate = false;
|
|
150
|
+
var cal = window.calendar;
|
|
151
|
+
if (!(cal && params.cache)) {
|
|
152
|
+
window.calendar = cal = new Calendar(params.firstDay,
|
|
153
|
+
params.date,
|
|
154
|
+
params.onSelect || onSelect,
|
|
155
|
+
params.onClose || function(cal) { cal.hide(); });
|
|
156
|
+
cal.showsTime = params.showsTime;
|
|
157
|
+
cal.time24 = (params.timeFormat == "24");
|
|
158
|
+
cal.weekNumbers = params.weekNumbers;
|
|
159
|
+
mustCreate = true;
|
|
160
|
+
} else {
|
|
161
|
+
if (params.date)
|
|
162
|
+
cal.setDate(params.date);
|
|
163
|
+
cal.hide();
|
|
164
|
+
}
|
|
165
|
+
cal.showsOtherMonths = params.showOthers;
|
|
166
|
+
cal.yearStep = params.step;
|
|
167
|
+
cal.setRange(params.range[0], params.range[1]);
|
|
168
|
+
cal.params = params;
|
|
169
|
+
cal.setDateStatusHandler(params.dateStatusFunc);
|
|
170
|
+
cal.setDateFormat(dateFmt);
|
|
171
|
+
if (mustCreate)
|
|
172
|
+
cal.create();
|
|
173
|
+
cal.parseDate(dateEl.value || dateEl.innerHTML);
|
|
174
|
+
cal.refresh();
|
|
175
|
+
if (!params.position)
|
|
176
|
+
cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
|
|
177
|
+
else
|
|
178
|
+
cal.showAt(params.position[0], params.position[1]);
|
|
179
|
+
return false;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
|
|
2
|
+
* ---------------------------------------------------------------------------
|
|
3
|
+
*
|
|
4
|
+
* The DHTML Calendar
|
|
5
|
+
*
|
|
6
|
+
* Details and latest version at:
|
|
7
|
+
* http://dynarch.com/mishoo/calendar.epl
|
|
8
|
+
*
|
|
9
|
+
* This script is distributed under the GNU Lesser General Public License.
|
|
10
|
+
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
|
11
|
+
*
|
|
12
|
+
* This file defines helper functions for setting up the calendar. They are
|
|
13
|
+
* intended to help non-programmers get a working calendar on their site
|
|
14
|
+
* quickly. This script should not be seen as part of the calendar. It just
|
|
15
|
+
* shows you what one can do with the calendar, while in the same time
|
|
16
|
+
* providing a quick and simple method for setting it up. If you need
|
|
17
|
+
* exhaustive customization of the calendar creation process feel free to
|
|
18
|
+
* modify this code to suit your needs (this is recommended and much better
|
|
19
|
+
* than modifying calendar.js itself).
|
|
20
|
+
*/
|
|
21
|
+
Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("firstDay",0);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);else alert("No flatCallback given -- doing nothing.");return false;}if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.parseDate(dateEl.value||dateEl.innerHTML);cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/* The main calendar widget. DIV containing a table. */
|
|
2
|
+
|
|
3
|
+
.calendar {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: none;
|
|
6
|
+
border: 1px solid;
|
|
7
|
+
border-color: #fff #000 #000 #fff;
|
|
8
|
+
font-size: 11px;
|
|
9
|
+
cursor: default;
|
|
10
|
+
background: Window;
|
|
11
|
+
color: WindowText;
|
|
12
|
+
font-family: tahoma,verdana,sans-serif;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.calendar table {
|
|
16
|
+
border: 1px solid;
|
|
17
|
+
border-color: #fff #000 #000 #fff;
|
|
18
|
+
font-size: 11px;
|
|
19
|
+
cursor: default;
|
|
20
|
+
background: Window;
|
|
21
|
+
color: WindowText;
|
|
22
|
+
font-family: tahoma,verdana,sans-serif;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Header part -- contains navigation buttons and day names. */
|
|
26
|
+
|
|
27
|
+
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
|
28
|
+
text-align: center;
|
|
29
|
+
padding: 1px;
|
|
30
|
+
border: 1px solid;
|
|
31
|
+
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
|
32
|
+
background: ButtonFace;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.calendar .nav {
|
|
36
|
+
background: ButtonFace url(menuarrow.gif) no-repeat 100% 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.calendar thead .title { /* This holds the current "month, year" */
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
padding: 1px;
|
|
42
|
+
border: 1px solid #000;
|
|
43
|
+
background: ActiveCaption;
|
|
44
|
+
color: CaptionText;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.calendar thead .daynames { /* Row <TR> containing the day names */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.calendar thead .name { /* Cells <TD> containing the day names */
|
|
55
|
+
border-bottom: 1px solid ButtonShadow;
|
|
56
|
+
padding: 2px;
|
|
57
|
+
text-align: center;
|
|
58
|
+
background: ButtonFace;
|
|
59
|
+
color: ButtonText;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.calendar thead .weekend { /* How a weekend day name shows in header */
|
|
63
|
+
color: #f00;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
|
67
|
+
border: 2px solid;
|
|
68
|
+
padding: 0px;
|
|
69
|
+
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.calendar thead .active { /* Active (pressed) buttons in header */
|
|
73
|
+
border-width: 1px;
|
|
74
|
+
padding: 2px 0px 0px 2px;
|
|
75
|
+
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* The body part -- contains all the days in month. */
|
|
79
|
+
|
|
80
|
+
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
|
81
|
+
width: 2em;
|
|
82
|
+
text-align: right;
|
|
83
|
+
padding: 2px 4px 2px 2px;
|
|
84
|
+
}
|
|
85
|
+
.calendar tbody .day.othermonth {
|
|
86
|
+
font-size: 80%;
|
|
87
|
+
color: #aaa;
|
|
88
|
+
}
|
|
89
|
+
.calendar tbody .day.othermonth.oweekend {
|
|
90
|
+
color: #faa;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.calendar table .wn {
|
|
94
|
+
padding: 2px 3px 2px 2px;
|
|
95
|
+
border-right: 1px solid ButtonShadow;
|
|
96
|
+
background: ButtonFace;
|
|
97
|
+
color: ButtonText;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.calendar tbody .rowhilite td {
|
|
101
|
+
background: Highlight;
|
|
102
|
+
color: HighlightText;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
|
106
|
+
padding: 1px 3px 1px 1px;
|
|
107
|
+
border-top: 1px solid #fff;
|
|
108
|
+
border-right: 1px solid #000;
|
|
109
|
+
border-bottom: 1px solid #000;
|
|
110
|
+
border-left: 1px solid #fff;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
|
114
|
+
padding: 2px 2px 0px 2px;
|
|
115
|
+
border: 1px solid;
|
|
116
|
+
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.calendar tbody td.selected { /* Cell showing selected date */
|
|
120
|
+
font-weight: bold;
|
|
121
|
+
border: 1px solid;
|
|
122
|
+
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
|
123
|
+
padding: 2px 2px 0px 2px;
|
|
124
|
+
background: ButtonFace;
|
|
125
|
+
color: ButtonText;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.calendar tbody td.weekend { /* Cells showing weekend days */
|
|
129
|
+
color: #f00;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.calendar tbody td.today { /* Cell showing today date */
|
|
133
|
+
font-weight: bold;
|
|
134
|
+
color: #00f;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.calendar tbody td.disabled { color: GrayText; }
|
|
138
|
+
|
|
139
|
+
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
|
140
|
+
visibility: hidden;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* The footer part -- status bar and "Close" button */
|
|
148
|
+
|
|
149
|
+
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
|
153
|
+
background: ButtonFace;
|
|
154
|
+
padding: 1px;
|
|
155
|
+
border: 1px solid;
|
|
156
|
+
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
|
157
|
+
color: ButtonText;
|
|
158
|
+
text-align: center;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
|
162
|
+
border-top: 1px solid #fff;
|
|
163
|
+
border-right: 1px solid #000;
|
|
164
|
+
border-bottom: 1px solid #000;
|
|
165
|
+
border-left: 1px solid #fff;
|
|
166
|
+
padding: 1px;
|
|
167
|
+
background: #e4e0d8;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
|
171
|
+
padding: 2px 0px 0px 2px;
|
|
172
|
+
border-top: 1px solid #000;
|
|
173
|
+
border-right: 1px solid #fff;
|
|
174
|
+
border-bottom: 1px solid #fff;
|
|
175
|
+
border-left: 1px solid #000;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Combo boxes (menus that display months/years for direct selection) */
|
|
179
|
+
|
|
180
|
+
.calendar .combo {
|
|
181
|
+
position: absolute;
|
|
182
|
+
display: none;
|
|
183
|
+
width: 4em;
|
|
184
|
+
top: 0px;
|
|
185
|
+
left: 0px;
|
|
186
|
+
cursor: default;
|
|
187
|
+
border: 1px solid;
|
|
188
|
+
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
|
189
|
+
background: Menu;
|
|
190
|
+
color: MenuText;
|
|
191
|
+
font-size: 90%;
|
|
192
|
+
padding: 1px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.calendar .combo .label,
|
|
196
|
+
.calendar .combo .label-IEfix {
|
|
197
|
+
text-align: center;
|
|
198
|
+
padding: 1px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.calendar .combo .label-IEfix {
|
|
202
|
+
width: 4em;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.calendar .combo .active {
|
|
206
|
+
padding: 0px;
|
|
207
|
+
border: 1px solid #000;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.calendar .combo .hilite {
|
|
211
|
+
background: Highlight;
|
|
212
|
+
color: HighlightText;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.calendar td.time {
|
|
216
|
+
border-top: 1px solid ButtonShadow;
|
|
217
|
+
padding: 1px 0px;
|
|
218
|
+
text-align: center;
|
|
219
|
+
background-color: ButtonFace;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.calendar td.time .hour,
|
|
223
|
+
.calendar td.time .minute,
|
|
224
|
+
.calendar td.time .ampm {
|
|
225
|
+
padding: 0px 3px 0px 4px;
|
|
226
|
+
border: 1px solid #889;
|
|
227
|
+
font-weight: bold;
|
|
228
|
+
background-color: Menu;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.calendar td.time .ampm {
|
|
232
|
+
text-align: center;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.calendar td.time .colon {
|
|
236
|
+
padding: 0px 2px 0px 3px;
|
|
237
|
+
font-weight: bold;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.calendar td.time span.hilite {
|
|
241
|
+
border-color: #000;
|
|
242
|
+
background-color: Highlight;
|
|
243
|
+
color: HighlightText;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.calendar td.time span.active {
|
|
247
|
+
border-color: #f00;
|
|
248
|
+
background-color: #000;
|
|
249
|
+
color: #0f0;
|
|
250
|
+
}
|