var pmaWidgetInstance5fcdedf1d9685ed27219cd50 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c723a5dd7fb9df3ec8569a05c6c4b87c:81b05612b69b382a4c5ca4dbc0b6f4913e7f8c8287e9597d7484e3bf80079bd4a382993d65a60491af2e3e9e7624e1ee3a666e52c2731c48d3f762fcb089ffc4368e9b37e83ea89cdb650ff22e86398f09025e05d8589cb5387284d5ce08a5564f05d154de549197910e2830429087b937dac824f89cdac0e9773702e4f79cee3034d62f949bdd709024668e8a3f3d2fe015d9acf5741f7d021dc83fa33238fee2fb9e3cc80e61d3b8a0fd4a6068e79ed213eb5642315c6a1acf8b11e5cdfe602f993ad199ddb5a549011142af7fe008", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcdedf1d9685ed27219cd50.initWidget("5fcdedf1d9685ed27219cd50"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }