var pmaWidgetInstance60c1ad5e0067a2ef595d6f30 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a3974f0f612cf1fe3ade839e3192efcc:d5ac186dc0533a94237e207c68277698a6846b8c5a829099d590a77211da8cc4d691de0c7a864542aa6195821e4e87c91936a7e6f352c9d12f7488062a0c13dd6e3fa477b9ce8f8dd26e19024f4064fa98825e0fc1f777ebc0ace815142c9b5af3464d1ccf3d1e3dd599f6b485ea41fe9071e8e4b4722acf297da64af601463052d9c111004b25b8ac952480bc2462e2da597148ad619be7eba30f2721f0582d78944c31b932999a1ed421dfe4597cadb7f2590ed24de34a9f3cf53c405639a5", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "134,46 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance60c1ad5e0067a2ef595d6f30.initWidget("60c1ad5e0067a2ef595d6f30"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }