var pmaWidgetInstance5fcdf3c6d9685ed2721bd318 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8a06d0be7cd975e694e908589d62bcaf:9bea144f4f3c23e4ba1958ac9f25a82945da2baeb498b0eac3e065aceb377bf6d37e22cd1053f70146a0e4ad7abf1f1aa5bdb6582f9f11e0d4a163c088222ce69acda137679a4cd7d990b71f74d8841ba9462c4c098668c1c59b5603f132a26bde65ea2d8e880700b9cfb8bd72820b6f6f7d1919974bb4bd191c64f144375a90f5e8235d9bcb04645132d53f28a07d3a38a1022a7aba3ad604be64170706e8b0b4b3c4015750ccd6cb472f7842df9512b355ea2d24477d314b9304f03ce983d8", shop_name: "agropol.sk", shop_logo: "https://y1.sk/t/s/130x50/52935.jpg", product_price: "21,50 €", 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(){ pmaWidgetInstance5fcdf3c6d9685ed2721bd318.initWidget("5fcdf3c6d9685ed2721bd318"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }