var pmaWidgetInstance6083df663975337b9e3def1a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=09782674ea7479302f9d8db9214cf9ba:374745bc019ee5189a18cb5a33db30561735c0a3e20f9d082c1a7d93594c59d035dcd0526c3c7837463cb45e242f50409cd2c7b670f2843ba2baea9033622952d0e2fce80ecbf58b9152901b7f75e2a5e93a09969fda010d1f1b1e268102ee081f21dfb354403dc6cf086477ada71b96347ed6ad8681e8c8e52bdec4f7f2d6facf7353a6ebe4760bbcd7dfc50adf58ff248b545de2ea26e25d143199edda314c789d3abc850689f056da7b5bf0b314a8519ef8d8aaed41ae9d23afcb80f1e2fd00373390a5a192c5de88d73b2ee5dc7b", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "730,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(){ pmaWidgetInstance6083df663975337b9e3def1a.initWidget("6083df663975337b9e3def1a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }