var pmaWidgetInstance603e3ea8d9685ed2725d7fe5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=46f6363afe0b0c267df3bd4bf025b69a:3e2df8dd4298005a543aa03a6fc668637f63a7b708a0eab07abb64cbd8d6e731e5fc98f847393fc3b0cc2da6e3e90efc594b06241be345f753e19d74828fee02938cb47ca8fe3fbbbeb76fd9fab954f740e9f723a69943d43e407faa1d100f7d952da4e39519956ed3b578e8746973fe64e7d284f49993d0f81fd0a83161128722b0bc37ff93420db86c915f5af48f2035b01e8d0e23905355e5d80b6dc24926a89636eaaac0dc49fffd173c9cb65e2824b161f12b544776a2c98ddc6bf1cf51", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "12,29 €", 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(){ pmaWidgetInstance603e3ea8d9685ed2725d7fe5.initWidget("603e3ea8d9685ed2725d7fe5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }