var pmaWidgetInstance5fcf701fd9685ed2723b5923 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0ca0a690f87ed1c32112fa33249f2558:7448d5bd93d80ec0c19242c6b1979d53a9c77c2b9a12340b9dd339167ade99ecf808435d8b4f7c97dc6285d1fa2910b208e101871a901384463ba34c6c7b5fd392aa86c793f458e03df6349cd68122d105663917c00b0fcdca497ecae8c161c5240fca3ff5c25db61d317b939f3a7d4b74dad0727d66b2867f7bae72813d7370f3ee52d71051e562aa9a2bb65c20236b80e908b7bfd515f6e21d2eeaaa7aa3f97bbc50541b97a4aba663d4d343f0a79499529d1f7b5f08d63ee5809b8bd8a21a", 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); } }