var pmaWidgetInstance616fdb3a069a975de54ad9e2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=09672edcab209d2721951471906244dd:146c46d1b484d888983986c990c2d18f89f0a5c7566a0c76003ac6718b9976f5dea129caf3bb78280f2bad4bc72a3a99f9e365b7d346c3e78f06ce6a7f620226ce561d2b7edcfb875e3e2dc95e636bb25c9771f0bf5c3cfbfb009c6782a676fa4eb1d775e98ea0da348931fcfd9533942d0a1c5777ad4e7d62e999879fa462253b7d51df928b2b85fcd4c18767ff3d3578fac59834d827ce39a13fd10b37509a66bbdb1d04208a4a652207d9e38d0c7d3562664982b983c05ce13a81cd8abf2e9c86adf3b2846d9518539622119327b2", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "3,60 €", product_shipping: "2,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(){ pmaWidgetInstance616fdb3a069a975de54ad9e2.initWidget("616fdb3a069a975de54ad9e2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }