PageSourceSearch

https://www.witre.fi/fstrz/r/s/www.witre.fi/wcsstore/ManutanSAS/ja…/ShoppingList/ShoppingList_1789552682142.js

js witre.fi collected 2026-09-26 16:27:25 UTC 17,757 bytes, 1 lines download raw bytes

1function ShoppingListJS(storeParams,catEntryParams,shoppingListNames,jsObjectName){this.storeParams=storeParams,this.catEntryParams=catEntryParams,this.catEntryParams.quantity=1,this.shoppingListNames=shoppingListNames,this.addItemAfterCreate=!1,this.jsObjectName=jsObjectName,this.dropDownVisible=!1,this.dropDownInFocus=!1,this.dropDownOpen=!1,this.exceptionFlag=!1,this.mouseOnArrow=!1,this.pageName="",this.itemId=-1;var eventName="";for(baseItemId in this.nameToDelete="",this.orderItemId="",this.actionBeingPerformed="","shoppingListJS"!=jsObjectName&&(this.pageName=jsObjectName.replace("shoppingListJS",""),eventName=this.pageName+"_"),this.setCatEntryQuantity=function(e){e=dojo.fromJson(e);if(dojo.isObject(e)){var t=this.catEntryParams.components[e.baseItemId];t.id!=e.baseItemId&&0!=e.id&&(t.id=e.id),t.quantity=e.quantity}else this.catEntryParams.quantity=e},this.setCatEntryAttributes=function(e){this.catEntryParams.attributes=dojo.fromJson(e)},this.setItemId=function(e){this.itemId=e},this.hideDropDown=function(){var e=dojo.byId(this.pageName+"shoppingListDropDown");if(e){e.style.display="none",dojo.query("#"+this.pageName+"addToShoppingListBtn .drop")[0].focus(),this.dropDownVisible=!1,this.dropDownInFocus=!1,this.dropDownOpen=!1;var t=dojo.query(".widget_quick_info_popup .content_right_border")[0];null!=t&&dojo.style(t,"height","auto")}},this.showDropDown=function(){if(0==this.dropDownOpen){var e=dojo.query(".widget_quick_info_popup .content_right_border")[0],t=dojo.position(e).h;if(dojo.byId(this.pageName+"shoppingListDropDown").style.display="",this.dropDownVisible=!0,dojo.query("#"+this.pageName+"shoppingListDropDown.dropdown_list div").removeClass("focused"),dojo.byId("quickInfoRefreshArea")&&dojo.byId("QuickInfoshoppingListDropDown")){var s=dojo.position(dojo.byId("quickInfoRefreshArea")).h,i=dojo.position(dojo.byId("QuickInfoshoppingListDropDown")).h,o=dojo.position(e).h;if(s+i>o){var a=dijit.byId("quickInfoPopup");dojo.style(e,"height",o+i+"px"),a.resize(),t<o&&(dojo.style(e,"height",t+i+"px"),a.resize())}}this.dropDownOpen=!0}else this.hideDropDown()},this.showPopup=function(e){this.hideDropDown(),this.clearPopupText();var t=dijit.byId(this.pageName+e+"ShoppingListPopup");this.hideErrorMessage(),this.hideEditErrorMessage(),null!=t?(t.closeButtonNode.style.display="none",closeAllDialogs(),setTimeout(function(){t.show()},250),"create"==e?dojo.byId(this.pageName+"newListName").focus():"edit"==e&&dojo.byId("editListName").focus()):console.debug(e+"ShoppingListPopup does not exist")},this.showSuccessDialog=function(){var e=dijit.byId(this.pageName+"shoppingListCreateSuccessPopup");null!=e&&""!=this.actionBeingPerformed&&(dojo.byId(this.pageName+"successMessageAreaText").innerHTML=storeNLS.LIST_CREATED,e.closeButtonNode.style.display="none",e.show(),this.actionBeingPerformed="")},this.showMessageDialog=function(e){var t=dijit.byId(this.pageName+"shoppingListCreateSuccessPopup");null!=t&&(dojo.byId(this.pageName+"successMessageAreaText").innerHTML=e,t.closeButtonNode.style.display="none",t.show())},this.showErrorMessage=function(e){document.getElementById(this.pageName+"shoppingListErrorMessageArea")&&document.getElementById(this.pageName+"shoppingListErrorMessageText")&&(document.getElementById(this.pageName+"shoppingListErrorMessageText").innerHTML=e,document.getElementById(this.pageName+"shoppingListErrorMessageArea").style.display="block")},this.hideErrorMessage=function(){document.getElementById(this.pageName+"shoppingListErrorMessageArea")&&document.getElementById(this.pageName+"shoppingListErrorMessageText")&&(document.getElementById(this.pageName+"shoppingListErrorMessageText").innerHTML="",document.getElementById(this.pageName+"shoppingListErrorMessageArea").style.display="none")},this.showEditErrorMessage=function(e){document.getElementById("editShoppingListErrorMessageArea")&&document.getElementById("editShoppingListErrorMessageText")&&(document.getElementById("editShoppingListErrorMessageText").innerHTML=e,document.getElementById("editShoppingListErrorMessageArea").style.display="block")},this.hideEditErrorMessage=function(){document.getElementById("editShoppingListErrorMessageArea")&&document.getElementById("editShoppingListErrorMessageText")&&(document.getElementById("editShoppingListErrorMessageText").innerHTML="",document.getElementById("editShoppingListErrorMessageArea").style.display="none")},this.create=function(){var e=trim(dojo.byId(this.pageName+"newListName").value),t=dojo.byId(this.pageName+"newListName").maxLength,s=storeNLS.DEFAULT_WISH_LIST_NAME;if(this.empty(e))this.showErrorMessage(storeNLS.ERR_NAME_EMPTY);else if(MessageHelper.isValidUTF8length(e,t))if(e==s)this.showErrorMessage(storeNLS.ERR_NAME_SHOPPING_LIST);else if(this.isDuplicate(e))this.showErrorMessage(storeNLS.ERR_NAME_DUPLICATE);else if(this.validateWishName(e)){var i=this.setCommonParams();i.name=e;var o=dijit.byId(this.pageName+"createShoppingListPopup");if(null!=o&&o.hide(),!submitRequest())return;cursor_wait(),wc.service.invoke("ShoppingListServiceCreate",i),this.actionBeingPerformed="create"}
1else this.showErrorMessage(storeNLS.INVALID_NAME_SHOPPING_LIST);else this.showErrorMessage(storeNLS.ERR_NAME_TOOLONG)},this.createDefaultListAndAddItem=function(e,t,s){if(t&&""!=t&&(this.orderItemId=t),"-1"==e){var i=this.setCommonParams();if(i.name=storeNLS.DEFAULT_WISH_LIST_NAME,!submitRequest())return;cursor_wait(),this.addItemAfterCreate=!0,wc.service.invoke("ShoppingListServiceCreate",i)}else t&&""!=t?this.addToListAndDelete(e,t,s):this.addToList(e,s)},this.addToList=function(e,t){this.hideDropDown();var s=this.setCommonParams();s.giftListId=e;var i=this.catEntryParams.id;if("itembean"==this.catEntryParams.type.toLowerCase()||"packagebean"==this.catEntryParams.type.toLowerCase()||"preddynakitbean"==this.catEntryParams.type.toLowerCase()||"dynamickitbean"==this.catEntryParams.type.toLowerCase())updateParamObject(s,"catEntryId",this.catEntryParams.id,!1,-1),updateParamObject(s,"quantity",this.catEntryParams.quantity,!1,-1);else if("bundlebean"==this.catEntryParams.type.toLowerCase()){var o=!0;for(baseItemId in this.catEntryParams.components)if(this.catEntryParams.components[baseItemId].skus&&this.catEntryParams.components[baseItemId].skus.length>1){var a=this.catEntryParams.components[baseItemId].resolved;if(null==a||"undefined"==a||0==a){o=!1;break}}if(!o)return void MessageHelper.displayErrorMessage(storeNLS.ERR_RESOLVING_SKU);for(baseItemId in this.catEntryParams.components)updateParamObject(s,"catEntryId",this.catEntryParams.components[baseItemId].id,!1,-1),updateParamObject(s,"quantity",this.catEntryParams.components[baseItemId].quantity,!1,-1)}else{var r=this.itemId;if(-1==r&&(r=this.resolveSKU()),-1==r)return void MessageHelper.displayErrorMessage(storeNLS.ERR_RESOLVING_SKU);i=r,updateParamObject(s,"catEntryId",r,!1,-1),updateParamObject(s,"quantity",this.catEntryParams.quantity,!1,-1)}"shoppingListJS"!=this.jsObjectName&&QuickInfoJS.close(),submitRequest()&&(cursor_wait(),ShoppingListDialogJS.setDialogParams(this.storeParams,{catEntryId:i,thumbnail:"imgPath",focusElement:t}),wc.service.invoke("ShoppingListServiceAddItem",s))},this.isDuplicate=function(e){e=this.escapeXml(e,!0);return 1==this.shoppingListNames[e.toUpperCase()]},this.updateDefaultListId=function(e){this.shoppingListNames[storeNLS.DEFAULT_WISH_LIST_NAME]=1,dojo.byId(this.pageName+"addToShoppingList")&&(dojo.byId(this.pageName+"addToShoppingList").href="javascript:"+this.jsObjectName+".createDefaultListAndAddItem("+e+");")},this.updateShoppingList=function(e,t,s){var i=this.escapeXml(t,!1);if(this.shoppingListNames[i.toUpperCase()]=1,!s||"edit"!=s&&"delete"!=s||(this.shoppingListNames[this.nameToDelete.toUpperCase()]=-1),dojo.byId(this.pageName+"ShoppingListDivider"))if(-1==this.pageName.indexOf("OI"))dojo.place('<div role="menuitem" id="'+this.pageName+"ShoppingList_"+e+'" class="created_list" onfocus="javascript:'+jsObjectName+".focusList('"+e+'\'); "  onblur="javascript: this.className = \'created_list\';" onclick="javascript:'+jsObjectName+".addToList('"+e+'\');"><a role="menuitem" id="'+this.pageName+"ShoppingListLink_"+e+'" href="javascript:'+jsObjectName+".addToList('"+e+'\');" onfocus="javascript:'+jsObjectName+".focusListLink('"+e+"');\">"+t+"</a></div>",this.pageName+"ShoppingListDivider","before");else{var o=this.pageName.replace("OI","");dojo.place('<div role="menuitem" id="'+this.pageName+"ShoppingList_"+e+'" class="created_list" onfocus="javascript:'+jsObjectName+".focusList('"+e+'\'); "  onblur="javascript: this.className = \'created_list\';" onclick="javascript:'+jsObjectName+".addToListAndDelete('"+e+"','"+o+'\');"><a role="menuitem" id="'+this.pageName+"ShoppingListLink_"+e+'" href="javascript:'+jsObjectName+".addToListAndDelete('"+e+"','"+o+'\');" onfocus="javascript:'+jsObjectName+".focusListLink('"+e+"');\">"+t+"</a></div>",this.pageName+"ShoppingListDivider","before")}},this.clearPopupText=function(){dojo.byId(this.pageName+"newListName").value=""},this.escapeXml=function(e,t){return t&&(e=e.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")),e.replace(/"/gm,"&#034;").replace(/'/gm,"&#039;")},this.resolveSKU=function(){if(1==this.catEntryParams.skus.length)return this.catEntryParams.skus[0].id;for(idx=0;idx<this.catEntryParams.skus.length;idx++){var e=0,t=0;
1for(attribute in this.catEntryParams.skus[idx].attributes){if(t++,!this.catEntryParams.attributes||this.catEntryParams.skus[idx].attributes[attribute]!=this.catEntryParams.attributes[attribute])break;e++}if(0!=e&&e==t)return this.catEntryParams.skus[idx].id}return-1},this.setCommonParams=function(){var e={};return e.storeId=this.storeParams.storeId,e.catalogId=this.storeParams.catalogId,e.langId=this.storeParams.langId,e},this.empty=function(e){return null==e||null==e||""==e},this.redirectToSignOn=function(){var e=document.location.href;if(-1!=e.lastIndexOf("s",4))var t=e;else t=e.substring(0,4)+"s"+e.substring(4);if(t.indexOf("?")>-1)var s=t+"&";else s=t+"?";dojo.cookie("WC_DisplaySignInPanel_"+WCParamJS.storeId,"true",{path:"/"});var i=location.href;1==isGuest&&(i=getAbsoluteURL()+"RESTMoveOrderItem?continue=1&createIfEmpty=1&updatePrices=0&deleteIfEmpty=*&fromOrderId=*&toOrderId=.&page=&calculationUsageId=-1&URL="+encodeURIComponent("RESTOrderCalculate?URL="+encodeURIComponent(i))),document.location.href=s+"myAcctMain=1&storeId="+this.storeParams.storeId+"&catalogId="+this.storeParams.catalogId+"&langId="+this.storeParams.langId+"&URL="+encodeURIComponent(i)},this.focusList=function(e){this.focusListByElementId(this.pageName+"ShoppingList_"+e)},this.focusListByElementId=function(e){dojo.hasClass(e,"focused")||dojo.byId(e.replace("ShoppingList","ShoppingListLink")).focus()},this.focusListLink=function(e){dojo.query("#"+this.pageName+"shoppingListDropDown.dropdown_list div").removeClass("focused"),dojo.addClass(this.pageName+"ShoppingList_"+e,"focused")},this.updateShoppingListAndAddItem=function(e){e.listName==storeNLS.DEFAULT_WISH_LIST_NAME?this.updateDefaultListId(e.listId):this.updateShoppingList(e.listId,e.listName,e.action),this.addItemAfterCreate?(this.addItemAfterCreate=!1,""!=this.orderItemId?this.addToListAndDelete(e.listId,this.orderItemId):this.addToList(e.listId)):"add"==e.action&&this.showSuccessDialog()},this.navigateDropDown=function(e){var t=this;if(e.keyCode==dojo.keys.UP_ARROW){dojo.stopEvent(e);var s=!1;dojo.query("#"+t.pageName+"shoppingListDropDown.dropdown_list div.created_list").forEach(function(e,i,o){!s&&dojo.hasClass(e,"focused")&&(0==i?t.focusListByElementId(o[o.length-1].id):t.focusListByElementId(o[i-1].id),s=!0)})}else if(e.keyCode==dojo.keys.DOWN_ARROW){dojo.stopEvent(e);s=!1;dojo.query("#"+t.pageName+"shoppingListDropDown.dropdown_list div.created_list").forEach(function(e,i,o){!s&&dojo.hasClass(e,"focused")&&(o.length-1==i?t.focusListByElementId(o[0].id):t.focusListByElementId(o[i+1].id),s=!0)})}else e.keyCode!=dojo.keys.ESCAPE&&e.keyCode!=dojo.keys.TAB||(dojo.stopEvent(e),this.hideDropDown())},this.hideIfNoFocus=function(){!this.dropDownVisible||this.dropDownInFocus||this.mouseOnArrow||this.hideDropDown()},this.hasFocus=function(e){dojo.mouseButtons.isRight(e)?this.dropDownInFocus=!1:this.dropDownInFocus=!0},this.edit=function(){var e=trim(dojo.byId("editListName").value),t=e.maxLength,s=storeNLS.DEFAULT_WISH_LIST_NAME;if(this.empty(e))this.showEditErrorMessage(storeNLS.ERR_NAME_EMPTY);else if(MessageHelper.isValidUTF8length(e,t))if(e==s)this.showEditErrorMessage(storeNLS.ERR_NAME_SHOPPING_LIST);else if(this.isDuplicate(e))this.showEditErrorMessage(storeNLS.ERR_NAME_DUPLICATE);else if(this.validateWishName(e)){var i=this.setCommonParams();i.name=e;var o=dojo.byId("multipleWishlistController_select");null!=o&&"undefined"!=o&&0!=o.value&&(i.giftListId=dojo.byId("multipleWishlistController_select").value,this.nameToDelete=dojo.byId("multipleWishlistController_select").options[o.selectedIndex].text);var a=dijit.byId("editShoppingListPopup");if(null!=a&&a.hide(),!submitRequest())return;cursor_wait(),wc.service.invoke("ShoppingListServiceUpdate",i)}else this.showErrorMessage(storeNLS.INVALID_NAME_SHOPPING_LIST);else this.showEditErrorMessage(storeNLS.ERR_NAME_TOOLONG)},this.deleteList=function(){var e=this.setCommonParams(),t=dojo.byId("multipleWishlistController_select");null!=t&&"undefined"!=t&&0!=t.value&&(e.giftListId=dojo.byId("multipleWishlistController_select").value,this.nameToDelete=dojo.byId("multipleWishlistController_select").options[t.selectedIndex].text);var s=dijit.byId("deleteShoppingListPopup");
1null!=s&&s.hide(),submitRequest()&&(cursor_wait(),wc.service.invoke("ShoppingListServiceDelete",e))},this.refreshLinkState=function(){var e=dojo.byId("multipleWishlistController_select");null!=e&&(dojo.byId("multipleWishlistController_select").options[e.selectedIndex].text==storeNLS.DEFAULT_WISH_LIST_NAME?(dojo.byId("editDivider").style.display="none",dojo.byId("edit_popup_link").style.display="none",dojo.byId("deleteDivider").style.display="none",dojo.byId("delete_popup_link").style.display="none"):(dojo.byId("editDivider").style.display="block",dojo.byId("edit_popup_link").style.display="block",dojo.byId("deleteDivider").style.display="block",dojo.byId("delete_popup_link").style.display="block"))},this.addToListAndDelete=function(e,t,s){this.orderItemId=t,dojo.publish("modelChanged/AnalyticsConversionEvent"),this.hideDropDown();var i=this.setCommonParams();i.giftListId=e,i.catEntryId_1=this.catEntryParams.id,i.quantity_1=1,submitRequest()&&(cursor_wait(),ShoppingListDialogJS.setDialogParams(this.storeParams,{catEntryId:this.catEntryParams.id,name:this.catEntryParams.name,image:this.catEntryParams.image,thumbnail:"imgPath",focusElement:s}),wc.service.invoke("ShoppingListServiceAddItemAndRemoveFromCart",i))},this.deleteItemFromCart=function(){if(""!=this.orderItemId){var e=this.orderItemId;this.orderItemId="",""!=e&&CheckoutHelperJS.deleteFromCart(e,!0)}},this.validateWishName=function(e){var t="~!@#$%^&*()+=[]{};:,<>?/|`";t+="\t'\"\\/";for(var s=0;s<e.length;s++)if(t.indexOf(e.substring(s,s+1))>=0)return!1;return!0},this.setResolved=function(e,t){this.catEntryParams.components[e].resolved=t},dojo.connect(document.documentElement,"onmousedown",this,"hideIfNoFocus"),this.catEntryParams.components)dojo.topic.subscribe("DefiningAttributes_Resolved_"+baseItemId,function(catEntryId,productId){eval(jsObjectName+".setRe
1solved('"+productId+"', true)")}),dojo.topic.subscribe("DefiningAttributes_Changed_"+baseItemId,function(catEntryId,productId){0==catEntryId&&eval(jsObjectName+".setResolved('"+productId+"', false)")})}"undefined"!=typeof ShoppingListDialogJS&&null!=ShoppingListDialogJS&&ShoppingListDialogJS||(ShoppingListDialogJS={storeParams:null,dialogParams:null,setDialogParams:function(e,t){this.storeParams=e,this.dialogParams=t,null==this.dialogParams.image||""==this.dialogParams.image?this.fetchAddedItem():this.displayItemAddedWithoutFetching()},fetchAddedItem:function(){var e=this.setCommonParams();e.productId=this.dialogParams.catEntryId,e.catalogEntryId=this.dialogParams.catEntryId,dojo.xhrPost({url:getAbsoluteURL()+"GetCatalogEntryDetailsByIDView",handleAs:"json-comment-filtered",content:e,service:this,load:ShoppingListDialogJS.displayItemAddedDialog,error:function(e,t){console.debug("QuickInfoJS.selectItem: Unexpected error occurred during an xhrPost request.")}})},displayItemAddedDialog:function(e,t){null!=dijit.byId("shoppingListItemAddedPopup")?(dojo.byId("shoppingListItemAddedImg").src=e.catalogEntry.description[0].thumbnail.replace("160x160","105x105"),dojo.byId("shoppingListItemAddedImg").alt=e.catalogEntry.description[0].name,dojo.byId("shoppingListItemAddedName").innerHTML=e.catalogEntry.description[0].name):console.debug("shoppingListItemAddedPopup does not exist")},displayItemAddedWithoutFetching:function(){null!=dijit.byId("shoppingListItemAddedPopup")?(dojo.byId("shoppingListItemAddedImg").src=this.dialogParams.image,dojo.byId("shoppingListItemAddedImg").alt=this.dialogParams.name,dojo.byId("shoppingListItemAddedName").innerHTML=this.dialogParams.name):console.debug("shoppingListItemAddedPopup does not exist")},showDialog:function(){var e=dijit.byId("shoppingListItemAddedPopup");null!=e?(e.closeButtonNode.style.display="none",e.show()):console.debug("shoppingListItemAddedPopup does not exist")},setCommonParams:function(){var e=new Object;return e.storeId=this.storeParams.storeId,e.catalogId=this.storeParams.catalogId,e.langId=this.storeParams.langId,e},close:function(){dijit.byId("shoppingListItemAddedPopup").hide(),this.dialogParams.focusElement&&""!=this.dialogParams.focusElement&&dojo.byId(this.dialogParams.focusElement).focus()}},dojo.topic.subscribe("ShoppingListItem_Added",ShoppingListDialogJS.showDialog));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.