var pmaWidgetInstance624ff2fa069a975de50533f4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7a6e36e5ca52bf11ac4e9fce2bdfd42f:8a514298f77a66feacf0631ef5b79413c46cd892853586a258ab05e7b784f3f4d70c6bda95c8eebf2e619169aa21bf27fe9cde5d0722cafbeb8e3e5e0710cb45a1307299aca4e60289fee70c62923436a00f09f707873e2fb3f26383ffd19761fad143958dbbdd108aae8d43b98b402d98a116be7714bf1f4e73548d14cc5f22b04296f929c0030b667262673f62b4414f7b3aaa04ddf582241752b0a7c7283a93587a04569d3518c2f713a98213e5f22d4dbe61854712ca3af128b4cea19500ac6ee4b912fa78167a24fce3565119c2", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "539,60 €", product_shipping: "15,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(){ pmaWidgetInstance624ff2fa069a975de50533f4.initWidget("624ff2fa069a975de50533f4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }