var pmaWidgetInstance5fcf8c3ad9685ed272f131e2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=57f115508e8fde5fb8bed10c3780beff:fb5be1354abbf3973ddf6af157ea8838bd702589c2b10ea0034c20446ec59bc42f2cae62d08c0a0a868d029402f097a667a654e62784295f4829bbd5b0d2833ecab2e3da935b6147b4fbd298024721051064ed1ab2a8b13f5b3a8b5a75a7d33fb50a17291a629c21fa7188b3bfad97388349fe647ba037548ed8ef184b699d3964b8f2aa34dd26366f60a5f11dcb7f30d5ea72ffb66c29106519e258ce5aa469e2aa0134aaeca5399bc13ff1f99bb17a8d30047926f7f545b06f86653015c78f", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "365,91 €", product_shipping: "", 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(){ pmaWidgetInstance5fcf8c3ad9685ed272f131e2.initWidget("5fcf8c3ad9685ed272f131e2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }