var pmaWidgetInstance654cd0994218328905298aff = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e9004599907cc42be124542ca0c460c6:cf57d02f61900f3ea43a817e000a506af469c4aeafeb0c97bfdd9f81636b0353d25a58a92fa3cb9a594d996a35226b1f5adb452e96db03bde09ca2cb4e3be90045a1eac37f1019e290d8b9d484946ff5aa08294f9c3409c79db746396f82e4fd10f47bd1dd17102b0438e1b4fa9cee8a1a248219c648a0134704be0d01b3a54871a7f0bf2a4156357586cb49c24d12f53ec75ba349cb0d9b59d691563def1fc92c67d0242286986df59b8d5a7279db52d0dcac0ec2e528c29fe94b039039d839c66a5a45c6da99532cf12ed52b0fde1c", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "6,11 €", 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(){ pmaWidgetInstance654cd0994218328905298aff.initWidget("654cd0994218328905298aff"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }