Author: pyaschenko
Date: 2007-07-19 12:47:25 -0400 (Thu, 19 Jul 2007)
New Revision: 1705
Modified:
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
branches/3.0.2/sandbox/scrollable-grid/pom.xml
Log:
Modified:
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
---
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-19
16:28:21 UTC (rev 1704)
+++
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-19
16:47:25 UTC (rev 1705)
@@ -132,6 +132,16 @@
// showWeekDaysBar - show WeekDays Bar [default value is true]
// showWeeksBar - show Weeks numbers bar [default value is true]
+ // headerHtml - user defined header (optional)
+ // footeHtml - user defined footer (optional)
+
+ // direction - [top-left, top-right, bottom-left, bottom-right, auto]
+ // jointPoint
+ // popup - true
+ // userClasses - inputClass, inputDisabledClass, inputInvalidClass, buttonClass,
buttonDisabledClass
+ // id+PopupButton, id+PopupInput,
+
+
this.id = id;
this.params = parameters;
if (!this.params.showWeekDaysBar) this.params.showWeekDaysBar = true;
@@ -161,8 +171,11 @@
var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate"
name="'+this.id+'InputSelectedDate" type="hidden"
value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n'
+
'<input id="'+this.id+'InputCurrentDate"
name="'+this.id+'InputCurrentDate" type="hidden"
value="'+this.getCurrentDate().format("MM/y")+'"/>\n'
+
'<table border="0" cellpadding="0"
cellspacing="0" class="calendar_exterior"><tbody>\n';
- var htmlControlsHeader = '<tr><th colspan="8"
id="'+this.id+':header"></th></tr>'
- var htmlControlsFooter = '<tr><th colspan="8"
id="'+this.id+':footer"></th></tr>'
+ var colspan = (this.params.showWeeksBar ? "8" : "7");
+ var htmlHeaderOptional = (this.params.headerHtml &&
this.params.headerHtml!='') ? '<tr><td
class="calendar_header"
colspan="'+colspan+'">'+this.params.headerHtml+'</td></tr>'
: '';
+ var htmlFooterOptional = (this.params.footerHtml &&
this.params.footerHtml!='') ? '<tr><td
class="calendar_footer"
colspan="'+colspan+'">'+this.params.footerHtml+'</td></tr>'
: '';
+ var htmlControlsHeader = '<tr><td colspan="'+colspan+'"
id="'+this.id+':header"></td></tr>'
+ var htmlControlsFooter = '<tr><td colspan="'+colspan+'"
id="'+this.id+':footer"></td></tr>'
var htmlTextFooter = '</tbody></table>\n';
// days bar creation
@@ -220,7 +233,7 @@
var obj=$(id);
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
- obj.innerHTML =
htmlTextHeader+Calendar.headerOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+Calendar.footerOptional+htmlTextFooter;
+ obj.innerHTML =
htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter;
this.submitFunction = this.params.submitFunction.bind(this);
this.prepareEvents();
@@ -247,7 +260,7 @@
getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
if (!pattern) pattern = "dd/MM/y";
- return this.selectedDate.format(pattern);
+ return this.selectedDate.format(pattern, this.params.monthLabels,
this.params.monthLabelsShort);
},
getPrevYear: function() {
@@ -647,14 +660,14 @@
return Calendar.getControl(context, null, "�", "prevMonth");
};
Calendar.currentMonthControl = function(context) {
- var value =context.calendar.getCurrentDate().format("MMMM, y");
+ var value =context.calendar.getCurrentDate().format("MMMM, y",
context.monthLabels, context.monthLabelsShort);
return value;
};
Calendar.todayControl = function(context) {
return Calendar.getControl(context, null, "Today", "today");
};
Calendar.selectedDateControl = function(context) {
- var value = context.calendar.getSelectedDateString(context.calendar.params.datePattern);
+ var value = Calendar.getControl(context, null,
context.calendar.getSelectedDateString(context.calendar.params.datePattern),
"prevMonth");
return value;
};
Calendar.helpControl = function(context)
@@ -662,8 +675,6 @@
return Calendar.getControl(context, null, "Help", "help");
};
-Calendar.headerOptional ='<tr><td class="calendar_header"
colspan="8">Optional Header</td></tr>';
-Calendar.footerOptional ='<tr><td class="calendar_footer"
colspan="8">Optional Footer</td></tr>';
Calendar.header =
new E('table',{'border': '0', 'cellpadding':
'0', 'cellspacing': '0', 'width': '100%'},
@@ -726,6 +737,8 @@
Object.extend(CalendarContext.prototype, {
initialize: function(calendar) {
this.calendar=calendar;
+ this.monthLabels=calendar.params.monthLabels;
+ this.monthLabelsShort=calendar.params.monthLabelsShort;
},
nextYearControl: Calendar.nextYearControl,
@@ -735,5 +748,5 @@
currentMonthControl: Calendar.currentMonthControl,
todayControl: Calendar.todayControl,
selectedDateControl: Calendar.selectedDateControl,
- helpControl: Calendar.helpControl
+ helpControl: Calendar.helpControl,
});
\ No newline at end of file
Modified:
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
---
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-19
16:28:21 UTC (rev 1704)
+++
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-19
16:47:25 UTC (rev 1705)
@@ -28,9 +28,12 @@
currentDate: new Date(2007,6,1),
selectedDate: new Date(2007,4,5),
weekDayLabels:
['Sun','Mon','Tue','Wen','Thu','Fri','Sat'],
- monthLabels: ['Jan', 'Feb', 'Mar', 'Apr',
'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
'Nov', 'Dec'],
+ monthLabels: ['January', 'February', 'March',
'April', 'May', 'June', 'July', 'August',
'September', 'October', 'November', 'December'],
+ monthLabelsShort: ['Jan', 'Feb', 'Mar', 'Apr',
'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
'Nov', 'Dec'],
firstWeekDay: 0,
minDaysInFirstWeek: 4,
+ headerHtml: '<b>User defined header</b>',
+ footerHtml: 'User defined footer',
dayListMarkup:
<jsp:scriptlet>/*<![CDATA[*/
if (component.getChildCount() != 0) {
Modified: branches/3.0.2/sandbox/scrollable-grid/pom.xml
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/pom.xml 2007-07-19 16:28:21 UTC (rev 1704)
+++ branches/3.0.2/sandbox/scrollable-grid/pom.xml 2007-07-19 16:47:25 UTC (rev 1705)
@@ -7,7 +7,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
<artifactId>scrollable-grid</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>