You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gr...@apache.org on 2007/08/14 22:51:48 UTC
svn commit: r565906 -
/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
Author: grantsmith
Date: Tue Aug 14 13:51:47 2007
New Revision: 565906
URL: http://svn.apache.org/viewvc?view=rev&rev=565906
Log:
patch applied for TOMAHAWK-530
Modified:
myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java?view=diff&rev=565906&r1=565905&r2=565906
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java Tue Aug 14 13:51:47 2007
@@ -346,8 +346,18 @@
throw new IllegalStateException("Week may only start with sunday or monday.");
StringBuffer script = new StringBuffer();
- setStringVariable(script,popupCalendarVariable +".initData.imgDir",(JavascriptUtils.encodeString(AddResourceFactory.getInstance(facesContext)
- .getResourceUri(facesContext, HtmlCalendarRenderer.class, "DB/"))));
+ String imageLocation = HtmlRendererUtils.getImageLocation(uiComponent);
+ if(imageLocation == null) {
+ setStringVariable(script,popupCalendarVariable +".initData.imgDir",
+ (JavascriptUtils.encodeString(AddResourceFactory.getInstance(facesContext)
+ .getResourceUri(facesContext, HtmlCalendarRenderer.class, "DB/"))));
+ }
+ else {
+ setStringVariable(script, popupCalendarVariable +".initData.imgDir",
+ (JavascriptUtils.encodeString(AddResourceFactory.getInstance(facesContext)
+ .getResourceUri(facesContext, imageLocation+"/"))) );
+ }
+
defineStringArray(script, popupCalendarVariable +".initData.monthName", mapMonths(symbols));
defineStringArray(script, popupCalendarVariable +".initData.dayName", weekDays);
setIntegerVariable(script, popupCalendarVariable +".initData.startAt",realFirstDayOfWeek);