var pmaWidgetInstance65f03a6aae16db346676a5e1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2b0b5f529eb1f0de254cd1b9c4e8b59b:c7223eef483572136e89ca52d4c8b81c074ac09cedfd19b536b1e433bf6a5105cd67b031373a6636edf8ef613ebad70c4402496fe75de2ca612f77ed5d95c5c67f96efcd9fda938b81f15d5de56240d3790940e5254d2a114845d088bd9908aef7be474ba93c66fe4486861fdbd2deefa85f93c5add00c2dc46ede475538ac1fa3e5435bbc889743777f9eb7353990a807ece25fce64e0c0c758d4a25fc9d3778eeb71b7ca7bbfe8fc151332fefb287cd76ff25f290a67620e665b1c1d21117a8cad995eb5cb541137f621854c8bb4c3", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "419,00 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance65f03a6aae16db346676a5e1.initWidget("65f03a6aae16db346676a5e1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }