var pmaWidgetInstance615455fd0067a2ef592b91e4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7c66883377151d98bc3442a5a15397dd:ddb0e2cd58a436f4a782ad92d5481ea00f8b371f61594f17128e0f203725b84c2a9bdd722d7814dd2d24d0cd4001da04ac86b8469804bd4f8fa73ceebd7d8d86409f4f4cef5e027c6ad1d0256f1410882a6ba13a94b24ab8196a26d2cceb52523c2f5d1f0d7a3eccd34b5d79da309c5d3dc179b8b1b51e7db377c6e0dd23b7767494fbc15e38bc458a63d95ecd0fa1b9f8465ee509a4a3bb8e40ae470959fb54ac6190fb1a373b274f1be0ef827f6249e2453f9685644de645cecc27cd2b989e", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "649,00 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance615455fd0067a2ef592b91e4.initWidget("615455fd0067a2ef592b91e4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }