var pmaWidgetInstance616039f10067a2ef59d92eb4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f2bf51153fa99fdc44015fda3864f834:6abaef04a2be93f16e3582fd69751f50cf6a5f03385909b2d520575987f697284b10834148ce56d19a945c869e7fb14348ec5d582ab776c2c0e16fec60f9675bb2a378495dafd1f1bbdee60e1889ce2665ac1301dc148cc4aeebaeab4f26ca61fd30056d00872a63872cbd895bd37fa5b332e473163db3c32e63ea918a203fadf72fa1bf3473e54db9d5048abfdd41e0c073878eb2e2d204812dd9b6a9f1c24e8cf95699714bbab675d6cf9ccf60a949072af87bd6bbfb0b78ba66b3b190b70a", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "30,95 €", product_shipping: "5,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(){ pmaWidgetInstance616039f10067a2ef59d92eb4.initWidget("616039f10067a2ef59d92eb4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }