var pmaWidgetInstance60828cd0d9685ed2721869a3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ddcbd05f259d43561529eaed3af91116:52533ca715af38469c27d0b74f0b2a91cc3c81e5120283d7ceb06908671741ff5f67823956b2c9e4341ffc868b0fa197b799ed7233d5b47b8b7156a6ba769e3a488786e2b2aae3ea9c8247769e97b3c1bbe03ca8cf6d6e20da0a6d6fefb432c1deaca5aa545356a4ce847851f7ac55670576a3a5b3533314402e4249b886b9a72b6291447013b691cd00222a5b69ee31f9210af190c97cb8ccb5d2381dbd3f48389d71f645cfaf418183e5d69d806289fdbec55aa8b26c60ea424b8bb146a6281f5849d80bcf7d39b6c2156b127a6540", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60828cd0d9685ed2721869a3.initWidget("60828cd0d9685ed2721869a3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }