var pmaWidgetInstance6030b04dd9685ed2723833f3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=45db7a4566a636cf80096fc70d11da31:5c3877bea15747383c2d32e69a7cdf780678311e14667cf9ced72291e2488058bf14e9a0233cc184d9e9d3b9498f8c8fd62eb9cdd21ac2f30a0f9325ccd1c1bb28c55f775947b195e93db9c6aad0e016100c1a083e572ff5e3dfef8953f350e0c9ff51fad36189f190b36bb264e6002fa54350622336e4e353d532cf530c3e0c687d0580b4babdd495fe1cde53a0d4f4e29992c05d78c9b167276666be379a5c2831e3c05e28e4ba2f03138ca5385b8b0fa86617aec060b1866120468643c37d", shop_name: "inhodinky.sk", shop_logo: "https://y1.sk/t/s/130x50/4102.jpg", product_price: "89,99 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6030b04dd9685ed2723833f3.initWidget("6030b04dd9685ed2723833f3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }