var pmaWidgetInstance6022c80ed9685ed2720f80a2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ff7a8cd0e714992264a62c08dda132b0:9807ac1408d4dd48bc7851261b12b5a6665034015661093d787b3f0f961faab1258cadf33868a48d74c360f868a8012722328524f945ac56931a1f8cf85e12738cb2dbac53fd9dd3d69b86357d708b82037296dbaa21484397e26f7e8b920301a598b45bf9b92c44d4a06f7edf8dd312bbf843bdbdc1bf44d65b1de5bde0e4f8ce0f83074f161d10f86cd287deaeca953a16fb1b60f0bed32b36ebbc687bb9491994d6632ec73b39cd89e9e71686dac9555d381920486d0c428ec0cf35ff9ba9668369d2b358f3faaef6c0d48771f2cd", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "116,83 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance6022c80ed9685ed2720f80a2.initWidget("6022c80ed9685ed2720f80a2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }