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