var pmaWidgetInstance5fcdee3bd9685ed27219e591 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6331c5942ecabf0d55ca24541645643c:1d2012143c5e48f8f0d7dcb4f1c12a9e49e233e7662fa27871de2f5ef7b57f1973860e944da4152092575c3c08eacfa844839ec66b0dc32a4699d6fb3fad76fc203fda36d80798c56ad1af1c38d4072aba8d30a52e22ad3fb84be40ec90e429b77a935b2aba3eee9fe5547bccdf79b619adfdbc47c116ef1f715485484af1150d9e58d79b762df9ff477114fcd35ea8b19ffb3ae99c96ab641e85e7b380e48cde901af40f4a2fec975303961518fbd0f8d448fa63538348699fddede21a21df1bf1d5e1ff0c27982cb0c441d663b2918", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "39,12 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcdee3bd9685ed27219e591.initWidget("5fcdee3bd9685ed27219e591"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }