var pmaWidgetInstance6040c670d9685ed272e93de8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4f57a4fd042525aade3623c3f56cbb65:41720599ba33c9476c6bde5c77789e5d75da45a2b48949b04a4db69cdddf2bc6991d0607e6a9cf0595628f06d139726580e8a0f087e7f2648a810230666d5a91c5b14b8fdb3cf16a7033dc5470a6ab78f26dae498878289008e15300aa8eea931213f3932b99f243bed0442e19fb96208ab4d28a7ccb0d48329b8ca36cb2e6322f03bff44a7ee4e39000118da82562114e66d891c78f66f50994e519daa18d5bfb93c6ab0797164dddb352ab86bbe89a2fdcb842e5bc6f6348c8707a72dee61d", shop_name: "zahradnyeshop.sk/", shop_logo: "https://y1.sk/t/s/130x50/59055.jpg", product_price: "45,68 €", product_shipping: "", 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(){ pmaWidgetInstance6040c670d9685ed272e93de8.initWidget("6040c670d9685ed272e93de8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }