var pmaWidgetInstance6155c9270067a2ef591532b1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c88508ad00b42d46a0fe29df628caef2:3c09d68d9e6004c9320cb970716359a96c48c9bde96922e3fa13914e487410aaaf54de0a155e70119c18b4b1635a396021f8b0ea5effda416f9a64404714339c531c1dd48d18de5a963b280b5121ff9cb7dcfc1f7ad5d3a61b9a6d989168ede25499d7ec847f8c2bf1c08446d6d57b0fb04a1328f02560a38d8a2075ffe39f0b7155093f6b2d49018da4e77f46475cb0a0149d463b599c04af0173c15f265557dad2aa76e6320bfade30b2f2771026a4f219c0c42fa1cb0d3c044818fe03fadfb9d44a8aa1e200614042476ea1991143", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "498,00 €", 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(){ pmaWidgetInstance6155c9270067a2ef591532b1.initWidget("6155c9270067a2ef591532b1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }