var pmaWidgetInstance5fc8ed62d9685ed2720ecd07 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=08a688d6f8daabbd906baf63160641e8:640dfc6059c1224b718e211040358903b27767eaad542e86d15258b18f04c7be06839f20186380dd932627460fb5c0fb1f4263b275e95da78d8b567b058f95ddf886a6e0b78efcf8abd1901c3f724b3952d2abc1f1d5ae870c1b64de8db50017a047e493e7cd91b40809450d7dc8e1321a849f9f0f6ff055c40cf7311976f883cf2da62b1fce6c48b91f1d19bbe1cd1c96d85fa74aa847df464b5f337359fca2125f34e93948505c41c7dda054256f6cd04f821bf0f54cad75cb66397e7efc7e1b6ec5ce0b21f68d4d8b1365c4594e4a", shop_name: "Rozumnehracky.sk", shop_logo: "https://y1.sk/t/s/130x50/51195.jpg", product_price: "39,66 €", 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(){ pmaWidgetInstance5fc8ed62d9685ed2720ecd07.initWidget("5fc8ed62d9685ed2720ecd07"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }