var pmaWidgetInstance60535eccd9685ed27249e623 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a443d1f4efa9c7c15ed0c88b621aa3ff:c466cbb293ef2130c72cfb2a766362dd3f03de9dc8616d83d110ca86afb886935ebb176e6caac6238108c09d2e8fa9b9bca9ccf6ac4ceec71dbb6b742cc057cb2f6e4d33e4e6d472da342c06f6b4c843922a11905bebd5e93d385cd62c283b893d1a053ec7041fe68aa2e9309d731af63e15477128367473423648db655affb6facca61771fd966f37c940a50e03998988de900097039b37cc320040bac63f266f75a82b369862b4a756ec3a5a363ee36159fc7a8b645a26aedac262354483c0bf2274890e50b9f3f0ab66d6c1afc715", shop_name: "pelotony.sk", shop_logo: "https://y1.sk/t/s/130x50/59907.jpg", product_price: "297,70 €", 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(){ pmaWidgetInstance60535eccd9685ed27249e623.initWidget("60535eccd9685ed27249e623"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }