JBoss Rich Faces SVN: r7628 - branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-04-07 08:33:10 -0400 (Mon, 07 Apr 2008)
New Revision: 7628
Modified:
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-2706
Modified: branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-04-07 11:43:46 UTC (rev 7627)
+++ branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-04-07 12:33:10 UTC (rev 7628)
@@ -868,6 +868,7 @@
isWithin : function(event){
var within = true;
var targetElement = event.relatedTarget;
+ while (targetElement.nodeType!=1) targetElement = targetElement.parentNode;
var srcElement = event.target;
var layer = $(this.id);
if (targetElement) {
@@ -1200,7 +1201,7 @@
var within = false;
Event.extend(event);
var targetElement = event.relatedTarget;
- var srcElement = Event.element(event);
+ while (targetElement.nodeType!=1) targetElement = targetElement.parentNode;
if (targetElement) {
within = targetElement == element ||
16 years, 9 months
JBoss Rich Faces SVN: r7627 - branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-04-07 07:43:46 -0400 (Mon, 07 Apr 2008)
New Revision: 7627
Modified:
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
http://jira.jboss.com/jira/browse/RF-2975
Modified: branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 11:39:47 UTC (rev 7626)
+++ branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 11:43:46 UTC (rev 7627)
@@ -2031,8 +2031,8 @@
var date = new Date(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate(), h, m, 0);
if (date-this.selectedDate && this.invokeEvent("timeselect",null, null, date))
{
+ this.selectedDate = date;
this.renderHF();
- this.selectedDate = date;
this.invokeEvent("timeselected",null, null, this.selectedDate);
}
}
16 years, 9 months
JBoss Rich Faces SVN: r7626 - in branches/3.1.x: ui/calendar/src/main/config/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-04-07 07:39:47 -0400 (Mon, 07 Apr 2008)
New Revision: 7626
Modified:
branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2729
Modified: branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2008-04-07 10:58:06 UTC (rev 7625)
+++ branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2008-04-07 11:39:47 UTC (rev 7626)
@@ -46,6 +46,11 @@
<calendar:calendar popup="false"/>
<br />
<calendar:calendar
+ onchanged = "alert('changed:'+this.value);"
+ ontimeselected = "alert('time selectED:'+event.rich.date.toString());"
+ ontimeselect = "alert('time select:'+event.rich.date.toString());"
+ ondateselected = "alert('date selectED:'+event.rich.date.toString());"
+ ondateselect = "alert('date select:'+event.rich.date.toString());"
id="calendar"
dataModel="#{calendarDataModel}"
locale="#{calendarBean.locale}"
Modified: branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml 2008-04-07 10:58:06 UTC (rev 7625)
+++ branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml 2008-04-07 11:39:47 UTC (rev 7626)
@@ -315,6 +315,21 @@
<description>onDateSelected event handler</description>
</property>
<property>
+ <name>ontimeselect</name>
+ <classname>java.lang.String</classname>
+ <description>onTimeSelect event handler</description>
+ </property>
+ <property>
+ <name>ontimeselected</name>
+ <classname>java.lang.String</classname>
+ <description>onTimeSelected event handler</description>
+ </property>
+ <property>
+ <name>onchanged</name>
+ <classname>java.lang.String</classname>
+ <description>onChanged event handler</description>
+ </property>
+ <property>
<name>oncurrentdateselect</name>
<classname>java.lang.String</classname>
<description>onCurrentDateSelect event handler</description>
Modified: branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 10:58:06 UTC (rev 7625)
+++ branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 11:39:47 UTC (rev 7626)
@@ -1106,7 +1106,7 @@
var element = $(this.id);
- if (this.invokeEvent("expand", element))
+ if (this.invokeEvent("expand", element, e))
{
var iframe=null;
@@ -1118,7 +1118,7 @@
if (baseInput && baseInput.value!=undefined)
{
- this.selectDate(baseInput.value);
+ this.selectDate(baseInput.value, false, {event:e, element:element});
}
//rect calculation
@@ -1181,6 +1181,16 @@
return true;
},
+
+ setInputField: function(dateStr, event)
+ {
+ var field = $(this.INPUT_DATE_ID);
+ if (field.value!=dateStr)
+ {
+ field.value=dateStr;
+ this.invokeEvent("changed",field, event, this.selectedDate);
+ }
+ },
getCurrentDate: function() {
return this.currentDate;
@@ -1281,9 +1291,20 @@
{
var date=new Date(this.currentDate);
date.setDate(daydata.day);
-
- if (this.selectDate(date,true) && !this.showApplyButton)
+ if (this.timeType)
{
+ if (this.selectedDate)
+ {
+ date.setHours(this.selectedDate.getHours());
+ date.setMinutes(this.selectedDate.getMinutes());
+ } else
+ {
+ date.setHours(12);
+ }
+ }
+
+ if (this.selectDate(date,true, {event:e, element:obj}) && !this.showApplyButton)
+ {
this.doCollapse();
}
@@ -1292,8 +1313,21 @@
if (daydata._month==-1) this.prevMonth(); else this.nextMonth();
else if (this.params.boundaryDatesMode == "select")
{
- if (this.selectDate(daydata.date) && !this.showApplyButton)
+ var date = new Date(daydata.date);
+ if (this.timeType)
{
+ if (this.selectedDate)
+ {
+ date.setHours(this.selectedDate.getHours());
+ date.setMinutes(this.selectedDate.getMinutes());
+ } else
+ {
+ date.setHours(12);
+ }
+ }
+
+ if (this.selectDate(date, false, {event:e, element:obj}) && !this.showApplyButton)
+ {
this.doCollapse();
}
}
@@ -1755,10 +1789,23 @@
if (this.todayCellId)
{
var daydata = this.days[parseInt($(this.todayCellId).id.substr(this.DATE_ELEMENT_ID.length),10)];
- if (daydata.enabled && this.selectDate(new Date(),true) && !this.showApplyButton)
+ var today = new Date();
+ var date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
+ if (this.timeType)
{
+ if (this.selectedDate)
+ {
+ date.setHours(this.selectedDate.getHours());
+ date.setMinutes(this.selectedDate.getMinutes());
+ } else
+ {
+ date.setHours(12);
+ }
+ }
+ if (daydata.enabled && this.selectDate(date,true) && !this.showApplyButton)
+ {
this.doCollapse();
- }
+ }
}
},
@@ -1776,13 +1823,11 @@
var oldSelectedDate = this.selectedDate;
var newSelectedDate;
- var isDateParsed = false;
if (date)
{
if (typeof date=='string')
{
date = Richfaces.Calendar.parseDate(date,this.params.datePattern, this.params.monthLabels, this.params.monthLabelsShort);
- if (date) isDateParsed = true;
}
newSelectedDate = date;
}
@@ -1796,34 +1841,15 @@
var isDateChanged = false;
if ( (oldSelectedDate - newSelectedDate) && (oldSelectedDate!=null || newSelectedDate!=null) )
{
- isDateChanged = true
- flag = this.invokeEvent("dateselect", eventData.element, eventData.event, date)
+ isDateChanged = true;
+ flag = this.invokeEvent("dateselect", eventData.element, eventData.event, date);
}
if (flag)
{
- var field = $(this.INPUT_DATE_ID);
this.selectedDate = newSelectedDate;
if (this.selectedDate!=null)
{
- if (this.timeType && !isDateParsed)
- {
- if (oldSelectedDate!=null)
- {
- this.selectedDate.setHours(oldSelectedDate.getHours());
- this.selectedDate.setMinutes(oldSelectedDate.getMinutes());
-
- }
- else
- {
- this.selectedDate.setHours(12);
- this.selectedDate.setMinutes(0);
- }
- this.selectedDate.setSeconds(0);
- }
-
- if (!this.showApplyButton) field.value=this.getSelectedDateString(this.params.datePattern);
-
var d = new Date(this.selectedDate);
if (d.getMonth()==this.currentDate.getMonth() && d.getFullYear()==this.currentDate.getFullYear())
{
@@ -1855,7 +1881,6 @@
else
{
this.selectedDate = null;
- field.value = "";
this.clearEffect(this.selectedDateCellId, this.highlightEffect2, "rich-calendar-select", "rich-calendar-btn");
@@ -1881,6 +1906,10 @@
if (isDateChanged)
{
this.invokeEvent("dateselected", eventData.element, eventData.event, this.selectedDate);
+ if (!this.showApplyButton)
+ {
+ this.setInputField(this.selectedDate!=null ? this.getSelectedDateString(this.params.datePattern) : "", eventData.event);
+ }
}
}
@@ -1893,15 +1922,15 @@
if (this.invokeEvent("dateselect", null, null, null))
{
this.selectedDate = null;
+ this.invokeEvent("dateselected", null, null, null);
this.selectedDateCellId = this.clearEffect(this.selectedDateCellId, this.highlightEffect2, "rich-calendar-select", "rich-calendar-btn");
this.renderHF();
if (!this.showApplyButton)
{
- $(this.INPUT_DATE_ID).value = "";
+ this.setInputField("", null);
this.doCollapse();
- this.invokeEvent("dateselected", null, null, null);
}
}
},
@@ -1934,8 +1963,7 @@
{
if (updateDate)
{
- var field = $(this.INPUT_DATE_ID);
- field.value=this.getSelectedDateString(this.params.datePattern);
+ this.setInputField(this.getSelectedDateString(this.params.datePattern), null);
}
this.doCollapse();
},
@@ -1988,7 +2016,6 @@
if (updateTime && this.selectedDate)
{
var m = parseInt($(this.id+'TimeMinutes').value,10);
- this.selectedDate.setMinutes(m);
var h=parseInt($(this.id+'TimeHours').value,10);
if (this.timeType==2)
{
@@ -2001,8 +2028,13 @@
if (h!=12) h+=12;
}
}
- this.selectedDate.setHours(h);
- this.renderHF();
+ var date = new Date(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate(), h, m, 0);
+ if (date-this.selectedDate && this.invokeEvent("timeselect",null, null, date))
+ {
+ this.renderHF();
+ this.selectedDate = date;
+ this.invokeEvent("timeselected",null, null, this.selectedDate);
+ }
}
if (this.params.popup && !this.showApplyButton && updateTime) this.close(true);
Modified: branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-07 10:58:06 UTC (rev 7625)
+++ branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-07 11:39:47 UTC (rev 7626)
@@ -200,6 +200,9 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="ondateselected" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="ondateselect" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="ontimeselect" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="ontimeselected" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter value="onchanged" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseover" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseout" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="onexpand" /></f:call>
16 years, 9 months
JBoss Rich Faces SVN: r7625 - branches/3.1.x/ui/orderingList/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-07 06:58:06 -0400 (Mon, 07 Apr 2008)
New Revision: 7625
Modified:
branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml
Log:
http://jira.jboss.com/jira/browse/RF-2704
Modified: branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml 2008-04-07 10:53:14 UTC (rev 7624)
+++ branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml 2008-04-07 10:58:06 UTC (rev 7625)
@@ -143,30 +143,6 @@
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
- <name>sortIconUp</name>
- <classname>java.lang.String</classname>
- <description>
- Specifies an icon for a sorting marker in sorting 'up' position.
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>sortIconDown</name>
- <classname>java.lang.String</classname>
- <description>
- Specifies an icon for a sorting marker in sorting 'down' position.
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>sortIcon</name>
- <classname>java.lang.String</classname>
- <description>
- Specifies a default icon for a sorting marker in non-sorting position.
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
<name>orderControlsVisible</name>
<classname>boolean</classname>
<description>
@@ -313,7 +289,7 @@
A number of rows to display, or zero for all remaining rows in the list
</description>
</property>
- <property>
+ <property el="false" hidden="true">
<name>stateVar</name>
<classname>java.lang.String</classname>
<description>
16 years, 9 months
JBoss Rich Faces SVN: r7624 - branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-04-07 06:53:14 -0400 (Mon, 07 Apr 2008)
New Revision: 7624
Modified:
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
http://jira.jboss.com/jira/browse/RF-2976
Modified: branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 10:40:19 UTC (rev 7623)
+++ branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 10:53:14 UTC (rev 7624)
@@ -974,7 +974,7 @@
createSpinnerTable: function(id) {
return '<table cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
'<td class="rich-calendar-spinner-input-container">'+
- '<input id="' + id + '" class="rich-calendar-spinner-input" type="text" />'+
+ '<input id="' + id + '" name="' + id + '" class="rich-calendar-spinner-input" type="text" />'+
'</td>'+
'<td class="rich-calendar-spinner-buttons">'+
'<table border="0" cellspacing="0" cellpadding="0"><tbody>'+
16 years, 9 months
JBoss Rich Faces SVN: r7623 - in branches/3.1.x: samples/calendar-sample/src/main/webapp/pages and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-04-07 06:40:19 -0400 (Mon, 07 Apr 2008)
New Revision: 7623
Modified:
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml
branches/3.1.x/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2554
Modified: branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2008-04-06 19:53:31 UTC (rev 7622)
+++ branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2008-04-07 10:40:19 UTC (rev 7623)
@@ -55,6 +55,8 @@
private String direction;
private String boundary;
private String todayControlMode;
+ private boolean showHeader;
+ private boolean showFooter;
private int counter;
@@ -256,4 +258,20 @@
public void setTodayControlMode(String todayControlMode) {
this.todayControlMode = todayControlMode;
}
+
+ public boolean isShowHeader() {
+ return showHeader;
+ }
+
+ public void setShowHeader(boolean showHeader) {
+ this.showHeader = showHeader;
+ }
+
+ public boolean isShowFooter() {
+ return showFooter;
+ }
+
+ public void setShowFooter(boolean showFooter) {
+ this.showFooter = showFooter;
+ }
}
\ No newline at end of file
Modified: branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2008-04-06 19:53:31 UTC (rev 7622)
+++ branches/3.1.x/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2008-04-07 10:40:19 UTC (rev 7623)
@@ -21,6 +21,11 @@
background-color: #0087FF;
}
</style>
+ <script>
+ var statusStart = 0;
+ var statusStop = 0;
+ var supportComplete = 0;
+ </script>
</head>
<body>
<f:view>
@@ -28,6 +33,7 @@
<h:messages showDetail="true" showSummary="true"/>
</a4j:outputPanel>
<h:form>
+ <a4j:commandLink value="Click" oncomplete="alert('supportComplete: '+(++supportComplete));" />
<h:panelGroup id="counter">
<h:outputText value="#{calendarBean.counter}" />
</h:panelGroup>
@@ -36,8 +42,9 @@
<h:selectOneRadio binding="#{skinBean.component}" />
<h:commandLink action="#{skinBean.change}" value="set skin" />
</h:panelGrid>
- <br />
<br />
+ <calendar:calendar popup="false"/>
+ <br />
<calendar:calendar
id="calendar"
dataModel="#{calendarDataModel}"
@@ -56,6 +63,8 @@
boundaryDatesMode="#{calendarBean.boundary}"
currentDateChangeListener="#{calendarBean.dcl}"
valueChangeListener="#{calendarBean.ddd}"
+ showHeader="#{calendarBean.showHeader}"
+ showFooter="#{calendarBean.showFooter}"
reRender="counter"
inputClass="ic"
buttonClass="bc"
@@ -103,8 +112,13 @@
<h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}" onclick="submit()"/>
<h:outputText value="Show Apply Button:" />
<h:selectBooleanCheckbox value="#{calendarBean.showApplyButton}" onclick="submit()"/>
+ <h:outputText value="Show Header:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.showHeader}" onclick="submit()"/>
+ <h:outputText value="Show Footer:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.showFooter}" onclick="submit()"/>
<h:outputText value="Select Date Pattern:"/>
<h:selectOneMenu value="MMM d, yyyy" onchange="submit()" valueChangeListener="#{calendarBean.selectPattern}">
+ <f:selectItem itemLabel="yyyyMMdd" itemValue="yyyyMMdd"/>
<f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy"/>
<f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy"/>
<f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y"/>
Modified: branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml 2008-04-06 19:53:31 UTC (rev 7622)
+++ branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml 2008-04-07 10:40:19 UTC (rev 7623)
@@ -510,14 +510,6 @@
<defaultvalue>true</defaultvalue>
</property>
<property>
- <name>showScrollerBar</name>
- <classname>boolean</classname>
- <description>
- If false this bar should not be shown
- </description>
- <defaultvalue>true</defaultvalue>
- </property>
- <property>
<name>todayControlMode</name>
<classname>java.lang.String</classname>
<description>
@@ -543,7 +535,22 @@
<classname>java.lang.String</classname>
<description>A localized user presentable name for this component.</description>
</property>
-
+ <property>
+ <name>showHeader</name>
+ <classname>boolean</classname>
+ <description>
+ If false Calendar's header should not be shown
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
+ <name>showFooter</name>
+ <classname>boolean</classname>
+ <description>
+ If false Calendar's footer should not be shown
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
</component>
&listeners;
</components>
Modified: branches/3.1.x/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- branches/3.1.x/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-04-06 19:53:31 UTC (rev 7622)
+++ branches/3.1.x/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-04-07 10:40:19 UTC (rev 7623)
@@ -189,10 +189,14 @@
public abstract void setShowWeeksBar(boolean showWeeksBar);
- public abstract boolean isShowScrollerBar();
+ public abstract boolean isShowHeader();
+
+ public abstract void setShowHeader(boolean showScrollerBar);
+
+ public abstract boolean isShowFooter();
+
+ public abstract void setShowFooter(boolean showScrollerBar);
- public abstract void setShowScrollerBar(boolean showScrollerBar);
-
public abstract String getTodayControlMode();
public abstract void setTodayControlMode(String todayControlMode);
Modified: branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-06 19:53:31 UTC (rev 7622)
+++ branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-07 10:40:19 UTC (rev 7623)
@@ -549,6 +549,8 @@
// showWeekDaysBar - show WeekDays Bar [default value is true]
// showWeeksBar - show Weeks numbers bar [default value is true]
// showApplyButton
+ // showHeader
+ // showFooter
// POPUP description
// direction - [top-left, top-right, bottom-left, bottom-right, auto]
@@ -664,8 +666,8 @@
var colspan = (this.params.showWeeksBar ? "8" : "7");
var htmlHeaderOptional = (this.params.optionalHeaderMarkup) ? '<tr><td class="rich-calendar-header-optional" colspan="'+colspan+'" id="'+this.id+'HeaderOptional"></td></tr>' : '';
var htmlFooterOptional = (this.params.optionalFooterMarkup) ? '<tr><td class="rich-calendar-footer-optional" colspan="'+colspan+'" id="'+this.id+'FooterOptional"></td></tr>' : '';
- var htmlControlsHeader = '<tr><td class="rich-calendar-header" colspan="'+colspan+'" id="'+this.id+'Header"></td></tr>';
- var htmlControlsFooter = '<tr><td class="rich-calendar-footer" colspan="'+colspan+'" id="'+this.id+'Footer"></td></tr>';
+ var htmlControlsHeader = (this.params.showHeader ? '<tr><td class="rich-calendar-header" colspan="'+colspan+'" id="'+this.id+'Header"></td></tr>' : '');
+ var htmlControlsFooter = (this.params.showFooter ? '<tr><td class="rich-calendar-footer" colspan="'+colspan+'" id="'+this.id+'Footer"></td></tr>' : '');
var htmlTextFooter = '</tbody></table>\n'
var htmlTextIFrame = '<iframe src="javascript:\'\'" frameborder="0" scrolling="no" id="' + this.IFRAME_ID + '" style="display:none; position: absolute; width: 1px; height: 1px; background-color:white;">'+'</iframe>\n';
@@ -1615,8 +1617,8 @@
renderHF: function()
{
- this.renderMarkup(this.params.headerMarkup, this.id+"Header", this.calendarContext);
- this.renderMarkup(this.params.footerMarkup, this.id+"Footer", this.calendarContext);
+ if (this.params.showHeader) this.renderMarkup(this.params.headerMarkup, this.id+"Header", this.calendarContext);
+ if (this.params.showFooter) this.renderMarkup(this.params.footerMarkup, this.id+"Footer", this.calendarContext);
},
renderHeaderOptional: function()
Modified: branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-06 19:53:31 UTC (rev 7622)
+++ branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-07 10:40:19 UTC (rev 7623)
@@ -184,7 +184,8 @@
firstWeekDay: #{this:getFirstWeekDay(context, component)},
minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
todayControlMode:'#{component.attributes["todayControlMode"]}',
- showScrollerBar:#{component.attributes['showScrollerBar']},
+ showHeader:#{component.attributes['showHeader']},
+ showFooter:#{component.attributes['showFooter']},
showWeeksBar:#{component.attributes['showWeeksBar']},
showWeekDaysBar:#{component.attributes['showWeekDaysBar']},
showApplyButton:#{component.attributes['showApplyButton']}
16 years, 9 months
JBoss Rich Faces SVN: r7622 - trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-06 15:53:31 -0400 (Sun, 06 Apr 2008)
New Revision: 7622
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
Log:
http://jira.jboss.com/jira/browse/RF-2944
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2008-04-06 16:44:18 UTC (rev 7621)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2008-04-06 19:53:31 UTC (rev 7622)
@@ -27,6 +27,7 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
+import java.io.StringReader;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -37,6 +38,7 @@
import java.util.List;
import java.util.Set;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
@@ -56,6 +58,7 @@
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -69,6 +72,8 @@
private File resourcesConfig;
private File templatesDirectory;
+ private static final SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+
public ResourcesConfigGenerator(JSFGeneratorConfiguration task, Logger log) {
super(task, log);
}
@@ -262,6 +267,50 @@
}
}
+ private void parseXCSSResource(String resourcePath, final ResourcesConfigGeneratorBean bean) throws SAXException, IOException, ParserConfigurationException {
+ InputStream resourceStream = getClassLoader().getResourceAsStream(resourcePath);
+ if (resourceStream != null) {
+ debug("XCSS file exists in classpath");
+
+ try {
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(resourceStream, new DefaultHandler() {
+ @Override
+ public void startElement(String uri,
+ String localName, String name,
+ Attributes attributes)
+ throws SAXException {
+
+ super.startElement(uri, localName, name, attributes);
+
+ if ("f:resource".equals(name)) {
+ String value = attributes.getValue("f:key");
+
+ if (value != null) {
+ debug("Adding resource: " + value);
+
+ addResource(value, "", bean);
+ }
+ }
+ }
+ });
+
+ } finally {
+ try {
+ resourceStream.close();
+ } catch (IOException e) {
+ getLog().error(e.getLocalizedMessage(), e);
+ }
+ }
+ } else {
+ getLog().error("Resource " + resourcePath + " hasn't been found!");
+ }
+ }
+
+ private boolean isXCSSPath(String resourcePath) {
+ return resourcePath != null && resourcePath.endsWith(".xcss");
+ }
+
public void createFiles(BuilderConfig config) throws GeneratorException {
VelocityContext context = new VelocityContext();
Template template = getTemplate();
@@ -282,50 +331,66 @@
addResources(bean, rendererBean, config);
}
- Set<String> pathResourcesSet = new LinkedHashSet<String>(bean.getPathResources().values());
- for (Iterator<String> iterator = pathResourcesSet.iterator(); iterator
- .hasNext();) {
- String resourcePath = iterator.next();
-
- if (resourcePath != null && resourcePath.endsWith(".xcss")) {
- debug("XCSS file detected: " + resourcePath);
+ String includedContent = getIncludeContent();
+ if (includedContent != null && includedContent.length() != 0) {
+ String parseableContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-config>" + includedContent +
+ "</resource-config>";
+
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(new InputSource(new StringReader(parseableContent)), new DefaultHandler() {
+ private StringBuilder path;
- InputStream resourceStream = getClassLoader().getResourceAsStream(resourcePath);
- if (resourceStream != null) {
- debug("XCSS file exists in classpath");
+ @Override
+ public void startElement(String uri,
+ String localName, String name,
+ Attributes attributes)
+ throws SAXException {
- try {
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- SAXParser parser = parserFactory.newSAXParser();
- parser.parse(resourceStream, new DefaultHandler() {
- @Override
- public void startElement(String uri,
- String localName, String name,
- Attributes attributes)
- throws SAXException {
+ super.startElement(uri, localName, name, attributes);
+
+ if ("path".equals(name)) {
+ this.path = new StringBuilder();
+ }
+ }
+
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ if (this.path != null) {
+ this.path.append(ch, start, length);
+ }
+ };
+
+ @Override
+ public void endElement(String uri, String localName, String name) throws SAXException {
+ super.endElement(uri, localName, name);
- super.startElement(uri, localName, name, attributes);
-
- if ("f:resource".equals(name)) {
- String value = attributes.getValue("f:key");
-
- if (value != null) {
- debug("Adding resource: " + value);
-
- addResource(value, "", bean);
- }
- }
- }
- });
-
- } finally {
+ if ("resource".equals(name)) {
+ if (this.path != null && this.path.length() != 0) {
+ String resourcePath = this.path.toString().trim();
+ if (isXCSSPath(resourcePath)) {
+ debug("XCSS file detected: " + resourcePath);
try {
- resourceStream.close();
+ parseXCSSResource(resourcePath, bean);
} catch (IOException e) {
- getLog().error(e.getLocalizedMessage(), e);
+ throw new SAXException(e.getLocalizedMessage(), e);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e.getLocalizedMessage(), e);
}
+ }
}
+ this.path = null;
+ }
}
+ });
+ }
+
+ Set<String> pathResourcesSet = new LinkedHashSet<String>(bean.getPathResources().values());
+ for (Iterator<String> iterator = pathResourcesSet.iterator(); iterator
+ .hasNext();) {
+ String resourcePath = iterator.next();
+
+ if (isXCSSPath(resourcePath)) {
+ debug("XCSS file detected: " + resourcePath);
+ parseXCSSResource(resourcePath, bean);
}
}
16 years, 9 months
JBoss Rich Faces SVN: r7621 - in branches/3.1.x/ui: orderingList/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-06 12:44:18 -0400 (Sun, 06 Apr 2008)
New Revision: 7621
Modified:
branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
Log:
http://jira.jboss.com/jira/browse/RF-2414
Modified: branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-04-06 16:27:51 UTC (rev 7620)
+++ branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-04-06 16:44:18 UTC (rev 7621)
@@ -226,6 +226,8 @@
}
}
+ this.iterate(faces, decodeVisitor, argument);
+
if (isImmediate()) {
executeValidate(faces);
}
@@ -233,8 +235,6 @@
if (!isValid()) {
faces.renderResponse();
}
-
- this.iterate(faces, decodeVisitor, argument);
}
private final class ModelItemState implements ItemState {
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2008-04-06 16:27:51 UTC (rev 7620)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2008-04-06 16:44:18 UTC (rev 7621)
@@ -60,6 +60,8 @@
}
}
+ this.iterate(faces, decodeVisitor, argument);
+
if (isImmediate()) {
executeValidate(faces);
}
@@ -67,8 +69,6 @@
if (!isValid()) {
faces.renderResponse();
}
-
- this.iterate(faces, decodeVisitor, argument);
}
private ValueHolder valueHolder;
16 years, 9 months
JBoss Rich Faces SVN: r7620 - branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-06 12:27:51 -0400 (Sun, 06 Apr 2008)
New Revision: 7620
Modified:
branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-2128
http://jira.jboss.com/jira/browse/RF-2725
http://jira.jboss.com/jira/browse/RF-2150
http://jira.jboss.com/jira/browse/RF-2702
Modified: branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2008-04-06 16:27:01 UTC (rev 7619)
+++ branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2008-04-06 16:27:51 UTC (rev 7620)
@@ -1,4 +1,5 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
<!-- DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -->
@@ -143,12 +144,27 @@
</mp:modalPanel>
<f:verbatim>
- <a href="javascript:$('_form:_panel').component.syncShow();">Synchronous Show</a>
<a href="javascript:Richfaces.showModalPanel(':_panel');">Show</a>
<a href="javascript:Richfaces.showModalPanel(':_panel', {left: '120', top: 'auto'});">Show: left = 120; top = auto</a>
<a href="javascript:Richfaces.showModalPanel(':_panel', {top: 'auto', width: 800});">Show: width = 800; top = auto</a>
<a href="javascript:Richfaces.showModalPanel(':_panel', {width: 1});">Show: width = 1</a>
+ <a href="javascript:Richfaces.showModalPanel('eventInfoID');">Show autosized panel</a>
</f:verbatim>
+
+
+ <mp:modalPanel id="eventInfoID" autosized="true" minHeight="250" minWidth="200" moveable="true" style="overflow: true;">
+ <f:facet name="header">
+ <h:outputText value="Events..." />
+ </f:facet>
+
+ <f:facet name="controls">
+ <h:commandLink value="C" onclick="Richfaces.hideModalPanel('eventInfoID'); return false;" />
+ </f:facet>
+
+
+ <h:outputText value="Eventsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ..." />
+
+ </mp:modalPanel>
</h:panelGrid>
<mp:modalPanel id="ccPanel" controlsClass="pointerCursor" onhide="alert(event.parameters.alertText)"
16 years, 9 months
JBoss Rich Faces SVN: r7619 - in branches/3.1.x/ui/modal-panel/src/main: resources/org/richfaces/renderkit/html/css and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-06 12:27:01 -0400 (Sun, 06 Apr 2008)
New Revision: 7619
Modified:
branches/3.1.x/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
branches/3.1.x/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2128
http://jira.jboss.com/jira/browse/RF-2725
http://jira.jboss.com/jira/browse/RF-2150
http://jira.jboss.com/jira/browse/RF-2702
Modified: branches/3.1.x/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-04-05 14:21:35 UTC (rev 7618)
+++ branches/3.1.x/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-04-06 16:27:01 UTC (rev 7619)
@@ -24,16 +24,14 @@
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
import javax.faces.component.UIComponent;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.ComponentVariables;
import org.ajax4jsf.renderkit.ComponentsVariableResolver;
-import org.ajax4jsf.javascript.ScriptUtils;
import org.richfaces.component.UIModalPanel;
/**
@@ -152,4 +150,5 @@
return result.toString();
}
+
}
Modified: branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-04-05 14:21:35 UTC (rev 7618)
+++ branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-04-06 16:27:01 UTC (rev 7619)
@@ -51,15 +51,11 @@
}
.dr-mpnl-pnl-a {
+ outline-style: none;
position: absolute;
left: -32000px;
}
- .rich-mp-content {
- height: 100%;
- width: 100%;
- }
-
</f:verbatim>
<u:selector name=".dr-mpnl-spacer, .dr-mpnl-resizer">
@@ -75,8 +71,6 @@
border-style: solid;
padding : 1px;
background-color: inherit;
- height: 100%;
- width: 100%;
}
.dr-mpnl-pnl-h{
Modified: branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-04-05 14:21:35 UTC (rev 7618)
+++ branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-04-06 16:27:01 UTC (rev 7619)
@@ -51,7 +51,7 @@
ModalPanel.Context = Class.create();
ModalPanel.Context.prototype = {
initialize: function(modalPanel) {
- this.cdiv = modalPanel.contentTable;
+ this.cdiv = modalPanel.contentDiv;
this.isPositionFixed = Richfaces.getComputedStyle(this.cdiv, "position") == "fixed";
},
@@ -103,7 +103,6 @@
this.cursorDiv = id + "CursorDiv";
this.cdiv = id + "CDiv";
this.contentDiv = id + "ContentDiv";
- this.contentTable = id + "ContentTable";
this.shadowDiv = id + "ShadowDiv";
this.context = new ModalPanel.Context(this);
@@ -402,7 +401,7 @@
}
},
- _show: function(event, opts, synchronous) {
+ show: function(event, opts) {
this.preventFocus();
var element = this.id;
@@ -453,7 +452,6 @@
var eContentDiv = $(this.contentDiv);
var eShadowDiv = $(this.shadowDiv);
- var eContentTable = $(this.contentTable);
if (this.options.autosized) {
eContentDiv.style.overflow = "";
@@ -472,7 +470,7 @@
if (eIframe) {
eIframe.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
- eContentTable.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
+ eContentDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
eShadowDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
@@ -484,7 +482,7 @@
if (eIframe) {
eIframe.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
- eContentTable.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
+ eContentDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
eShadowDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
@@ -602,33 +600,17 @@
Element.hide(eCdiv);
element.style.visibility = "";
- var showFunction = function() {
- Element.show(eCdiv);
-
- this.lastOnfocus();
-
- var event = {};
- event.parameters = opts || {};
- if (this.eventOnShow) this.eventOnShow(event);
-
- this.shown = true;
- };
-
- if (synchronous) {
- showFunction.call(this);
- } else {
- setTimeout(showFunction.bind(this), 0);
- }
+ Element.show(eCdiv);
+
+ this.lastOnfocus();
+
+ var event = {};
+ event.parameters = opts || {};
+ if (this.eventOnShow) this.eventOnShow(event);
+
+ this.shown = true;
},
- syncShow: function(event, opts) {
- this._show(event, opts, true);
- },
-
- show: function(event, opts) {
- this._show(event, opts, false);
- },
-
startDrag: function(border) {
for (var k = 0; k < this.borders.length; k++ ) {
//this.borders[k].hide();
@@ -696,6 +678,10 @@
}
},
+ _getStyle: function(elt, name) {
+ return parseInt(elt.style[name].replace("px", ""), 10);
+ },
+
doResizeOrMove: function(diff) {
var vetoes = {};
var cssHash = {};
@@ -704,14 +690,14 @@
var vetoeChange = false;
var newSize;
- var eContentTable = $(this.contentTable);
+ var eContentDiv = $(this.contentDiv);
var eShadowDiv = $(this.shadowDiv);
// Avoid currentStyle bug in opera
if (RichFaces.navigatorType() != "OPERA")
- newSize = Richfaces.getComputedStyleSize(eContentTable, "width");
+ newSize = Richfaces.getComputedStyleSize(eContentDiv, "width");
else
- newSize = parseInt(eContentTable.style.width.replace("px", ""), 10);
+ newSize = this._getStyle(eContentDiv, "width");
var oldSize = newSize;
newSize += diff.deltaWidth || 0;
@@ -742,16 +728,16 @@
}
var newPos;
- newPos = Richfaces.getComputedStyleSize(eCdiv, "left");
+ newPos = this._getStyle(eCdiv, "left");//Richfaces.getComputedStyleSize(eCdiv, "left");
newPos += diff.deltaX;
cssHash.left = newPos + 'px';
}
// Avoid currentStyle bug in opera
if (RichFaces.navigatorType() != "OPERA")
- newSize = Richfaces.getComputedStyleSize(eContentTable, "height");
+ newSize = Richfaces.getComputedStyleSize(eContentDiv, "height");
else
- newSize = parseInt(eContentTable.style.height.replace("px", ""), 10);
+ newSize = this._getStyle(eContentDiv, "height")//;Richfaces.getComputedStyleSize(eContentDiv, "height");
var oldSize = newSize;
newSize += diff.deltaHeight || 0;
@@ -787,7 +773,7 @@
eCdiv.mpTop = newPos;
cssHash.top = newPos + 'px';
} else {
- newPos = Richfaces.getComputedStyleSize(eCdiv, "top");
+ newPos = this._getStyle(eCdiv, "top");//Richfaces.getComputedStyleSize(eCdiv, "top");
newPos += diff.deltaY;
cssHash.top = newPos + 'px';
}
@@ -795,7 +781,7 @@
Element.setStyle(eCdiv, cssHash);
- Element.setStyle(eContentTable, cssHashWH);
+ Element.setStyle(eContentDiv, cssHashWH);
this.correctShadowSize();
if (this.iframe) {
Element.setStyle($(this.iframe), cssHashWH);
@@ -858,8 +844,8 @@
correctShadowSize: function(event) {
var eShadowDiv = $(this.shadowDiv);
- var eContentTable = $(this.contentTable);
- if (!eShadowDiv || !eContentTable) {
+ var eContentDiv = $(this.contentDiv);
+ if (!eShadowDiv || !eContentDiv) {
return;
}
var eIframe = $(this.iframe);
@@ -871,8 +857,8 @@
dx = eShadowDiv.offsetWidth-eShadowDiv.clientWidth;
dy = eShadowDiv.offsetHeight-eShadowDiv.clientHeight;
}
- var w = eContentTable.offsetWidth;
- var h = eContentTable.offsetHeight;
+ var w = eContentDiv.offsetWidth;
+ var h = eContentDiv.offsetHeight;
eShadowDiv.style.width = (w-dx)+"px";
eShadowDiv.style.height = (h-dy)+"px";
Modified: branches/3.1.x/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-04-05 14:21:35 UTC (rev 7618)
+++ branches/3.1.x/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-04-06 16:27:01 UTC (rev 7619)
@@ -48,9 +48,10 @@
onmousedown="#{component.attributes['onmaskmousedown']}"
onmousemove="#{component.attributes['onmaskmousemove']}"
onmouseover="#{component.attributes['onmaskmouseover']}"
- onmouseout="#{component.attributes['onmaskmouseout']}" />
- <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
- style="filter: alpha(opacity=1); z-index: -200"></div>
+ onmouseout="#{component.attributes['onmaskmouseout']}">
+
+ <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}FirstHref">_</a>
+ </div>
<div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" >
@@ -80,16 +81,39 @@
<div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow rich-mpnl-shadow"
style="#{component.shadowStyle}" >
</div>
- <table id="#{clientId}ContentTable" cellpadding="0" cellspacing="0" border="0"
- style="position: absolute; z-index: 2; width: #{component.minWidth}px; height: #{component.minHeight}px; #{component.attributes['style']};">
- <tbody>
- <tr>
- <td class="dr-mpnl-pnl">
-
- <div id="#{clientId}ContentDiv" style="overflow: hidden;" class="rich-mp-content">
+
+ <c:object var="divStyle" type="java.lang.String" />
+ <c:object var="tableStyle" type="java.lang.String" />
+
+ <jsp:scriptlet>
+ <![CDATA[
+ if (component.isAutosized()) {
+ int minWidth = component.getMinWidth();
+ int minHeight = component.getMinHeight();
+
+ int width = component.getWidth();
+ int height = component.getHeight();
+
+ if (width < 0 || width < minWidth) {
+ width = minWidth;
+ }
+
+ if (height < 0 || height < minHeight) {
+ height = minHeight;
+ }
+
+ tableStyle += "width: " + (width > 0 ? width : 1) + "px;";
+ tableStyle += "height: " + (height > 0 ? height : 1) + "px;";
+
+ } else {
+ tableStyle = "height: 100%; width: 100%;";
+ }
+ ]]>
+ </jsp:scriptlet>
+
+ <div id="#{clientId}ContentDiv" style="position: absolute; z-index: 2; overflow: hidden; #{component.attributes['style']}" class="dr-mpnl-pnl rich-mp-content">
- <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}FirstHref" >_</a>
- <table style="height: 100%; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+ <table style="#{tableStyle}" border="0" cellpadding="0" cellspacing="0">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("header")!=null && component.getFacet("header").isRendered()) {]]>
</jsp:scriptlet>
@@ -120,14 +144,18 @@
<f:call name="renderChildren" />
</vcp:body>
<f:clientid var="clientId"/>
- <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}LastHref" >_</a>
</td>
</tr>
</table>
</div>
- </td></tr></tbody></table>
</div>
+ <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
+ style="filter: alpha(opacity=1); z-index: -200">
+
+ <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}LastHref">_</a>
+ </div>
+
<script type="text/javascript">
new ModalPanel('#{clientId}',
{
16 years, 9 months