var pmaWidgetInstance60461c2cd9685ed2722a35b5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=381ff16b5cf03a240b589f5c5a99a2d9:1b6685ff244ceca10e1182394a16278cd43353706dc9ccb2ee18e5ed133cfd3ddc6a5ac223f5fa9c7be71dd781044422e63b2ef14a3ec93c00730eaed2678b3f8b8955dc18f13153d7969341a1c4658fd5da082c9b5024338a574025877a3e4ce61cb6ad8f4d65b3c612392454e0edaa7a00daf66dc49ba6b4d2587ac816753f7d28d69332ee8e82676c7e9d13a268e3837ce6d5c05ac0dbdc7632809765ee79fb273bfea406c8cd628be5c3356ee3a8654dff4efabb02c97796c1d1de286a27", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "6,20 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance60461c2cd9685ed2722a35b5.initWidget("60461c2cd9685ed2722a35b5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }