var pmaWidgetInstance60af39cc0067a2ef59af111e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ea1da93b95a2a05c9ae043ff75210af6:42b7355755976acca8b50d069c33ef5b017575004427d6a65aee9fda7e09e37525f86e270dd8114aebf2bd2f1f1cc4a84405a01315167f03e260ccd5f214772a9c2e806d5a551dcf264758a7785700112a4f62977df4f7d90a36e75a2d115b466ea6d3bcc04937824a3936c6b3187dbe27b2dcc2264b0ded3cc83de0e231729efadc0bcba0e08d2e54b4e8a72b9a7c8f591726a7a30ce0bb4dae6f4723ef84761b860fb55564973b046cc2562eeb3e8f9ac0ec69347b10c11f9f61a9615e01cd0f36d4fb6f581965005b56a546b4a4df", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "712,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(){ pmaWidgetInstance60af39cc0067a2ef59af111e.initWidget("60af39cc0067a2ef59af111e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }