Author: mrdon Date: Thu Apr 13 16:52:47 2006 New Revision: 393981 URL: http://svn.apache.org/viewcvs?rev=393981&view=rev Log: Changing to use new dojo date picker, also dojo will be minimally imported for all themes that use the simple's head.ftl
Added: incubator/webwork2/action/src/main/resources/template/simple/dojoRequire.js Modified: incubator/webwork2/action/src/main/resources/template/ajax/head.ftl incubator/webwork2/action/src/main/resources/template/simple/datepicker.ftl incubator/webwork2/action/src/main/resources/template/simple/head.ftl Modified: incubator/webwork2/action/src/main/resources/template/ajax/head.ftl URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/template/ajax/head.ftl?rev=393981&r1=393980&r2=393981&view=diff ============================================================================== --- incubator/webwork2/action/src/main/resources/template/ajax/head.ftl (original) +++ incubator/webwork2/action/src/main/resources/template/ajax/head.ftl Thu Apr 13 16:52:47 2006 @@ -1,15 +1,4 @@ <#include "/${parameters.templateDir}/xhtml/head.ftl" /> -<script language="JavaScript" type="text/javascript"> - // Dojo configuration - djConfig = { - baseRelativePath: "<@saf.url includeParams='none' value='/struts/dojo/' encode='false'/>", - isDebug: ${parameters.debug}, - bindEncoding: "${parameters.encoding}", - debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes - }; -</script> -<script language="JavaScript" type="text/javascript" - src="<@saf.url includeParams='none' value='/struts/dojo/dojo.js' encode='false'/>"></script> <script language="JavaScript" type="text/javascript" src="<@saf.url includeParams='none' value='/struts/ajax/dojoRequire.js' encode='false'/>"></script> <script language="JavaScript" type="text/javascript" Modified: incubator/webwork2/action/src/main/resources/template/simple/datepicker.ftl URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/template/simple/datepicker.ftl?rev=393981&r1=393980&r2=393981&view=diff ============================================================================== --- incubator/webwork2/action/src/main/resources/template/simple/datepicker.ftl (original) +++ incubator/webwork2/action/src/main/resources/template/simple/datepicker.ftl Thu Apr 13 16:52:47 2006 @@ -1,26 +1,35 @@ -<#if !stack.findValue("#datepicker_js_included")?exists> -<#assign trash = stack.setValue("#datepicker_js_included", true)/> -<script type="text/javascript" src="<@saf.url value="/struts/jscalendar/" encode='false'/>calendar.js"></script> -<script type="text/javascript" src="<@saf.url value="/struts/jscalendar/lang/" encode='false'/>calendar-${parameters.language?default("en")}.js"></script> -<script type="text/javascript" src="<@saf.url value="/struts/jscalendar/" encode='false'/>calendar-setup.js"></script> -</#if> -<#include "/${parameters.templateDir}/simple/text.ftl" /> -<#if !parameters.readonly?exists><a href="#" id="${parameters.id}_button"></#if><img src="<@saf.url value="/struts/jscalendar/img.gif" encode='false'/>" width="16" height="16" border="0" alt="Click Here to Pick up the date"><#if !parameters.readonly?exists></a></#if> -<#if !parameters.readonly?exists> <script type="text/javascript"> - Calendar.setup({ - inputField : "${parameters.id}", -<#if parameters.format?exists> - ifFormat : "${parameters.format}", -</#if> -<#if parameters.showstime?exists> - showsTime : "${parameters.showstime}", -</#if> - button : "${parameters.id}_button", -<#if parameters.singleclick?exists> - singleclick : ${parameters.singleclick}, -</#if> - step : 1 - }); + dojo.require("dojo.widget.html.DatePicker"); + dojo.require("struts.widgets.*"); </script> + +<#if parameters.readonly?exists> + <#include "/${parameters.templateDir}/simple/text.ftl" /> +<#else> + <div dojoType="dropdowncontainer" + dateIconPath="<@saf.url includeParams='none' value='/struts/dojo/struts/widgets/dateIcon.gif' encode='false'/>" + <#if parameters.dateFormat?exists> + dateFormat="${parameters.dateFormat}" + </#if> + <#if parameters.dateIconPath?exists> + dateIconPath="${parameters.dateIconPath}" + </#if> + <#if parameters.currentDate?exists> + currentDate="${parameters.currentDate}" + </#if> + <#if parameters.currentDate?exists> + templatePath="${parameters.templatePath}" + </#if> + <#if parameters.templateCssPath?exists> + templateCssPath="${parameters.templateCssPath}" + </#if> + <#if parameters.dateFormat?exists> + dateFormat="${parameters.dateFormat}" + </#if> + <#if parameters.get("size")?exists> + inputWidth="${parameters.get("size")?html}" + </#if> + > + <#include "/${parameters.templateDir}/simple/text.ftl" /> + </div> </#if> Added: incubator/webwork2/action/src/main/resources/template/simple/dojoRequire.js URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/template/simple/dojoRequire.js?rev=393981&view=auto ============================================================================== --- incubator/webwork2/action/src/main/resources/template/simple/dojoRequire.js (added) +++ incubator/webwork2/action/src/main/resources/template/simple/dojoRequire.js Thu Apr 13 16:52:47 2006 @@ -0,0 +1,2 @@ +dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman debugger to work with the includes + Modified: incubator/webwork2/action/src/main/resources/template/simple/head.ftl URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/template/simple/head.ftl?rev=393981&r1=393980&r2=393981&view=diff ============================================================================== --- incubator/webwork2/action/src/main/resources/template/simple/head.ftl (original) +++ incubator/webwork2/action/src/main/resources/template/simple/head.ftl Thu Apr 13 16:52:47 2006 @@ -1,3 +1,13 @@ -<#if parameters.calendarcss?exists> -<link rel="stylesheet" href="<@saf.url value='/struts/jscalendar/${parameters.calendarcss?html}' />" type="text/css"/> -</#if> +<script language="JavaScript" type="text/javascript"> + // Dojo configuration + djConfig = { + baseRelativePath: "<@saf.url includeParams='none' value='/struts/dojo' encode='false'/>", + isDebug: ${parameters.debug}, + bindEncoding: "${parameters.encoding}", + debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes + }; +</script> +<script language="JavaScript" type="text/javascript" + src="<@saf.url includeParams='none' value='/struts/dojo/dojo.js' encode='false'/>"></script> +<script language="JavaScript" type="text/javascript" + src="<@saf.url includeParams='none' value='/struts/simple/dojoRequire.js' encode='false'/>"></script> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]