var pmaWidgetInstance602f97b8d9685ed2728aa04b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=da2c1882824640325cff315ae3a1f9ab:8137fda54a5e652d067c13aacd55ca6e36f65888a9375c752d159a67c2ba43c90015f3bbf41ab350641ee78d7090230fa388f30082c9dacf525836c3318f514a4c1116569da9dff07823483b99acb391b41aae2e77334037919b92ad3c9bf2412a42509e656a43710d2458f510e6fa0905d6770c960599b69af8b628413db4bbf1d6320b573624a75d43a79542a0b12842bd4f5cbc5c63705a56e1caf4f57cd5efada78bc29ebdf853d1f3f15c7c16e9736bbdc0748968006805f4235588cad81b9807e76ee563385670a99fe4ab39bc", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "488,99 €", 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(){ pmaWidgetInstance602f97b8d9685ed2728aa04b.initWidget("602f97b8d9685ed2728aa04b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }