var pmaWidgetInstance614730310067a2ef59088f0d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2219f4ce1ed0e4d8050bdf0237ef3c21:5406ec092a492edf31a3d80b517302253e653d869ec82d05f2aad6823b543e267c3f02edb393800a220e19d07d3b6ad630172dc09329be4186add8f92915fbde650cac11ec1ce57bd5f9cf1ea62e2dfaa24722f9b549735429f14fce6813ddc8d85c305d6b4e87b635ceb8da28a61b7abfe4d1085519c93610c1d94980942b11384281fe34ea9910db2b83b6f5ed502b7f82eb8ec19b1569b40be0a47187e5c0e7f56a9ecc5ba7f00819745c22a4ac75b2073f470b477ba0dd42dd395337d9ec72204370d26ac81ea96dec15696c86ac", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "833,00 €", 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(){ pmaWidgetInstance614730310067a2ef59088f0d.initWidget("614730310067a2ef59088f0d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }