Author: adityasharma
Date: Sat Mar 9 06:27:29 2019 New Revision: 1855083 URL: http://svn.apache.org/viewvc?rev=1855083&view=rev Log: Improved: Replace document.write() occurrences with some legitimate code (OFBIZ-10759) Removed js code and added Js files in LookupDecorator. Added Js library files as there were some errors in console logs Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Lookup.ftl ofbiz/ofbiz-framework/trunk/themes/common-theme/widget/CommonScreens.xml Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Lookup.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Lookup.ftl?rev=1855083&r1=1855082&r2=1855083&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Lookup.ftl (original) +++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Lookup.ftl Sat Mar 9 06:27:29 2019 @@ -27,25 +27,6 @@ under the License. <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>${title!}</title> - <#-- the trick "<scr" + "ipt below is because browsers should not parse the contents of CDATA elements, but apparently they do. --> - <script type="application/javascript">//<![CDATA[ - var jQueryLibLoaded = false; - function initJQuery() { - if (typeof(jQuery) == 'undefined') { - if (!jQueryLibLoaded) { - jQueryLibLoaded = true; - document.write("<scr" + "ipt type=\"application/javascript\" src=\"<@ofbizContentUrl>/common/js/jquery/jquery-3.2.1.min.js</@ofbizContentUrl>\"></scr" + "ipt>"); - document.write("<scr" + "ipt type=\"application/javascript\" src=\"<@ofbizContentUrl>/common/js/jquery/jquery-migrate-3.0.0.min.js</@ofbizContentUrl>\"></scr" + "ipt>"); - document.write("<scr" + "ipt type=\"application/javascript\" src=\"<@ofbizContentUrl>/common/js/jquery/plugins/browser-plugin/jquery.browser-0.1.0.min.js</@ofbizContentUrl>\"></scr" + "ipt>"); - } - setTimeout("initJQuery()", 50); - } - } - initJQuery(); - //]]> - </script> - <script src="<@ofbizContentUrl>/common/js/util/OfbizUtil.js</@ofbizContentUrl>" - type="application/javascript"></script> <#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 --> Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/widget/CommonScreens.xml?rev=1855083&r1=1855082&r2=1855083&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/common-theme/widget/CommonScreens.xml (original) +++ ofbiz/ofbiz-framework/trunk/themes/common-theme/widget/CommonScreens.xml Sat Mar 9 06:27:29 2019 @@ -351,6 +351,14 @@ under the License. <set field="defaultOrganizationPartyId" from-field="userPreferences.ORGANIZATION_PARTY" global="true"/> <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC" default-value="component://common-theme/template/includes/Messages.ftl"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/plugins/select2/js/select2-4.0.6.js"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/plugins/datetimepicker/jquery-ui-timepicker-addon-1.6.3.min.js"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/ui/jquery-ui-1.12.1.min.js"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/plugins/validate/jquery.validate.min.js"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/plugins/browser-plugin/jquery.browser-0.1.0.min.js" global="true"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/jquery-migrate-3.0.0.min.js" global="true"/> + <set field="layoutSettings.javaScripts[+0]" value="/common/js/jquery/jquery-3.2.1.min.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/common/js/util/OfbizUtil.js" global="true"/> </actions> <widgets> <section> |
Free forum by Nabble | Edit this page |