var pmaWidgetInstance6022ca5ad9685ed2721126b4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e9b61655e7c50c9f957a08bec58e174a:d5bc3c5a69aa9d0a0f013ad8ef5249ae913cda73a5f507ca7501ed1eca999374be1c3f2d120d02027683177b7fa0780f1ce4843e3c0263fea07c19fbc75159f645d03acbf462f6b829d4176e6d868a68c4e64ff97243fe787e2a6046cd6fc0e7e16b0322f66fd3048303d736bc7efbcb53ab58c140c14bf528a1e874a15b44239eb3d9c2db68754e3b49bf0d06623efef425fcda844171d9f8d00213de5dde88ab55a1f27cf605f177a6b8b11e45b04a81398a387e857db04da17e75af3644ea1d396330685977fd922ee94edaaf6ceb", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "179,95 €", 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(){ pmaWidgetInstance6022ca5ad9685ed2721126b4.initWidget("6022ca5ad9685ed2721126b4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }