var pmaWidgetInstance6033c4d3d9685ed2720cea92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=29635203a9b58c94fe4273bbcd250d26:2ae98413bb541032dd49fdc8371b5283b03d3c5d7884ba80b1b63b8ee322357be7d11f4ce30b070f3bc602fc315a208ecae347de87fd68b12a400dce6a3c378b1bd07f4f9a4d44d39814de80f4da42971065057ff62098529cac94f368213acac027e96afab30716dd0fbb26143512133df56ba78e17db0bef834cd65517472d0ded947f388c6289f4ec7735c823d82bc06b4d8eabd19aabcbb31fcc6eb6a9f9fc9900228c91c3b5021e9c54b66f5148df0529c379687d3e23d776689a18e7ef", shop_name: "solik.sk", shop_logo: "https://y1.sk/t/s/130x50/59915.jpg", product_price: "177,99 €", 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(){ pmaWidgetInstance6033c4d3d9685ed2720cea92.initWidget("6033c4d3d9685ed2720cea92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }