var pmaWidgetInstance60631b9fd9685ed2722e93df = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=25a674f92adeca1a452d94f0c246c4ef:ff27312e73900067f9aa081817ae6fd7d87e7552606ed888cfc0e651f39d54844ce2d3c4b026f16e9ea8a9d821eeedc49634c4b018495392f9aa0cb1ba74775512a7270cc887215243e215f34c4ed7a8132e8ea69023cb4a1ff82b8ae8fe8c2405b3a6819a7e1a2a1fa65666a379da6c228bdf8fd5ce36bf4fbaaa80a8ca8811fa03157f91ab134a409cfb9aa1c0ff440349a5119ec3ede2a76bc58e69027a87029494188574f970c73d186e077e0c835fc4e4839c26c65c2b96ebef7d7e88cf0460641f325bb22622ad9c9a3885235a", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "415,69 €", 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(){ pmaWidgetInstance60631b9fd9685ed2722e93df.initWidget("60631b9fd9685ed2722e93df"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }