var pmaWidgetInstance6357b82dac365ae37415b437 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d89525bb46dd34216831ebb326e94ddd:0ec65ed618d81b562ff01448e2ebbe6a4a5e9cbcac5db76f9359c0f80bd9077d53c70cb4f20702b4c598381d0ba6129bff0753fbb82ecb27ed3182e37425ae5fded381ff84c2ae04de2a17ffdb8987dede19b996a8bad663db73f7143d2d5dd2cf61de372c5445eb8941761d4c6b45e190922ec851375122838cf88485ca9a2bf92dd36267a89577ff57c406ad4155d2c4087581b20c1dfc59273735882a23ec082a8a5c99be75629402a5274f395bb5e165f622c51188902758e69e277aaaa5a64a00691a5542ffcf6e4d8e8785e0dd", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "16,18 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance6357b82dac365ae37415b437.initWidget("6357b82dac365ae37415b437"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }