Author: jleroux
Date: Fri Sep 4 20:01:08 2009 New Revision: 811528 URL: http://svn.apache.org/viewvc?rev=811528&view=rev Log: Fix "popup window for image opens then closes immediately" (https://issues.apache.org/jira/browse/OFBIZ-2805) - OFBIZ-2805 Introduce a label in CommonUiLabels.xml Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/configproductdetail.ftl ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/inlineProductDetail.ftl ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl ofbiz/trunk/framework/common/config/CommonUiLabels.xml ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/configproductdetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/configproductdetail.ftl?rev=811528&r1=811527&r2=811528&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/configproductdetail.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/configproductdetail.ftl Fri Sep 4 20:01:08 2009 @@ -58,7 +58,7 @@ function popupDetail() { var defaultDetailImage = "${firstDetailImage?default(mainDetailImageUrl?default("_NONE_"))}"; - if (defaultDetailImage == null || defaultDetailImage == "null") { + if (defaultDetailImage == null || defaultDetailImage == "null" || defaultDetailImage == "") { defaultDetailImage = "_NONE_"; } @@ -67,7 +67,10 @@ } if (detailImageUrl == "_NONE_") { - alert("No detail image available to display."); + hack = document.createElement('span'); + hack.innerHTML="${uiLabelMap.CommonNoDetailImageAvailableToDisplay}"; + alert(hack.innerHTML); + return; return; } popUp("<@ofbizUrl>detailImage?detail=" + detailImageUrl + "</@ofbizUrl>", 'detailImage', '400', '550'); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/inlineProductDetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/inlineProductDetail.ftl?rev=811528&r1=811527&r2=811528&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/inlineProductDetail.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/inlineProductDetail.ftl Fri Sep 4 20:01:08 2009 @@ -26,7 +26,7 @@ function popupDetailInline(inlineCounter) { var imageField = 'detailImage' + inlineCounter; var defaultDetailImage = document.getElementById(imageField); - if (defaultDetailImage == null || defaultDetailImage == "null") { + if (defaultDetailImage == null || defaultDetailImage == "null" || defaultDetailImage == "") { defaultDetailImage = "_NONE_"; } var fieldName = 'detailImageUrl' + inlineCounter; @@ -35,7 +35,10 @@ } if (window[fieldName] == "_NONE_") { - alert("No detail image available to display."); + hack = document.createElement('span'); + hack.innerHTML="${uiLabelMap.CommonNoDetailImageAvailableToDisplay}"; + alert(hack.innerHTML); + return; return; } popUp("<@ofbizUrl>detailImage?detail=" + window[fieldName] + "</@ofbizUrl>", 'detailImage', '400', '550'); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl?rev=811528&r1=811527&r2=811528&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl Fri Sep 4 20:01:08 2009 @@ -96,7 +96,7 @@ function popupDetail() { var defaultDetailImage = "${firstDetailImage?default(mainDetailImageUrl?default("_NONE_"))}"; - if (defaultDetailImage == null || defaultDetailImage == "null") { + if (defaultDetailImage == null || defaultDetailImage == "null" || defaultDetailImage == "") { defaultDetailImage = "_NONE_"; } @@ -105,7 +105,10 @@ } if (detailImageUrl == "_NONE_") { - alert("No detail image available to display."); + hack = document.createElement('span'); + hack.innerHTML="${uiLabelMap.CommonNoDetailImageAvailableToDisplay}"; + alert(hack.innerHTML); + return; return; } popUp("<@ofbizUrl>detailImage?detail=" + detailImageUrl + "</@ofbizUrl>", 'detailImage', '400', '550'); Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=811528&r1=811527&r2=811528&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Fri Sep 4 20:01:08 2009 @@ -4500,6 +4500,10 @@ <value xml:lang="th">Custom method name for UoM conversion not found</value> <value xml:lang="zh">没ææ¾å°ç¨äºè´§å¸è½¬æ¢çå®å¶æ¹æ³å称</value> </property> + <property key="CommonNoDetailImageAvailableToDisplay"> + <value xml:lang="en">No detail image available to display.</value> + <value xml:lang="fr">Aucune image détaillée à afficher.</value> + </property> <property key="CommonNoElementFound"> <value xml:lang="ar">Ùا عÙصر Ù ÙجÙد</value> <value xml:lang="de">Kein Element gefunden</value> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl?rev=811528&r1=811527&r2=811528&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl Fri Sep 4 20:01:08 2009 @@ -58,7 +58,7 @@ function popupDetail() { var defaultDetailImage = "${firstDetailImage?default(mainDetailImageUrl?default("_NONE_"))}"; - if (defaultDetailImage == null || defaultDetailImage == "null") { + if (defaultDetailImage == null || defaultDetailImage == "null" || defaultDetailImage == "") { defaultDetailImage = "_NONE_"; } @@ -67,9 +67,13 @@ } if (detailImageUrl == "_NONE_") { - alert("No detail image available to display."); + hack = document.createElement('span'); + hack.innerHTML="${uiLabelMap.CommonNoDetailImageAvailableToDisplay}"; + alert(hack.innerHTML); + return; return; } + alert(detailImageUrl); popUp("<@ofbizUrl>detailImage?detail=" + detailImageUrl + "</@ofbizUrl>", 'detailImage', '400', '550'); } @@ -244,7 +248,7 @@ <div>${uiLabelMap.ProductRegularPrice}: <span class='basePrice'><@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed/></span></div> </#if> <div> - + <#if price.isSale?exists && price.isSale> <span class='salePrice'>${uiLabelMap.OrderOnSale}!</span> <#assign priceStyle = "salePrice"> @@ -252,7 +256,7 @@ <#assign priceStyle = "regularPrice"> </#if> ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual?if_exists> from </#if><span class='${priceStyle}'><@ofbizCurrency amount=price.price isoCode=price.currencyUsed/></span> - + </div> <#if price.listPrice?exists && price.price?exists && price.price < price.listPrice> <#assign priceSaved = price.listPrice - price.price> @@ -363,7 +367,7 @@ </form> <div> <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> - + <form name="addToShoppingList" method="post" action="<@ofbizUrl>addItemToShoppingList<#if requestAttributes._CURRENT_VIEW_?exists>/${requestAttributes._CURRENT_VIEW_}</#if></@ofbizUrl>"> <input type="hidden" name="productId" value="${product.productId}"> <input type="hidden" name="product_id" value="${product.productId}"> @@ -427,7 +431,7 @@ </td> </tr> - + <#-- Long description of product --> <tr> @@ -456,7 +460,7 @@ </div> </td> </tr> - + <#assign counter = 0> <#assign questions = configwrapper.questions> <#list questions as question> @@ -598,14 +602,14 @@ </#if> </td> </tr> - + <#assign counter = counter + 1> </#list> </table> </form> </td> </tr> - + <#-- Product Reviews --> <tr> @@ -645,7 +649,7 @@ <div>${productReview.productReview?if_exists}</div> </td> </tr> - + </table> </td> </tr> @@ -678,7 +682,7 @@ <#if assocProducts?has_content> <tr><td> </td></tr> <tr><td colspan="2"><h2>${beforeName?if_exists}<#if showName == "Y">${productContentWrapper.get("PRODUCT_NAME")?if_exists}</#if>${afterName?if_exists}</h2></td></tr> - + <#list assocProducts as productAssoc> <tr><td> <div> @@ -700,7 +704,7 @@ </td> </tr> <#local listIndex = listIndex + 1> - + </#list> ${setRequestAttribute("optProductId", "")} ${setRequestAttribute("formNamePrefix", "")} @@ -725,7 +729,7 @@ <#-- special cross/up-sell area using commonFeatureResultIds (from common feature product search) --> <#if commonFeatureResultIds?has_content> <h2>Similar Products That Might Interest You...</h2> - + <#list commonFeatureResultIds as commonFeatureResultId> <div> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl?rev=811528&r1=811527&r2=811528&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl Fri Sep 4 20:01:08 2009 @@ -96,7 +96,7 @@ function popupDetail() { var defaultDetailImage = "${firstDetailImage?default(mainDetailImageUrl?default("_NONE_"))}"; - if (defaultDetailImage == null || defaultDetailImage == "null") { + if (defaultDetailImage == null || defaultDetailImage == "null" || defaultDetailImage == "") { defaultDetailImage = "_NONE_"; } @@ -105,7 +105,9 @@ } if (detailImageUrl == "_NONE_") { - alert("No detail image available to display."); + hack = document.createElement('span'); + hack.innerHTML="${uiLabelMap.CommonNoDetailImageAvailableToDisplay}"; + alert(hack.innerHTML); return; } popUp("<@ofbizUrl>detailImage?detail=" + detailImageUrl + "</@ofbizUrl>", 'detailImage', '400', '550'); |
Free forum by Nabble | Edit this page |