var pmaWidgetInstance6054bdeed9685ed2725cc72d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d855a630246b293a33475dca3844db64:3612f18dae521fbaf918718ac606e19a2fe4e926e583bc60f7464766b9b5cf9ce9bf196f5aa0420369b96a4db34bce0e8efdfe348809cf2aa865f7affa6fe4b58bd12e05df3ea38f996a61c970f3a9666dc5fb7f2cbccc62a07e01cc94f98ef6a8a6f31cfe5b71c9cb092e17ff8f31d0ff840deda1b9d6de44a1fca5f4c6504a62beb512cf436d6f08f57138daeb5ca1027e858522202e45cafd029a2a2f86593e674bab4c3ea7a01043ad38611167ca9c945d9bc4c9ade3659e47dd3e2758b8", shop_name: "muziker.sk", shop_logo: "https://y1.sk/t/s/130x50/47997.jpg", product_price: "46,00 €", product_shipping: "1,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(){ pmaWidgetInstance6054bdeed9685ed2725cc72d.initWidget("6054bdeed9685ed2725cc72d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }