var pmaWidgetInstance5fca0ec0d9685ed2727de293 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c9d2d6f0ad7e4de16026ef4b721ef08c:8576814f5b16421247ec53bb6b1763236ee843e5e0187f59990a02b60274724f703a5991a7bc186bf5c83c92d06fd705367fc637fa3001a621a63cbbd4dcd5299ab15a19d1e36c50ff017dc70046589a9619bdc011885869263408050ba5426dc7b5542317d0e30d3d6983ec9d4e8009198957f2e8096721325b8c7e467503883f5ed25123df56b500d2dd1bb1fdb4686ede1415606e1fab9a54599fa2f0099594c2a6b6b8728d2f3bb224c419d0d79801901394d8818183e24ed9d8e494d9aa", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "28,87 €", product_shipping: "4,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(){ pmaWidgetInstance5fca0ec0d9685ed2727de293.initWidget("5fca0ec0d9685ed2727de293"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }