var pmaWidgetInstance63e4ec3a42183289054ef8c0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2274df3406f798a2d50cbaaf08fd7684:1622e07af3a47e20b5a9330f23f9980bd98132d54cdd32ebd841984de3316e750b5320b832f5f27495d4cae83bf97d0f3454b095ff6932cad57ee0e3cf117d941cc5b2ccc2f70622aae5b5bfb14d33914f9ad1717465b8be1c23a9bba5e0eed20922a9a0e214daa922c0e5be3899692fc436a9b544f6f637fae8a7d6887a8675ee92bee976cc5da4105520ec996dec76c0f29c22ac3e08fe1463aa097dea3165c499a8a9f166f68cc403fc3f9478eee369766cd8f6893fa2c35de78a76115980a81469b4ee004ca0335b0e0066fa17d5", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "169,90 €", product_shipping: "2,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(){ pmaWidgetInstance63e4ec3a42183289054ef8c0.initWidget("63e4ec3a42183289054ef8c0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }