var pmaWidgetInstance6045ec75d9685ed272b6086b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fcacf752f162c6d124535051dc390517:b5bd57e9056a4f50dd3fb3a2ba6028063ab79cf61683072b92c976f7d336ce56548e88e235808e17d4f0d553189de792e59b14ef9fc4c9801e03db62666dab4d308f1c75505fa5b41b1b4fe85b0678cd14f0db92f0ac8b352dc5760f7fa4aecd54382d4b3d241be9f9eab424e58b5832c28b0489bc918ba30b557e54b044a6e6cf2c1f33a9f8efccf56e91b38d70fe22453719acaaeedaf0432eb7ebff2943cfed11e6254d8d446e1e365493db0eed6900d96387e8d357d2148cc15aa79a84860319e9b6b50ecc24732c4a2422bdc45c", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "474,99 €", 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(){ pmaWidgetInstance6045ec75d9685ed272b6086b.initWidget("6045ec75d9685ed272b6086b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }