[evolvis-commits] r17682: javascript-control-datepicker pending merges:↵ Thorsten Glaser 2011-11-02 update to latest Evolvis 4.8 version of these files

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Nov 2 15:07:28 CET 2011


Author: mirabilos
Date: 2011-11-02 15:07:28 +0100 (Wed, 02 Nov 2011)
New Revision: 17682

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/www/js/datepicker.js
   trunk/gforge_base/evolvisforge-5.1/src/www/themes/css/datepicker.css
Log:
javascript-control-datepicker pending merges:
  Thorsten Glaser 2011-11-02 update to latest Evolvis 4.8 version of these files


Modified: trunk/gforge_base/evolvisforge-5.1/src/www/js/datepicker.js
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/js/datepicker.js	2011-11-02 14:07:24 UTC (rev 17681)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/js/datepicker.js	2011-11-02 14:07:28 UTC (rev 17682)
@@ -1,6 +1,6 @@
 /*
  * Control.DatePicker
- * 
+ *
  * Transforms an ordinary input textbox into an interactive date picker.
  * When the textbox is clicked (or the down arrow is pressed), a calendar
  * appears that the user can browse through and select a date.
@@ -11,6 +11,21 @@
  *  - Customizable by CSS
  *
  * Written and maintained by Jeremy Jongsma (jeremy at jongsma.org)
+ * Extended by © 2011 Thorsten Glaser <t.glaser at tarent.de>
+ * Additional translations from:
+ * • fr	⇒ Olivier Berger [FusionForge]
+ * • it	⇒ Luigi Toscano <tosky:#debian-it|OFTC>
+ * • nl	⇒ Timo van Beek <surrounder:#UnixNL|Freenode>
+ * • pl	⇒ Paweł Jakobkiewicz [tarent]
+ *	⇒ Arkadiusz Miśkiewicz <arekm:#!/bin/mksh|Freenode>
+ * • pt	⇒ Kevin Viola Schmitz [tarent]
+ * • ro ⇒ Iain Adrian Apreotesei <waga:#MirBSD|Freenode>
+ * • bg	⇒ Иванка Александрова (Ivanka Alexandrova) [tarent]
+ * • ru	⇒ Андрей Б. (Andrey B.) [tarent]
+ * • hu	⇒ Ádám Hóka <ahoka:#!/bin/mksh|Freenode>
+ * • no	⇒ Johannes Langøy <Johannes`:#!/bin/mksh|Freenode>
+ * • de	⇒ Thorsten Glaser [tarent]
+ *
  * Published under the GNU GPL
  */
 
@@ -44,7 +59,6 @@
 			this.options.currentFormat = this.options.timeFormat;
 		else
 			this.options.currentFormat = this.options.dateFormat;
-//		this.options.currentFormat = this.options.timePicker ? this.options.dateTimeFormat : this.options.dateFormat;
 		this.options.date = DateFormat.parseFormat(this.element.value, this.options.currentFormat);
 
 		// Lazy load to avoid excessive CPU usage with lots of controls on one page
@@ -126,7 +140,7 @@
 			case Event.KEY_TAB:
 				this.hide();
 				return;
-			case Event.KEY_DOWN:	
+			case Event.KEY_DOWN:
 				if (!this.pickerActive) {
 					this.show();
 					Event.stop(e);
@@ -198,17 +212,18 @@
 Object.extend(Control.DatePicker.i18n, {
 	baseLocales: {
 		'us': {
-			dateTimeFormat: 'MM-dd-yyyy HH:mm',
-			dateFormat: 'MM-dd-yyyy',
+			dateTimeFormat: 'MM/dd/yyyy HH:mm',
+			dateFormat: 'MM/dd/yyyy',
 			firstWeekDay: 0,
 			weekend: [0,6],
 			timeFormat: 'HH:mm'
 		},
-		'eu': {
-			dateTimeFormat: 'dd-MM-yyyy HH:mm',
-			dateFormat: 'dd-MM-yyyy',
+		'mdy': {
+			dateTimeFormat: 'MM/dd/yyyy HH:mm',
+			dateFormat: 'MM/dd/yyyy',
 			firstWeekDay: 1,
 			weekend: [0,6],
+			use24hrs: true,
 			timeFormat: 'HH:mm'
 		},
 		'iso8601': {
@@ -216,6 +231,7 @@
 			dateFormat: 'yyyy-MM-dd',
 			firstWeekDay: 1,
 			weekend: [0,6],
+			use24hrs: true,
 			timeFormat: 'HH:mm'
 		},
 		'din5008_optional': {
@@ -223,6 +239,7 @@
 			dateFormat: 'dd.MM.yyyy',
 			firstWeekDay: 1,
 			weekend: [0,6],
+			use24hrs: true,
 			timeFormat: 'HH:mm'
 		}
 	},
@@ -252,15 +269,56 @@
 with (Control.DatePicker) {
 	// Full locale definitions not needed if countries use the language default format
 	// Datepicker will fallback to the language default; i.e. 'es_AR' will use 'es'
-	Locale['es'] = i18n.createLocale('eu', 'es');
+	Locale['es'] = i18n.createLocale('din5008_optional', 'es');
 	Locale['en'] = i18n.createLocale('us', 'en');
-	Locale['en_GB'] = i18n.createLocale('eu', 'en');
+	Locale['en_GB'] = i18n.createLocale('din5008_optional', 'en');
 	Locale['en_AU'] = Locale['en_GB'];
-	Locale['de'] = i18n.createLocale('eu', 'de');
+	Locale['de'] = i18n.createLocale('din5008_optional', 'de');
 	Locale['de_optional'] = i18n.createLocale('din5008_optional', 'de');
 	Locale['es_iso8601'] = i18n.createLocale('iso8601', 'es');
 	Locale['en_iso8601'] = i18n.createLocale('iso8601', 'en');
 	Locale['de_iso8601'] = i18n.createLocale('iso8601', 'de');
+	/* acceptable locales for FusionForge */
+	Locale['american'] = i18n.createLocale('us', 'en');
+	Locale['dmy'] = i18n.createLocale('din5008_optional', 'en');
+	Locale['mdy'] = i18n.createLocale('mdy', 'en');
+	Locale['ymd'] = i18n.createLocale('iso8601', 'en');
+	Locale['dmy_es'] = i18n.createLocale('din5008_optional', 'es');
+	Locale['mdy_es'] = i18n.createLocale('mdy', 'es');
+	Locale['ymd_es'] = i18n.createLocale('iso8601', 'es');
+	Locale['dmy_de'] = i18n.createLocale('din5008_optional', 'de');
+	Locale['mdy_de'] = i18n.createLocale('mdy', 'de');
+	Locale['ymd_de'] = i18n.createLocale('iso8601', 'de');
+	Locale['dmy_fr'] = i18n.createLocale('din5008_optional', 'fr');
+	Locale['mdy_fr'] = i18n.createLocale('mdy', 'fr');
+	Locale['ymd_fr'] = i18n.createLocale('iso8601', 'fr');
+	Locale['dmy_it'] = i18n.createLocale('din5008_optional', 'it');
+	Locale['mdy_it'] = i18n.createLocale('mdy', 'it');
+	Locale['ymd_it'] = i18n.createLocale('iso8601', 'it');
+	Locale['dmy_nl'] = i18n.createLocale('din5008_optional', 'nl');
+	Locale['mdy_nl'] = i18n.createLocale('mdy', 'nl');
+	Locale['ymd_nl'] = i18n.createLocale('iso8601', 'nl');
+	Locale['dmy_pl'] = i18n.createLocale('din5008_optional', 'pl');
+	Locale['mdy_pl'] = i18n.createLocale('mdy', 'pl');
+	Locale['ymd_pl'] = i18n.createLocale('iso8601', 'pl');
+	Locale['dmy_pt'] = i18n.createLocale('din5008_optional', 'pt');
+	Locale['mdy_pt'] = i18n.createLocale('mdy', 'pt');
+	Locale['ymd_pt'] = i18n.createLocale('iso8601', 'pt');
+	Locale['dmy_ro'] = i18n.createLocale('din5008_optional', 'ro');
+	Locale['mdy_ro'] = i18n.createLocale('mdy', 'ro');
+	Locale['ymd_ro'] = i18n.createLocale('iso8601', 'ro');
+	Locale['dmy_bg'] = i18n.createLocale('din5008_optional', 'bg');
+	Locale['mdy_bg'] = i18n.createLocale('mdy', 'bg');
+	Locale['ymd_bg'] = i18n.createLocale('iso8601', 'bg');
+	Locale['dmy_ru'] = i18n.createLocale('din5008_optional', 'ru');
+	Locale['mdy_ru'] = i18n.createLocale('mdy', 'ru');
+	Locale['ymd_ru'] = i18n.createLocale('iso8601', 'ru');
+	Locale['dmy_hu'] = i18n.createLocale('din5008_optional', 'hu');
+	Locale['mdy_hu'] = i18n.createLocale('mdy', 'hu');
+	Locale['ymd_hu'] = i18n.createLocale('iso8601', 'hu');
+	Locale['dmy_no'] = i18n.createLocale('din5008_optional', 'no');
+	Locale['mdy_no'] = i18n.createLocale('mdy', 'no');
+	Locale['ymd_no'] = i18n.createLocale('iso8601', 'no');
 }
 
 Control.DatePicker.Language = {
@@ -270,26 +328,144 @@
 		strings: {
 			'Now': 'Ahora',
 			'Today': 'Hoy',
-			'Time': 'Hora',
+			'Hour': 'Hora',
+			'Minute': 'Minuto',
 			'Exact minutes': 'Minuto exacto',
-			'Select Date and Time': 'Selecciona Dia y Hora',
-			'Select Time': 'Selecciona Hora',
 			'Open calendar': 'Abre calendario'
 		}
 	},
-	'de': { 
-		months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 
-		days: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], 
-		strings: { 
-			'Now': 'Jetzt', 
-			'Today': 'Heute', 
-			'Time': 'Zeit', 
-			'Exact minutes': 'Exakte minuten', 
-			'Select Date and Time': 'Zeit und Datum Auswählen',
-			'Select Time': 'Zeit Auswählen',
+	'fr': {
+		months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
+		days: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
+		strings: {
+			'Now': 'Maintenant',
+			'Today': "Aujourd'hui",
+			'Hour': 'Heure',
+			'Minute': 'Minute',
+			'Exact minutes': 'Minutes exactes',
+			'Open calendar': 'Ouvrir calendrier'
+		}
+	},
+	'it': {
+		months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],
+		days: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'],
+		strings: {
+			'Now': 'Adesso',
+			'Today': 'Oggi',
+			'Hour': 'Ora',
+			'Minute': 'Minuto',
+			'Exact minutes': 'Minuti esatti',
+			'Open calendar': 'Apri calendario'
+		}
+	},
+	'nl': {
+		months: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'],
+		days: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'],
+		strings: {
+			'Now': 'Nu',
+			'Today': 'Vandaag',
+			'Hour': 'Uur',
+			'Minute': 'Minuut',
+			'Exact minutes': 'Exacte minuten',
+			'Open calendar': 'Kalender openen'
+		}
+	},
+	'pl': {
+		months: ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'],
+		days: ['Ni', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'],
+		strings: {
+			'Now': 'Teraz',
+			'Today': 'Dzisiaj',
+			'Hour': 'Godzina',
+			'Minute': 'Minuta',
+			'Exact minutes': 'Dokładnie Minut',
+			'Open calendar': 'Otwórz Kalendarz'
+		}
+	},
+	'pt': {
+		months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Decembro'],
+		days: ['Do', 'Se', 'Te', 'Qu', 'Qu', 'Se', 'Sa'],
+		strings: {
+			'Now': 'Agora',
+			'Today': 'Hoje',
+			'Hour': 'Hora',
+			'Minute': 'Minuto',
+			'Exact minutes': 'Minutos exatos',
+			'Open calendar': 'Abrir calendário'
+		}
+	},
+	'ro': {
+		months: ['Ianuarie', 'Februarie', 'Martie', 'Aprilie', 'Mai', 'Iunie', 'Iulie', 'August', 'Septembrie', 'Octombrie', 'Noiembrie', 'Decembrie'],
+		days: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'],
+		strings: {
+			'Now': 'Acum',
+			'Today': 'Mâine',
+			'Hour': 'Oră',
+			'Minute': 'Minut',
+			'Exact minutes': 'Minutele exacte',
+			'Open calendar': 'Deschideţi calendarul'
+		}
+	},
+	'bg': {
+		months: ['Януари', 'Февруари', 'Март', 'Април', 'Май', 'Юни', 'Юли', 'Август', 'Септември', 'Октомври', 'Ноември', 'Декември'],
+		days: ['Не', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
+		strings: {
+			'Now': 'Сега',
+			'Today': 'Днес',
+			'Hour': 'Час',
+			'Minute': 'Минута',
+			'Exact minutes': 'точност до минути',
+			'Open calendar': 'Отвори календара'
+		}
+	},
+	'ru': {
+		months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
+		days: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
+		strings: {
+			'Now': 'Сейчас',
+			'Today': 'Сегодня',
+			'Hour': 'Час',
+			'Minute': 'Минута',
+			'Exact minutes': 'Точные минуты',
+			'Open calendar': 'Открыть календарь'
+		}
+	},
+	'hu': {
+		months: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
+		days: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
+		strings: {
+			'Now': 'Most',
+			'Today': 'Ma',
+			'Hour': 'Óra',
+			'Minute': 'Perc',
+			'Exact minutes': 'Pontos perc',
+			'Open calendar': 'Naptár megnyitása'
+		}
+	},
+	'no': {
+		months: ['Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'],
+		days: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
+		strings: {
+			'Now': 'Nå',
+			'Today': 'I dag',
+			'Hour': 'Time',
+			'Minute': 'Minutt',
+			'Exact minutes': 'Eksakte minutter',
+			'Open calendar': 'Åpen kalender'
+		}
+	},
+	'de': {
+		months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
+		days: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+		strings: {
+			'Now': 'Jetzt',
+			'Today': 'Heute',
+			'Hour': 'Stunde',
+			'Minute': 'Minute',
+			'Exact minutes': 'minutengenau',
 			'Open calendar': 'Kalender öffnen'
 		}
-	}	
+	}
 };
 
 Control.DatePickerPanel = Class.create();
@@ -347,7 +523,7 @@
 		this.documentKeyListener = this.keyHandler.bindAsEventListener(this);
 		if (this.options.captureKeys)
 			this.captureKeys();
-		
+
 		return elt;
 	},
 	tr: function(str) {
@@ -390,7 +566,7 @@
 				adjTable.cellSpacing = 0;
 				adjTable.cellPadding = 0;
 				adjTable.border = 0;
-				
+
 				row = adjTable.insertRow(0);
 
 				cell = row.insertCell(0);
@@ -412,14 +588,8 @@
 				container.appendChild(adjTable);
 
 				row = timeTable.insertRow(rows++);
-				row.className = 'monthLabel';
 				cell = row.insertCell(0);
 				cell.colSpan = rowwidth;
-				cell.innerHTML = this.tr('Time');
-
-				row = timeTable.insertRow(rows++);
-				cell = row.insertCell(0);
-				cell.colSpan = rowwidth;
 				cell.style.height = '1px';
 
 			} else {
@@ -428,6 +598,8 @@
 				var rows = calTable.rows.length;
 
 				if (this.options.datePicker) {
+					rowwidth = 7;
+
 					row = timeTable.insertRow(rows++);
 					cell = row.insertCell(0);
 					cell.colSpan = rowwidth;
@@ -438,6 +610,12 @@
 				}
 			}
 
+			row = timeTable.insertRow(rows++);
+			row.className = 'hoursLabel';
+			cell = row.insertCell(0);
+			cell.colSpan = rowwidth;
+			cell.innerHTML = this.tr('Hour');
+
 			var hourrows = this.options.use24hrs ? 4 : 2;
 			for (var j = 0; j < hourrows; ++j) {
 				row = timeTable.insertRow(rows++);
@@ -467,13 +645,19 @@
 
 			row = timeTable.insertRow(rows++);
 			cell = row.insertCell(0);
-			cell.colSpan = 6;
+			cell.colSpan = rowwidth;
 
 			var hr = document.createElement('hr');
 			Element.setStyle(hr, {'color': '#CCCCCC', 'backgroundColor': '#CCCCCC', 'height': '1px', 'border': '0', 'marginTop': '2px', 'marginBottom': '2px', 'padding': '0'});
 			cell.appendChild(hr);
 			cell = row.insertCell(1);
 
+			row = timeTable.insertRow(rows++);
+			row.className = 'minutesLabel';
+			cell = row.insertCell(0);
+			cell.colSpan = rowwidth;
+			cell.innerHTML = this.tr('Minute');
+
 			for (var j = 0; j < (10/this.minInterval); ++j) {
 				row = timeTable.insertRow(rows++);
 				for (var i = 0; i < 6; ++i){
@@ -543,10 +727,7 @@
 
 			selectButton = document.createElement('input');
 			selectButton.type = 'button';
-			if (this.options.datePicker)
-				selectButton.value = this.tr('Select Date and Time');
-			else
-				selectButton.value = this.tr('Select Time');
+			selectButton.value = 'OK';
 			selectButton.onclick = function(e) {
 						this.options.onSelect && this.options.onSelect(this.currentDate);
 					}.bindAsEventListener(this);
@@ -628,7 +809,7 @@
 			cell.width = '14%';
 			cell.innerHTML = this.dayName((this.options.firstWeekDay + i) % 7);
 		}
-		
+
 		row = null;
 		var workDate = new Date(date.getFullYear(), date.getMonth(), 1);
 		var day = workDate.getDay();
@@ -878,7 +1059,7 @@
 					this.setDate(date);
 				else
 					this.currentDate = date;
-				
+
 				if (date.getDate() < this.currentDays.length) {
 					if (this.selectedDay)
 						Element.removeClassName(this.selectedDay, 'current');
@@ -906,12 +1087,12 @@
 				if (this.selectedMinute)
 					Element.removeClassName(this.selectedMinute, 'current');
 				Element.removeClassName(this.otherMinutes, 'current');
+				this.otherMinutes.value = minutes;
 				if (minutes % this.minInterval == 0) {
-					this.otherMinutes.value = '';
+//					this.otherMinutes.value = '';
 					this.selectedMinute = this.minuteCells[minutes / this.minInterval];
 					Element.addClassName(this.selectedMinute, 'current');
 				} else {
-					this.otherMinutes.value = minutes;
 					Element.addClassName(this.otherMinutes, 'current');
 				}
 			}

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/themes/css/datepicker.css
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/themes/css/datepicker.css	2011-11-02 14:07:24 UTC (rev 17681)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/themes/css/datepicker.css	2011-11-02 14:07:28 UTC (rev 17682)
@@ -111,3 +111,17 @@
 .datepickerControl td.current:hover {
 	background-color:		#EBC2C0;
 }
+
+.datepickerControl tr.hoursLabel td {
+	border:				1px solid #003366;
+	background-color:		#003366;
+	color:				white;
+	font-weight:			bold;
+}
+
+.datepickerControl tr.minutesLabel td {
+	border:				1px solid #003366;
+	background-color:		#003366;
+	color:				white;
+	font-weight:			bold;
+}



More information about the evolvis-commits mailing list