var pmaWidgetInstance5ff478a9d9685ed272675d38 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c30a251e06f6481e7e6d1058ea3237ce:28d527da575e5340207b0fb9c8fdf2fd4d11edd231be13c0c552afb3a25cbe724ec3124a15fca54004447df0963a6a43bdc157536ac09f9c9a5c2aafbb19530943ecb1c32c9e77834d483adc88e00b021ca413888cb2dd2db0c237703ccec8c59f95eba1ea5a4d85acaa603fd9a7fd86017f05898b7af6b3d6fa1838f5b7db4894814f2ca984ec11fe0666292f2dbbec98057e4684a87c501462359110ae2d8adf79e7f28c18ccdf15268f3ef49b66c7fe7056180e41f0c69a833df70fe5bde5", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "28,87 €", product_shipping: "4,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(){ pmaWidgetInstance5ff478a9d9685ed272675d38.initWidget("5ff478a9d9685ed272675d38"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }