var pmaWidgetInstance63579aa7ac365ae374fac599 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5ccadd7fd9aa3645f4f752f22c8811cb:c5c612dc3f990bded461da19bd7d517cc9976730f2b28239a889bbc52fae56d97b3ec699c2bde6911644aa9d8e0160ed75e2d0401edc82c159ead224d11576213bbe3596d48abba420ba9f68b9192502e37d3671e785352900fb160847cca71e6913e1e259ac0d6dabcd9a16a835316b717bbe7cefbf831a6e61c9cb5f0ab4ec7d09ad4cffd5ea0ccdcb9ba0efd687f9fe8090b4eb492315d70d5729c377087fcb5b3875981c6c87fc0905d999c092b52fa3c5be6224614bf2547dc284353500e9605802b16ed8bf93e7f9e40269f528", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "13,81 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance63579aa7ac365ae374fac599.initWidget("63579aa7ac365ae374fac599"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }