var pmaWidgetInstance5fcf701fd9685ed2723b5923 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8a1cd8fb05de8927a64e2f0cd484a66f:91f0dd071eaaf41e5ee434b29cb537a95c6fba6b93a685f1261ce7769b5974217f1ece6dfcf9eabad4166df8d67606342238f1729bc218ecc2ddf3c6e419ec9c5148898ed5c40fa578a251674b17a1907e532843eb8072e6a0f37acbed0971abe45e2e5861393a9cc1adec48ed66393e9a812a3eddf908650d6c1f303d4e25894fe36fd73b0c8c3978826d3381c859775d9273b969f2936cb94e3d3713411a44051a6bc849ae378240730cf63f212ee4045a75ac16af66f0c4b6624fda03336d", shop_name: "SADAJ.sk", shop_logo: "https://y1.sk/t/s/130x50/59800.jpg", product_price: "545,64 €", product_shipping: "0,00 €", product_availability: "Skladom", 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(){ pmaWidgetInstance5fcf701fd9685ed2723b5923.initWidget("5fcf701fd9685ed2723b5923"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }