var pmaWidgetInstance61488b7a0067a2ef59d3b2c5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3dfffdb739f9569b727eb2ff61f75fa4:c77b25c2c9ee3269662cc253a1191abf682927f8bf69ce47c56ce24866e62f31377e57c2d0fd4dbc465b0d8cebc74174e4ac33266800130d6a8ec3ef94e0ea0c2854d8cdfbcfbba06b4d494fd02c3add4d21a3a6de1a0a8cde1eec15b04004e6cdc70a8208917869534948e0ee4de35f54ac389393e4fe147439be4b3702e4f2ad5f30fd466e1685cf9da2c481f6bbe570e079094e17b0bbc8dabc5634732b6db909b70bb0ea74f2ad8565ec0425aed01eea6e6d1f7d40865008c078fde43387", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "275,25 €", 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(){ pmaWidgetInstance61488b7a0067a2ef59d3b2c5.initWidget("61488b7a0067a2ef59d3b2c5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }