var pmaWidgetInstance5fed61d8d9685ed27284df0a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=55d464b87eec8896db9bf228fd05aa53:63bdd7568f1ac930c481f4b1ad7e335b16d58993b343d896847a4f4a8e86480575934ecee43e94c4f2c1b050f6514163cc66e5bbbd4cb3c2e38a38e90efb2259bf63245e24e5508e3a4d4a6c044a31c2ec18c6bad92c1fbfae3355b4ff2813e2dd059687f65ee423c859d24b2beeb97083af48d9df69cf8f8b4cda09cb14c40f86a485cef7df5aad88397554a5ddf4ddbdfb881ba40bd911d3a771ed37755a9a994756f3c1b8c476d5d7325cc8a4df54230d35f8b147245b1309dbbc7dcb7b2868ef99e411f789ceb988e9a5f8095df3", shop_name: "predomyazahrady.sk", shop_logo: "https://y1.sk/t/s/130x50/47035.jpg", product_price: "472,08 €", 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(){ pmaWidgetInstance5fed61d8d9685ed27284df0a.initWidget("5fed61d8d9685ed27284df0a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }