Author: jleroux
Date: Sat Nov 12 00:54:43 2011 New Revision: 1201137 URL: http://svn.apache.org/viewvc?rev=1201137&view=rev Log: A patch from Anne Jessel https://issues.apache.org/jira/browse/OFBIZ-4510 "List css before js in ecommerce header" Trivial patch to list css before js in ecommerce pages. This helps some browsers display pages faster. jleroux: found also this article http://stackoverflow.com/questions/3967216/order-of-css-and-script-calls-in-a-aspx-page Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl?rev=1201137&r1=1201136&r2=1201137&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl Sat Nov 12 00:54:43 2011 @@ -28,22 +28,6 @@ under the License. <#if shortcutIcon?has_content> <link rel="shortcut icon" href="<@ofbizContentUrl>${StringUtil.wrapString(shortcutIcon)}</@ofbizContentUrl>" /> </#if> - <#if layoutSettings.javaScripts?has_content> - <#--layoutSettings.javaScripts is a list of java scripts. --> - <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct order --> - <#assign javaScriptsSet = Static["org.ofbiz.base.util.UtilMisc"].toSet(layoutSettings.javaScripts)/> - <#list layoutSettings.javaScripts as javaScript> - <#if javaScriptsSet.contains(javaScript)> - <#assign nothing = javaScriptsSet.remove(javaScript)/> - <script type="text/javascript" src="<@ofbizContentUrl>${StringUtil.wrapString(javaScript)}</@ofbizContentUrl>"></script> - </#if> - </#list> - </#if> - <#if layoutSettings.VT_HDR_JAVASCRIPT?has_content> - <#list layoutSettings.VT_HDR_JAVASCRIPT as javaScript> - <script type="text/javascript" src="<@ofbizContentUrl>${StringUtil.wrapString(javaScript)}</@ofbizContentUrl>"></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> @@ -66,13 +50,6 @@ under the License. <link rel="stylesheet" href="<@ofbizContentUrl>${StringUtil.wrapString(styleSheet)}</@ofbizContentUrl>" type="text/css"/> </#list> </#if> - ${layoutSettings.extraHead?if_exists} - <#if layoutSettings.VT_EXTRA_HEAD?has_content> - <#list layoutSettings.VT_EXTRA_HEAD as extraHead> - ${extraHead} - </#list> - </#if> - <#-- Append CSS for catalog --> <#if catalogStyleSheet?exists> <link rel="stylesheet" href="${StringUtil.wrapString(catalogStyleSheet)}" type="text/css"/> @@ -81,6 +58,29 @@ under the License. <#if sessionAttributes.overrideCss?exists> <link rel="stylesheet" href="${StringUtil.wrapString(sessionAttributes.overrideCss)}" type="text/css"/> </#if> + <#if layoutSettings.javaScripts?has_content> + <#--layoutSettings.javaScripts is a list of java scripts. --> + <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct order --> + <#assign javaScriptsSet = Static["org.ofbiz.base.util.UtilMisc"].toSet(layoutSettings.javaScripts)/> + <#list layoutSettings.javaScripts as javaScript> + <#if javaScriptsSet.contains(javaScript)> + <#assign nothing = javaScriptsSet.remove(javaScript)/> + <script type="text/javascript" src="<@ofbizContentUrl>${StringUtil.wrapString(javaScript)}</@ofbizContentUrl>"></script> + </#if> + </#list> + </#if> + <#if layoutSettings.VT_HDR_JAVASCRIPT?has_content> + <#list layoutSettings.VT_HDR_JAVASCRIPT as javaScript> + <script type="text/javascript" src="<@ofbizContentUrl>${StringUtil.wrapString(javaScript)}</@ofbizContentUrl>"></script> + </#list> + </#if> + ${layoutSettings.extraHead?if_exists} + <#if layoutSettings.VT_EXTRA_HEAD?has_content> + <#list layoutSettings.VT_EXTRA_HEAD as extraHead> + ${extraHead} + </#list> + </#if> + <#-- Meta tags if defined by the page action --> <#if metaDescription?exists> <meta name="description" content="${metaDescription}"/> |
Free forum by Nabble | Edit this page |