var pmaWidgetInstance60dacaf00067a2ef59b812b0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=637e13eee1c3616f5a6b6e3cd7bd5dcf:4cf66bd8a1fc83142dffb9832b03b6aa95012183e995301d781fc24bbd5b2935130e985b64becc67d17654b13c00c694b8b968c273be9767777ce4393571ca1fbb342c381a974646006bc58d9ad3cebfffc4e50bb7c172d08aa7299c49d5574205917e0d2d5e5efe88dd20a2eedc5e859b8e96a9c9beae3dd902faa6d05c99fae5a3fbb5e9d85c3cd9c42f3028b0349cc174a2f5161bef1644f076f66f7956fe1b3507f041048e9bb77db613f2aeff51e808e5abaaa468037c836b9e7bc1afa4", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "19,49 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance60dacaf00067a2ef59b812b0.initWidget("60dacaf00067a2ef59b812b0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }