You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2010/10/26 21:32:37 UTC

svn commit: r1027699 - in /ofbiz/branches/jquery: framework/common/webcommon/includes/ framework/common/widget/ framework/example/widget/example/ specialpurpose/ecommerce/webapp/ecommerce/images/ specialpurpose/ecommerce/widget/ specialpurpose/myportal...

Author: jleroux
Date: Tue Oct 26 19:32:36 2010
New Revision: 1027699

URL: http://svn.apache.org/viewvc?rev=1027699&view=rev
Log:
A patch from Sascha Rodekamp "webPos Migration and Cleanup" (https://issues.apache.org/jira/browse/OFBIZ-3986) - OFBIZ-3986

Actually more than the title suggest:

* remove some not needed css/js includes
* migration of setPriceRulesCondEventJs.ftl (JLR: thanks Sascha forgot about it)
* missed stuff in the checkoutProcess.js

Modified:
    ofbiz/branches/jquery/framework/common/webcommon/includes/setPriceRulesCondEventJs.ftl
    ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml
    ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml
    ofbiz/branches/jquery/framework/example/widget/example/ExampleAjaxScreens.xml
    ofbiz/branches/jquery/framework/example/widget/example/ExampleScreens.xml
    ofbiz/branches/jquery/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js
    ofbiz/branches/jquery/specialpurpose/ecommerce/widget/CommonScreens.xml
    ofbiz/branches/jquery/specialpurpose/myportal/widget/CommonScreens.xml

Modified: ofbiz/branches/jquery/framework/common/webcommon/includes/setPriceRulesCondEventJs.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/webcommon/includes/setPriceRulesCondEventJs.ftl?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/webcommon/includes/setPriceRulesCondEventJs.ftl (original)
+++ ofbiz/branches/jquery/framework/common/webcommon/includes/setPriceRulesCondEventJs.ftl Tue Oct 26 19:32:36 2010
@@ -1,10 +1,10 @@
 <script type="text/javascript">
-document.observe('dom:loaded', function() {
+jQuery(document).ready( function() {
 
 <#if 0 < productPriceConds.size()>
   <#list 0..productPriceConds.size()-1 as i>
-    if ($('EditProductPriceRulesCond_o_${i}')) {    
-      Event.observe($('EditProductPriceRulesCond_inputParamEnumId_o_${i}'), 'change', function() {
+    if (document.getElementById('EditProductPriceRulesCond_o_${i}')) {
+      jQuery('#EditProductPriceRulesCond_inputParamEnumId_o_${i}').change( function() {
     <#if 'PRIP_QUANTITY' != productPriceConds[i].inputParamEnumId && 'PRIP_LIST_PRICE' != productPriceConds[i].inputParamEnumId>
         getDependentDropdownValues('getAssociatedPriceRulesConds', 'inputParamEnumId', 'EditProductPriceRulesCond_inputParamEnumId_o_${i}', 'EditProductPriceRulesCond_condValue_o_${i}', 'productPriceRulesCondValues', 'condValue_o_${i}', 'description');
     </#if>
@@ -13,11 +13,11 @@ document.observe('dom:loaded', function(
       getDependentDropdownValues('getAssociatedPriceRulesConds', 'inputParamEnumId', 'EditProductPriceRulesCond_inputParamEnumId_o_${i}', 'EditProductPriceRulesCond_condValue_o_${i}', 'productPriceRulesCondValues', 'condValue_o_${i}', 'description', '${productPriceConds[i].condValue}');
     </#if>
     }
-  </#list>        
-</#if>  
-  if ($('AddProductPriceRulesCond_o_0')) {
-    $('AddProductPriceRulesCond_condValueInput_o_0').hide();
-    Event.observe($('AddProductPriceRulesCond_inputParamEnumId_o_0'), 'change', function() {
+  </#list>
+</#if>
+  if (document.getElementById('AddProductPriceRulesCond_o_0')) {
+    jQuery('#AddProductPriceRulesCond_condValueInput_o_0').hide();
+    jQuery('#AddProductPriceRulesCond_inputParamEnumId_o_0').change( function() {
       getDependentDropdownValues('getAssociatedPriceRulesConds', 'inputParamEnumId', 'AddProductPriceRulesCond_inputParamEnumId_o_0', 'AddProductPriceRulesCond_condValue_o_0', 'productPriceRulesCondValues', 'condValue_o_0', 'description', '', '', '', '', 'AddProductPriceRulesCond_condValueInput_o_0');
     });
     getDependentDropdownValues('getAssociatedPriceRulesConds', 'inputParamEnumId', 'AddProductPriceRulesCond_inputParamEnumId_o_0', 'AddProductPriceRulesCond_condValue_o_0', 'productPriceRulesCondValues', 'condValue_o_0', 'description', '', '', '', '', 'AddProductPriceRulesCond_condValueInput_o_0');

Modified: ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml Tue Oct 26 19:32:36 2010
@@ -127,20 +127,19 @@ under the License.
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.4.2.min.js" global="true"/>
                     <!-- jQuery CSSs -->
                 <set field="layoutSettings.styleSheets[+0]" value="/images/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.css" global="true"/>
-                
+
                 <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/getDependentDropdownValues.js" global="true"/>
-                <set field="layoutSettings.javaScripts[]" value="/images/selectMultipleRelatedValues.js" global="true"/>                                                                         
-                <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/>
-                
+                <set field="layoutSettings.javaScripts[]" value="/images/selectMultipleRelatedValues.js" global="true"/>
+
                     <!-- Prototype temporarily re-added to avoid issues while working with jQuery Branch-->
                 <!--set field="layoutSettings.javaScripts[]" value="/images/prototypejs/scriptaculous.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/resize.js" global="true"/-->
-                
-                
+
+
                 <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true"/>
                 <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true"/>
                 <service service-name="getVisualThemeResources">

Modified: ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml (original)
+++ ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml Tue Oct 26 19:32:36 2010
@@ -145,7 +145,6 @@ under the License.
     <screen name="navigateHelp">
         <section>
             <actions>
-                <set field="layoutSettings.javaScripts[+0]" value="/images/dojo/dojo.js" global="true"/>
                 <set field="titleProperty" value="PageTitleNavigateContent"/>
                 <entity-and entity-name="ContentAssoc" list="contentAssoc">
                     <field-map field-name="contentId" value="HELP_ROOT"/>

Modified: ofbiz/branches/jquery/framework/example/widget/example/ExampleAjaxScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/example/widget/example/ExampleAjaxScreens.xml?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/example/widget/example/ExampleAjaxScreens.xml (original)
+++ ofbiz/branches/jquery/framework/example/widget/example/ExampleAjaxScreens.xml Tue Oct 26 19:32:36 2010
@@ -24,7 +24,6 @@ under the License.
     <screen name="AjaxExample">
         <section>
             <actions>
-                <set field="layoutSettings.styleSheets[+0]" value="/images/prototypejs/scriptaculouscontrols.css" global="true"/>
                 <set field="headerItem" value="AjaxExample"/>
                 <set field="titleProperty" value="PageTitleFindExample"/>
                 <set field="exampleCtx" from-field="parameters"/>

Modified: ofbiz/branches/jquery/framework/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/example/widget/example/ExampleScreens.xml?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/branches/jquery/framework/example/widget/example/ExampleScreens.xml Tue Oct 26 19:32:36 2010
@@ -62,7 +62,6 @@ under the License.
     <screen name="EditExample">
         <section>
             <actions>
-                <set field="layoutSettings.styleSheets[+0]" value="/images/prototypejs/scriptaculouscontrols.css" global="true"/>
                 <set field="titleProperty" value="PageTitleEditExample"/>
                 <set field="tabButtonItem" value="EditExample"/>
                 <set field="exampleId" from-field="parameters.exampleId"/>

Modified: ofbiz/branches/jquery/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/branches/jquery/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js Tue Oct 26 19:32:36 2010
@@ -375,7 +375,7 @@ function processBillingAndPayment() {
         url: 'createUpdateBillingAndPayment',
         type: 'POST',
         dataType: 'json',
-        data: $('billingForm').serialize(),
+        data: jQuery('#billingForm').serialize(),
         async: false,
         success: function(json) {
             jQuery('#billingFormServerError').fadeOut('fast');
@@ -450,7 +450,7 @@ function addPromoCode() {
 function getProductLineItemIndex(event, productId) {
     var itemIndex = null;
     var productIdParam = "productId=" + productId;
-    var formValues = $('cartForm').serialize() + "&" + productIdParam;
+    var formValues = jQuery('#cartForm').serialize() + "&" + productIdParam;
     jQuery.ajax({
         url: 'getShoppingCartItemIndex',
         type: 'POST',
@@ -486,7 +486,7 @@ function cartItemQtyChanged(elmt) {
     if (jQuery(qtyElement).val() && jQuery(qtyElement).val() >= 0 && !isNaN(jQuery(qtyElement).val())) {
         var itemIndex = getProductLineItemIndex(elmt, productId);
         qtyParam = "update_" + itemIndex +"="+jQuery(qtyElement).val();
-        var formValues = $('cartForm').serialize() + '&' + qtyParam;
+        var formValues = jQuery('#cartForm').serialize() + '&' + qtyParam;
         updateCartData(elementId, formValues, qtyElement.value, itemIndex);
     }
 }
@@ -529,20 +529,22 @@ function processOrder() {
 }
 function getAssociatedBillingStateList(formName, divId) {
     var optionList = [];
-    new Ajax.Request("getAssociatedStateList", {
-        asynchronous: false,
-        parameters: $(formName).serialize(),
-        onSuccess: function(transport) {
-            var data = transport.responseText.evalJSON(true);
+    jQuery.ajax({
+        url: "getAssociatedStateList",
+        data: jQuery(formName).serialize(),
+        async: false,
+        success: function(transport) {
             stateList = data.stateList;
-            stateList.each(function(state) {
-                geoVolues = state.split(': ');
-                optionList.push("<option value = "+geoVolues[1]+" >"+geoVolues[0]+"</option>");
+            var billingStates = jQuery("#" + divId);
+            billingStates.find("option").remove();
+            jQuery.each(stateList, function(state) {
+                geoVolues = this.split(': ');
+                billingStates.append(jQuery("<option value = " + geoVolues[1] + " >" + geoVolues[0] + "</option>"));
             });
-            $(divId).update(optionList);
         }
     });
 }
+
 function updateShippingSummary() {
     var fullName = jQuery('#firstName').val() + " " +jQuery('#lastName').val();
     var extension = "";

Modified: ofbiz/branches/jquery/specialpurpose/ecommerce/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/specialpurpose/ecommerce/widget/CommonScreens.xml (original)
+++ ofbiz/branches/jquery/specialpurpose/ecommerce/widget/CommonScreens.xml Tue Oct 26 19:32:36 2010
@@ -256,13 +256,14 @@ under the License.
                 <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: -->
                 <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/>
-                <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/>
-                <set field="initialLocale" type="String" value="${groovy:parameters?.userLogin?.lastLocale?.substring(0,2)}" default-value="${groovy:locale?.toString()?.substring(0,2)?:'en'}"/>
-                <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${initialLocale}.js" global="true"/>
-                <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/>
-                <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/>
-                <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/>
-                <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/popup.js" global="true"/>
+
+                <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/js/jquery-ui-1.8.2.custom.min.js" global="true"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/datetimepicker/jquery-ui-timepicker-addon-0.5.js" global="true"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/validate/jquery.validate.min.js" global="true"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js" global="true"/>
+                <set field="initialLocale" type="String" value="${parameters.userLogin.lastLocale}" default-value="${groovy:locale.toString()}"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-${initialLocale}.js" global="true"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.4.2.min.js" global="true"/>
 
                 <script location="component://ecommerce/widget/EcommerceSetup.groovy"/>
 

Modified: ofbiz/branches/jquery/specialpurpose/myportal/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/myportal/widget/CommonScreens.xml?rev=1027699&r1=1027698&r2=1027699&view=diff
==============================================================================
--- ofbiz/branches/jquery/specialpurpose/myportal/widget/CommonScreens.xml (original)
+++ ofbiz/branches/jquery/specialpurpose/myportal/widget/CommonScreens.xml Tue Oct 26 19:32:36 2010
@@ -137,9 +137,6 @@ under the License.
     <!--New Register Person-->
     <screen name="newRegisterLogin">
         <section>
-            <actions>
-                <set field="layoutSettings.javaScripts[]" value="/images/dojo/dojo.js" global="true"/>
-            </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">