var pmaWidgetInstance6022cac9d9685ed2721175fc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0cb2062880609cceb1aa11852d4dfc90:c8ff1f9ef5aa0a1584404f0305db8e1a678d6c0e60bbe550eaee3f510795488102183b7a82224059b90907965db8fd84bdc568d3cc3db58f229464a3475e2883779d4af78cff04bce469f3759a3f700c808522a8dc09c3c4ecb49e31b43a509d03d07096190f34d2d705bdbfac9a5588cfaa2048afb2c47c396759b851152587c85b4bd5a2d3cc3ab7e930604ce8cda63e729b161ce77fd787c4e535eac741c7b5a7decc3a75da00227be37042a2c466667e4b7744c367736a403b6bc31055d8def4a364f0336d4cec7a7486931aa6ce", 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); } }