var pmaWidgetInstance6006b159d9685ed2723ef754 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=56925ffca04d94c6714c7bb93aa39fa8:b1450688fd4e86b20a5de47b47c36f60e4d1bb38f532862e21f432e88c0f040ce6923db7e912a8ec819747b90014ebfd3d33e486eaf2092be8e98a67b4a415506e3a8cdec1c1a2c0b08ddca671af22dbb8cc38086c2bb764375c2ab7cbaf7c6abd024c4066a52b478af17299c6ca8b34178dd16b0dac6c9380708d5aa6c25d6be32e17b836734ba6fb997937b3ca3bfdd26132d628fde4f58cdaf58c1432e00df7cdeac371a4f77d550dbc69a7dcd5c10aa3aa3666b45583a3543bb1bf0af298", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "53,90 €", product_shipping: "", 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(){ pmaWidgetInstance6006b159d9685ed2723ef754.initWidget("6006b159d9685ed2723ef754"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }