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