var pmaWidgetInstance5fcf701fd9685ed2723b5923 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=25d124104766f539d6ad79aed686b700:2d06a3073176bececba81019f4ac9125114a9c590589eeb05a660a1284fdddd94c43394fc0652febcfef1944b361aa72c31bfd7765e1f818cfd35e1671d2beca9ade6d704c34b472a8f21865a382ef7bf90a341e860b8e4d44d54fe7742ab5689807f3e19920f0d938c6962526a3aa9bd4fda1455a2eb5b41cb9b3d3bca00b30e0e3fbfbc19632fd25e38a1a21bf4cb02c8ff3174190c0e786c4c0796eda57f55aef5c2b8432f5e7bec751375cf3c27cf05edd66bfbe9ede39a941b1963d245e", shop_name: "SADAJ.sk", shop_logo: "https://y1.sk/t/s/130x50/59800.jpg", product_price: "545,64 €", product_shipping: "0,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(){ pmaWidgetInstance5fcf701fd9685ed2723b5923.initWidget("5fcf701fd9685ed2723b5923"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }