var pmaWidgetInstance60239aecd9685ed272f9fa88 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=74f2684478232fd905682fb6fc6a3df4:340769fa4576f21e25f90f43bd7bd1bb9e07de6876cceb79b33dc214708954955d71d47e78a9028e6d1c5adc894e16b4b49858ff1087c8b05f9127e1f9bd8af2e9fe549c3c5be471b60882db69f3a71981e41491d92c0981d975897285008fe074afd93ec0662b205cef88a784c74c578d447e750d98cc0a5cc319410dfc56cc1892e7c3ed551ce4af000e69b945303d7bd6edc4808225bbd6c7031c1e35923370aa8f40b7ce13fad74b55df67bec052954b6e412f53eac174940684182723ea30c0c4eec5e63ee6b0a4c684bb09d708", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "107,90 €", 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(){ pmaWidgetInstance60239aecd9685ed272f9fa88.initWidget("60239aecd9685ed272f9fa88"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }