var pmaWidgetInstance659bd25cae16db34664b1add = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6a8ea559f5f4bead4507459a751adb3f:b17d0d6ff8df8ad11d93833a467b73da3f1c96043a539d59b6c684b882b3d20353a9cc651c7b5b9932302e61fe7a72c578314337a387ebf6171cc53ab123c9bbd7afa733bd800a96f4eb4eacffdd9b05ca3de2e1d4d707a4f61f6385544cce91fc458024695acd556640cb001969fc04876e987221733c4b765de98010c06a11c1105e4e46f76e002753d56f67ad8027a8881f5e34a064a8ad7a855da0ae91b71948d5126802eed8f133559f07c178a0d397847cf74484f4036866fc77254feae298dc3c47e3184e89af03f961fefad3", shop_name: "candysk.sk", shop_logo: "https://y1.sk/t/s/130x50/58407.jpg", product_price: "315,00 €", product_shipping: "0,00 €", product_availability: "", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance659bd25cae16db34664b1add.initWidget("659bd25cae16db34664b1add"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }