var pmaWidgetInstance613878870067a2ef59a1deb9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=816e2d0ce637a58be34ec41c3c2a90b2:086c27fc03981f6f9f50dfeef2f5b45983d60c95dd1f6920d5ee3de6c9e80b561107f317077a2fb377416e772774a16964a6651ca732fd0cf1cd10a04a31817ce2d5b9afe9c1e65f46a7374caeb27663f4ccd26d097ba2786936786cc051b19e8d7144842d2b21a35148fc0cc769c6c78beb09675fcbe3b1d5cde85d359c476cbe70010cefbd602611b4cd72b3ffe7c1dfa0daac14ce31a77c480426e112d64d185bee79974d791289bb50b21a3e09aebc00bee1ae5b6e126f18b582796bda846a1a618b234463acdd488644fd9e125f", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "450,00 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance613878870067a2ef59a1deb9.initWidget("613878870067a2ef59a1deb9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }