Commit f355463033a4302aa397e9dd08e1492e76f3ee4f

Authored by AntonioTerceiro
1 parent 9a80f261

ActionItem447: removing calendar JS lib

too hard to internationalize.

Moved French month names to po file


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2017 3f533792-8f58-4932-b0fe-aaf55b0a4547
po/fr/noosfero.po
... ... @@ -7,7 +7,7 @@ msgid ""
7 7 msgstr ""
8 8 "Project-Id-Version: noosfero 0.10.0\n"
9 9 "POT-Creation-Date: 2008-06-11 14:42-0300\n"
10   -"PO-Revision-Date: 2008-05-08 05:14+0200\n"
  10 +"PO-Revision-Date: 2008-06-13 16:15-0300\n"
11 11 "Last-Translator: Raphael Rousseau <pootle.colivre.coop.br@r4f.org>\n"
12 12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 13 "MIME-Version: 1.0\n"
... ... @@ -280,56 +280,51 @@ msgstr &quot;&quot;
280 280  
281 281 #: app/helpers/dates_helper.rb:47
282 282 msgid "January"
283   -msgstr ""
  283 +msgstr "Janvier"
284 284  
285 285 #: app/helpers/dates_helper.rb:48
286 286 msgid "February"
287   -msgstr ""
  287 +msgstr "Février"
288 288  
289 289 #: app/helpers/dates_helper.rb:49
290   -#, fuzzy
291 290 msgid "March"
292   -msgstr "Chercher"
  291 +msgstr "Mars"
293 292  
294 293 #: app/helpers/dates_helper.rb:50
295   -#, fuzzy
296 294 msgid "April"
297   -msgstr "profil"
  295 +msgstr "Avril"
298 296  
299 297 #: app/helpers/dates_helper.rb:51
300 298 msgid "May"
301   -msgstr ""
  299 +msgstr "Mai"
302 300  
303 301 #: app/helpers/dates_helper.rb:52
304 302 msgid "June"
305   -msgstr ""
  303 +msgstr "Juin"
306 304  
307 305 #: app/helpers/dates_helper.rb:53
308 306 msgid "July"
309   -msgstr ""
  307 +msgstr "Julliet"
310 308  
311 309 #: app/helpers/dates_helper.rb:54
312 310 msgid "August"
313   -msgstr ""
  311 +msgstr "Août"
314 312  
315 313 #: app/helpers/dates_helper.rb:55
316   -#, fuzzy
317 314 msgid "September"
318   -msgstr "Membres"
  315 +msgstr "Septembre"
319 316  
320 317 #: app/helpers/dates_helper.rb:56
321 318 msgid "October"
322   -msgstr ""
  319 +msgstr "Octobre"
323 320  
324 321 #: app/helpers/dates_helper.rb:57
325   -#, fuzzy
326 322 msgid "November"
327   -msgstr "Membres"
  323 +msgstr "Novembre"
328 324  
329 325 #: app/helpers/dates_helper.rb:58
330   -#, fuzzy
331 326 msgid "December"
332   -msgstr "Membres"
  327 +msgstr "Décembre"
333 328  
334 329 #: app/helpers/dates_helper.rb:61
335 330 msgid "%{month} %{year}"
... ...
public/javascripts/calendar_date_select/calendar_date_select.js
... ... @@ -1,430 +0,0 @@
1   -// CalendarDateSelect version 1.10.2 - a prototype based date picker
2   -// Questions, comments, bugs? - email the Author - Tim Harper <"timseeharper@gmail.seeom".gsub("see", "c")>
3   -if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes calendar_date_select.js (.g. <%= calendar_date_select_includes %>).");
4   -if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use calendar_date_select version 1.8.3");
5   -
6   -Element.addMethods({
7   - purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); },
8   - build: function(element, type, options, style) {
9   - var newElement = Element.build(type, options, style);
10   - element.appendChild(newElement);
11   - return newElement;
12   - }
13   -});
14   -
15   -Element.build = function(type, options, style)
16   -{
17   - var e = $(document.createElement(type));
18   - $H(options).each(function(pair) { eval("e." + pair.key + " = pair.value" ); });
19   - if (style)
20   - $H(style).each(function(pair) { eval("e.style." + pair.key + " = pair.value" ); });
21   - return e;
22   -};
23   -nil = null;
24   -
25   -Date.one_day = 24*60*60*1000;
26   -Date.weekdays = $w("S M T W T F S");
27   -Date.first_day_of_week = 0;
28   -Date.months = $w("January February March April May June July August September October November December" );
29   -Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; }
30   -Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); }
31   -Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : hour ) }
32   -Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; }
33   -Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());};
34   -Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); };
35   -Date.prototype.toFormattedString = function(include_time){
36   - var hour, str;
37   - str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear();
38   -
39   - if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
40   - return str;
41   -}
42   -Date.parseFormattedString = function(string) { return new Date(string);}
43   -Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;}
44   -window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return x>0}).first()||0); }
45   -window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return x>0}).first()||0 ); }
46   -
47   -_translations = {
48   - "OK": "OK",
49   - "Now": "Now",
50   - "Today": "Today"
51   -}
52   -SelectBox = Class.create();
53   -SelectBox.prototype = {
54   - initialize: function(parent_element, values, html_options, style_options) {
55   - this.element = $(parent_element).build("select", html_options, style_options);
56   - this.populate(values);
57   - },
58   - populate: function(values) {
59   - this.element.purgeChildren();
60   - var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; that.element.build("option", { value: pair[1], innerHTML: pair[0]}) });
61   - },
62   - setValue: function(value) {
63   - var e = this.element;
64   - var matched = false;
65   - $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = true;}; } );
66   - return matched;
67   - },
68   - getValue: function() { return $F(this.element)}
69   -}
70   -CalendarDateSelect = Class.create();
71   -CalendarDateSelect.prototype = {
72   - initialize: function(target_element, options) {
73   - this.target_element = $(target_element); // make sure it's an element, not a string
74   - if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;}
75   - if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT")
76   -
77   - this.target_element.calendar_date_select = this;
78   - this.last_click_at = 0;
79   - // initialize the date control
80   - this.options = $H({
81   - embedded: false,
82   - popup: nil,
83   - time: false,
84   - buttons: true,
85   - year_range: 10,
86   - close_on_click: nil,
87   - minute_interval: 5,
88   - popup_by: this.target_element,
89   - month_year: "dropdowns",
90   - onchange: this.target_element.onchange,
91   - valid_date_check: nil
92   - }).merge(options || {});
93   - this.use_time = this.options.get("time");
94   - this.parseDate();
95   - this.callback("before_show")
96   - this.initCalendarDiv();
97   - if(!this.options.get("embedded")) {
98   - this.positionCalendarDiv()
99   - // set the click handler to check if a user has clicked away from the document
100   - Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this));
101   - Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this));
102   - }
103   - this.callback("after_show")
104   - },
105   - positionCalendarDiv: function() {
106   - var above = false;
107   - var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width;
108   - var w_top = window.f_scrollTop(), w_height = window.f_height();
109   - var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height;
110   -
111   - if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true;
112   - var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px";
113   -
114   - this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px;
115   -
116   - this.calendar_div.setStyle({visibility:""});
117   -
118   - // draw an iframe behind the calendar -- ugly hack to make IE 6 happy
119   - if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: c_width.toString()+"px", border: "0px"})
120   - },
121   - initCalendarDiv: function() {
122   - if (this.options.get("embedded")) {
123   - var parent = this.target_element.parentNode;
124   - var style = {}
125   - } else {
126   - var parent = document.body
127   - var style = { position:"absolute", visibility: "hidden", left:0, top:0 }
128   - }
129   - this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style);
130   -
131   - var that = this;
132   - // create the divs
133   - $w("top header body buttons footer bottom").each(function(name) {
134   - eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { clear: 'left'} ); ");
135   - });
136   -
137   - this.initHeaderDiv();
138   - this.initButtonsDiv();
139   - this.initCalendarGrid();
140   - this.updateFooter("&#160;");
141   -
142   - this.refresh();
143   - this.setUseTime(this.use_time);
144   - },
145   - initHeaderDiv: function() {
146   - var header_div = this.header_div;
147   - this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return false; }.bindAsEventListener(this), className: "close" });
148   - this.next_month_button = header_div.build("a", { innerHTML: "&gt;", href:"#", onclick:function () { this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" });
149   - this.prev_month_button = header_div.build("a", { innerHTML: "&lt;", href:"#", onclick:function () { this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" });
150   -
151   - if (this.options.get("month_year")=="dropdowns") {
152   - this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)});
153   - this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)});
154   - this.populateYearRange();
155   - } else {
156   - this.month_year_label = header_div.build("span")
157   - }
158   - },
159   - initCalendarGrid: function() {
160   - var body_div = this.body_div;
161   - this.calendar_day_grid = [];
162   - var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" })
163   - // make the weekdays!
164   - var weekdays_row = days_table.build("thead").build("tr");
165   - Date.weekdays.each( function(weekday) {
166   - weekdays_row.build("th", {innerHTML: weekday});
167   - });
168   -
169   - var days_tbody = days_table.build("tbody")
170   - // Make the days!
171   - var row_number = 0, weekday;
172   - for(var cell_index = 0; cell_index<42; cell_index++)
173   - {
174   - weekday = (cell_index+Date.first_day_of_week ) % 7;
175   - if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++});
176   - (this.calendar_day_grid[cell_index] = days_row.build("td", {
177   - calendar_date_select: this,
178   - onmouseover: function () { this.calendar_date_select.dayHover(this); },
179   - onmouseout: function () { this.calendar_date_select.dayHoverOut(this) },
180   - onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); },
181   - className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class
182   - },
183   - { cursor: "pointer" }
184   - )).build("div");
185   - this.calendar_day_grid[cell_index];
186   - }
187   - },
188   - initButtonsDiv: function()
189   - {
190   - var buttons_div = this.buttons_div;
191   - if (this.options.get("time"))
192   - {
193   - var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []);
194   - buttons_div.build("span", {innerHTML:"@", className: "at_sign"});
195   -
196   - var t = new Date();
197   - this.hour_select = new SelectBox(buttons_div,
198   - blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )),
199   - {
200   - calendar_date_select: this,
201   - onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });},
202   - className: "hour"
203   - }
204   - );
205   - buttons_div.build("span", {innerHTML:":", className: "seperator"});
206   - var that = this;
207   - this.minute_select = new SelectBox(buttons_div,
208   - blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ return $A([ Date.padded2(x), x]); } ) ),
209   - {
210   - calendar_date_select: this,
211   - onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) },
212   - className: "minute"
213   - }
214   - );
215   -
216   - } else if (! this.options.get("buttons")) buttons_div.remove();
217   -
218   - if (this.options.get("buttons")) {
219   - buttons_div.build("span", {innerHTML: "&#160;"});
220   - if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", {
221   - innerHTML: _translations["Today"],
222   - href: "#",
223   - onclick: function() {this.today(false); return false;}.bindAsEventListener(this)
224   - });
225   -
226   - if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"})
227   -
228   - if (this.options.get("time")) b = buttons_div.build("a", {
229   - innerHTML: _translations["Now"],
230   - href: "#",
231   - onclick: function() {this.today(true); return false}.bindAsEventListener(this)
232   - });
233   -
234   - if (!this.options.get("embedded"))
235   - {
236   - buttons_div.build("span", {innerHTML: "&#160;"});
237   - buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return false;}.bindAsEventListener(this) });
238   - }
239   - }
240   - },
241   - refresh: function ()
242   - {
243   - this.refreshMonthYear();
244   - this.refreshCalendarGrid();
245   -
246   - this.setSelectedClass();
247   - this.updateFooter();
248   - },
249   - refreshCalendarGrid: function () {
250   - this.beginning_date = new Date(this.date).stripTime();
251   - this.beginning_date.setDate(1);
252   - this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day
253   - var pre_days = this.beginning_date.getDay() // draw some days before the fact
254   - if (pre_days < 3) pre_days += 7;
255   - this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week);
256   -
257   - var iterator = new Date(this.beginning_date);
258   -
259   - var today = new Date().stripTime();
260   - var this_month = this.date.getMonth();
261   - vdc = this.options.get("valid_date_check");
262   - for (var cell_index = 0;cell_index<42; cell_index++)
263   - {
264   - day = iterator.getDate(); month = iterator.getMonth();
265   - cell = this.calendar_day_grid[cell_index];
266   - Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day});
267   - if (month!=this_month) div.className = "other";
268   - cell.day = day; cell.month = month; cell.year = iterator.getFullYear();
269   - if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") };
270   - iterator.setDate( day + 1);
271   - }
272   -
273   - if (this.today_cell) this.today_cell.removeClassName("today");
274   -
275   - if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) {
276   - this.today_cell = this.calendar_day_grid[days_until];
277   - this.today_cell.addClassName("today");
278   - }
279   - },
280   - refreshMonthYear: function() {
281   - var m = this.date.getMonth();
282   - var y = this.date.getFullYear();
283   - // set the month
284   - if (this.options.get("month_year") == "dropdowns")
285   - {
286   - this.month_select.setValue(m, false);
287   -
288   - var e = this.year_select.element;
289   - if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= e.options.length - 2 )) this.populateYearRange();
290   -
291   - this.year_select.setValue(y);
292   -
293   - } else {
294   - this.month_year_label.update( Date.months[m] + " " + y.toString() );
295   - }
296   - },
297   - populateYearRange: function() {
298   - this.year_select.populate(this.yearRange().toArray());
299   - },
300   - yearRange: function() {
301   - if (!this.flexibleYearRange())
302   - return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]);
303   -
304   - var y = this.date.getFullYear();
305   - return $R(y - this.options.get("year_range"), y + this.options.get("year_range"));
306   - },
307   - flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); },
308   - validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} },
309   - dayHover: function(element) {
310   - var hover_date = new Date(this.selected_date);
311   - hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day);
312   - this.updateFooter(hover_date.toFormattedString(this.use_time));
313   - },
314   - dayHoverOut: function(element) { this.updateFooter(); },
315   - clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");},
316   - setSelectedClass: function() {
317   - if (!this.selection_made) return;
318   - this.clearSelectedClass()
319   - if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) {
320   - this.selected_cell = this.calendar_day_grid[days_until];
321   - this.selected_cell.addClassName("selected");
322   - }
323   - },
324   - reparse: function() { this.parseDate(); this.refresh(); },
325   - dateString: function() {
326   - return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : "&#160;";
327   - },
328   - parseDate: function()
329   - {
330   - var value = $F(this.target_element).strip()
331   - this.selection_made = (value != "");
332   - this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value);
333   - if (isNaN(this.date)) this.date = new Date();
334   - if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end);
335   - this.selected_date = new Date(this.date);
336   - this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false;
337   - this.date.setDate(1);
338   - },
339   - updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); this.footer_div.build("span", {innerHTML: text }); },
340   - updateSelectedDate:function(partsOrElement, via_click) {
341   - var parts = $H(partsOrElement);
342   - if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false;
343   - if (parts.get("day")) {
344   - var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check");
345   - for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day"));
346   - t_selected_date.setYear(parts.get("year"));
347   - t_selected_date.setMonth(parts.get("month"));
348   -
349   - if (vdc && ! vdc(t_selected_date.stripTime())) { return false; }
350   - this.selected_date = t_selected_date;
351   - this.selection_made = true;
352   - }
353   -
354   - if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour"));
355   - if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), this.options.get("minute_interval")) );
356   - if (parts.get("hour") === "" || parts.get("minute") === "")
357   - this.setUseTime(false);
358   - else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute")))
359   - this.setUseTime(true);
360   -
361   - this.updateFooter();
362   - this.setSelectedClass();
363   -
364   - if (this.selection_made) this.updateValue();
365   - if (this.closeOnClick()) { this.close(); }
366   - if (via_click && !this.options.get("embedded")) {
367   - if ((new Date() - this.last_click_at) < 333) this.close();
368   - this.last_click_at = new Date();
369   - }
370   - },
371   - closeOnClick: function() {
372   - if (this.options.get("embedded")) return false;
373   - if (this.options.get("close_on_click")===nil )
374   - return (this.options.get("time")) ? false : true
375   - else
376   - return (this.options.get("close_on_click"))
377   - },
378   - navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); },
379   - navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); },
380   - navTo: function(date) {
381   - if (!this.validYear(date.getFullYear())) return false;
382   - this.date = date;
383   - this.date.setDate(1);
384   - this.refresh();
385   - this.callback("after_navigate", this.date);
386   - return true;
387   - },
388   - setUseTime: function(turn_on) {
389   - this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true if time==true && time!="mixed"
390   - if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected
391   - var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval"));
392   - var hour = this.selected_date.getHours();
393   -
394   - this.hour_select.setValue(hour);
395   - this.minute_select.setValue(minute)
396   - } else if (this.options.get("time")=="mixed") {
397   - this.hour_select.setValue(""); this.minute_select.setValue("");
398   - }
399   - },
400   - updateValue: function() {
401   - var last_value = this.target_element.value;
402   - this.target_element.value = this.dateString();
403   - if (last_value!=this.target_element.value) this.callback("onchange");
404   - },
405   - today: function(now) {
406   - var d = new Date(); this.date = new Date();
407   - var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()});
408   - if ( ! now ) o = o.merge({hour: "", minute:""});
409   - this.updateSelectedDate(o, true);
410   - this.refresh();
411   - },
412   - close: function() {
413   - if (this.closed) return false;
414   - this.callback("before_close");
415   - this.target_element.calendar_date_select = nil;
416   - Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler);
417   - Event.stopObserving(document, "keypress", this.keyPress_handler);
418   - this.calendar_div.remove(); this.closed = true;
419   - if (this.iframe) this.iframe.remove();
420   - if (this.target_element.type!="hidden") this.target_element.focus();
421   - this.callback("after_close");
422   - },
423   - closeIfClickedOut: function(e) {
424   - if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close();
425   - },
426   - keyPress: function(e) {
427   - if (e.keyCode==Event.KEY_ESC) this.close();
428   - },
429   - callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } }
430   -}
431 0 \ No newline at end of file
public/javascripts/calendar_date_select/format_american.js
... ... @@ -1,34 +0,0 @@
1   -// American Format: 12/31/2000 5:00 pm
2   -// Thanks, Wes Hays
3   -Date.prototype.toFormattedString = function(include_time){
4   - str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear();
5   -
6   - if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
7   - return str;
8   -}
9   -
10   -Date.parseFormattedString = function (string) {
11   - // Test these with and without the time
12   - // 11/11/1111 12pm
13   - // 11/11/1111 1pm
14   - // 1/11/1111 10:10pm
15   - // 11/1/1111 01pm
16   - // 1/1/1111 01:11pm
17   - // 1/1/1111 1:11pm
18   - var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?";
19   - var d = string.match(new RegExp(regexp, "i"));
20   - if (d==null) {
21   - return Date.parse(string); // Give javascript a chance to parse it.
22   - }
23   -
24   - mdy = d[1].split('/');
25   - hrs = 0;
26   - mts = 0;
27   - if(d[3] != null) {
28   - hrs = parseInt(d[3].split('')[0], 10);
29   - if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs
30   - mts = d[4].split(':')[1];
31   - }
32   -
33   - return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0);
34   -}
public/javascripts/calendar_date_select/format_db.js
... ... @@ -1,27 +0,0 @@
1   -// DB No Seconds Format: 2007-12-05 12:00
2   -
3   -Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; }
4   -Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) }
5   -Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; }
6   -
7   -Date.prototype.toFormattedString = function(include_time){
8   - str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate());
9   - if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() }
10   - return str;
11   -}
12   -
13   -Date.parseFormattedString = function (string) {
14   - var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?';
15   - var d = string.match(new RegExp(regexp, "i"));
16   - if (d==null) return Date.parse(string); // at least give javascript a crack at it.
17   - var offset = 0;
18   - var date = new Date(d[1], 0, 1);
19   - if (d[3]) { date.setMonth(d[3] - 1); }
20   - if (d[5]) { date.setDate(d[5]); }
21   - if (d[7]) {
22   - date.setHours(parseInt(d[7], 10));
23   - }
24   - if (d[8]) { date.setMinutes(d[8]); }
25   - if (d[10]) { date.setSeconds(d[10]); }
26   - return date;
27   -}
public/javascripts/calendar_date_select/format_euro_24hr.js
... ... @@ -1,7 +0,0 @@
1   -// Formats date and time as "01 January 2000 17:00"
2   -Date.prototype.toFormattedString = function(include_time)
3   -{
4   - str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear();
5   - if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() }
6   - return str;
7   -}
8 0 \ No newline at end of file
public/javascripts/calendar_date_select/format_finnish.js
... ... @@ -1,24 +0,0 @@
1   -Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; }
2   -Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) }
3   -Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; }
4   -
5   -Date.prototype.toFormattedString = function(include_time){
6   - str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear();
7   - if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() }
8   - return str;
9   -}
10   -Date.parseFormattedString = function (string) {
11   - var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?';
12   - var d = string.match(new RegExp(regexp, "i"));
13   - if (d==null) return Date.parse(string); // at least give javascript a crack at it.
14   - var offset = 0;
15   - var date = new Date(d[5], 0, 1);
16   - if (d[3]) { date.setMonth(d[3] - 1); }
17   - if (d[5]) { date.setDate(d[1]); }
18   - if (d[7]) {
19   - date.setHours(parseInt(d[7], 10));
20   - }
21   - if (d[8]) { date.setMinutes(d[8]); }
22   - if (d[10]) { date.setSeconds(d[10]); }
23   - return date;
24   -}
public/javascripts/calendar_date_select/format_hyphen_ampm.js
... ... @@ -1,36 +0,0 @@
1   -Date.prototype.toFormattedString = function(include_time){
2   - str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate());
3   -
4   -if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
5   -return str;
6   -}
7   -
8   -Date.parseFormattedString = function (string) {
9   - var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
10   - "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" +
11   - "?)?)?)?";
12   - var d = string.match(new RegExp(regexp, "i"));
13   - if (d==null) return Date.parse(string); // at least give javascript a crack at it.
14   - var offset = 0;
15   - var date = new Date(d[1], 0, 1);
16   - if (d[3]) { date.setMonth(d[3] - 1); }
17   - if (d[5]) { date.setDate(d[5]); }
18   - if (d[7]) {
19   - hours = parseInt(d[7], 10);
20   - offset=0;
21   - is_pm = (d[9].toLowerCase()=="pm")
22   - if (is_pm && hours <= 11) hours+=12;
23   - if (!is_pm && hours == 12) hours=0;
24   - date.setHours(hours);
25   -
26   - }
27   - if (d[8]) { date.setMinutes(d[8]); }
28   - if (d[10]) { date.setSeconds(d[10]); }
29   - if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
30   - if (d[14]) {
31   - offset = (Number(d[16]) * 60) + Number(d[17]);
32   - offset *= ((d[15] == '-') ? 1 : -1);
33   - }
34   -
35   - return date;
36   -}
37 0 \ No newline at end of file
public/javascripts/calendar_date_select/format_iso_date.js
... ... @@ -1,46 +0,0 @@
1   -Date.prototype.toFormattedString = function(include_time) {
2   - var hour;
3   - var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate());
4   - if (include_time) {
5   - hour = this.getHours();
6   - str += " " + this.getHours() + ":" + this.getPaddedMinutes();
7   - }
8   - return str;
9   -};
10   -
11   -Date.parseFormattedString = function (string) {
12   -
13   - var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
14   - "( ([0-9]{1,2}):([0-9]{2})?" +
15   - "?)?)?)?";
16   -
17   - var d = string.match(new RegExp(regexp, "i"));
18   - if (d === null) {
19   - return Date.parse(string); // at least give javascript a crack at it.
20   - }
21   - var offset = 0;
22   - var date = new Date(d[1], 0, 1);
23   - if (d[3]) {
24   - date.setMonth(d[3] - 1);
25   - }
26   - if (d[5]) {
27   - date.setDate(d[5]);
28   - }
29   - if (d[7]) {
30   - date.setHours(d[7]);
31   - }
32   - if (d[8]) {
33   - date.setMinutes(d[8]);
34   - }
35   - if (d[0]) {
36   - date.setSeconds(d[0]);
37   - }
38   - if (d[2]) {
39   - date.setMilliseconds(Number("0." + d[2]));
40   - }
41   - if (d[4]) {
42   - offset = (Number(d[6])) + Number(d[8]);
43   - offset = ((d[5] == '-') ? 1 : -1);
44   - }
45   - return date;
46   -};
public/javascripts/calendar_date_select/format_italian.js
... ... @@ -1,24 +0,0 @@
1   -// Italian Format: 31/12/2000 23:00
2   -// Thanks, Bigonazzi!
3   -
4   -Date.prototype.toFormattedString = function(include_time){
5   - str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear();
6   - if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() }
7   - return str;
8   -}
9   -
10   -Date.parseFormattedString = function (string) {
11   - var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?';
12   - var d = string.match(new RegExp(regexp, "i"));
13   - if (d==null) return Date.parse(string); // at least give javascript a crack at it.
14   - var offset = 0;
15   - var date = new Date(d[5], 0, 1);
16   - if (d[3]) { date.setMonth(d[3] - 1); }
17   - if (d[5]) { date.setDate(d[1]); }
18   - if (d[7]) {
19   - date.setHours(parseInt(d[7], 10));
20   - }
21   - if (d[8]) { date.setMinutes(d[8]); }
22   - if (d[10]) { date.setSeconds(d[10]); }
23   - return date;
24   -}
public/javascripts/calendar_date_select/locale/fi.js
... ... @@ -1,10 +0,0 @@
1   -Date.weekdays = $w("Ma Ti Ke To Pe La Su");
2   -Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" );
3   -
4   -Date.first_day_of_week = 1
5   -
6   -_translations = {
7   - "OK": "OK",
8   - "Now": "Nyt",
9   - "Today": "Tänään"
10   -}
11 0 \ No newline at end of file
public/javascripts/calendar_date_select/locale/fr.js
... ... @@ -1,11 +0,0 @@
1   -
2   -Date.weekdays = $w("lun mar mer jeu ven sam dim");
3   -Date.months = $w("janvier février mars avril mai juin juillet août septembre octobre novembre décembre");
4   -
5   -Date.first_day_of_week = 1
6   -
7   -_translations = {
8   - "OK": "OK",
9   - "Now": "maintenant",
10   - "Today": "aujourd'hui"
11   -}
public/javascripts/calendar_date_select/locale/pl.js
... ... @@ -1,10 +0,0 @@
1   -Date.weekdays = $w('P W Ś C P S N');
2   -Date.months = $w('Styczeń Luty Marzec Kwiecień Maj Czerwiec Lipiec Sierpień Wrzesień Październik Listopad Grudzień');
3   -
4   -Date.first_day_of_week = 1
5   -
6   -_translations = {
7   - "OK": "OK",
8   - "Now": "Teraz",
9   - "Today": "Dziś"
10   -}
11 0 \ No newline at end of file
public/javascripts/calendar_date_select/locale/pt_br.js
... ... @@ -1,11 +0,0 @@
1   -
2   -Date.weekdays = $w("Seg Ter Qua Qui Sex Sab Dom");
3   -Date.months = $w("Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro" );
4   -
5   -Date.first_day_of_week = 1
6   -
7   -_translations = {
8   - "OK": "OK",
9   - "Now": "Agora",
10   - "Today": "Hoje"
11   -}