Author: jacopoc Date: Tue Feb 20 12:56:53 2007 New Revision: 509749 URL: http://svn.apache.org/viewvc?view=rev&rev=509749 Log: Applied patch from Adrian Crum (OFBIZ-740) to parametrize javascripts files in simple global template.
Modified: ofbiz/trunk/framework/common/webcommon/includes/simple.ftl ofbiz/trunk/framework/common/widget/CommonScreens.xml Modified: ofbiz/trunk/framework/common/webcommon/includes/simple.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/simple.ftl?view=diff&rev=509749&r1=509748&r2=509749 ============================================================================== --- ofbiz/trunk/framework/common/webcommon/includes/simple.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/includes/simple.ftl Tue Feb 20 12:56:53 2007 @@ -22,9 +22,12 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>${layoutSettings.companyName}: <#if (page.titleProperty)?has_content>${uiLabelMap[page.titleProperty]}<#else>${(page.title)?if_exists}</#if></title> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar1.js</@ofbizContentUrl>" type="text/javascript"></script> - <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script> - <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" type="text/javascript"></script> + <#if layoutSettings.javaScripts?has_content> + <#--layoutSettings.javaScripts is a list of java scripts. --> + <#list layoutSettings.javaScripts as javaScript> + <script language="javascript" src="<@ofbizContentUrl>${javaScript}</@ofbizContentUrl>" type="text/javascript"></script> + </#list> + </#if> <#if layoutSettings.styleSheets?has_content> <#--layoutSettings.styleSheets is a list of style sheets. So, you can have a user-specified "main" style sheet, AND a component style sheet.--> <#list layoutSettings.styleSheets as styleSheet> @@ -36,6 +39,7 @@ ${layoutSettings.extraHead?if_exists} </head> +<#-- TODO: create a corresponding style in the main style sheet, eliminate embedded style --> <body style="background-color: WHITE;"> <form name="printPage"> <input type="button" value="${uiLabelMap.CommonPrint}" onClick="window.print()" class="smallSubmit"/> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?view=diff&rev=509749&r1=509748&r2=509749 ============================================================================== --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Tue Feb 20 12:56:53 2007 @@ -189,6 +189,12 @@ <!-- The default (global) stylesheet --> <set field="layoutSettings.styleSheets[+0]" value="/images/maincss.css" global="true"/> </actions> + <!-- The default (global) java scripts --> + <set field="layoutSettings.javaScripts[]" value="/images/calendar1.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> + <!-- The default (global) shortcut icon --> + <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> <widgets> <!-- render header --> <platform-specific><html><html-template location="component://common/webcommon/includes/simple.ftl"/></html></platform-specific>