var pmaWidgetInstance60b5dc2d0067a2ef59d650e5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8f1661dff1ccb723b68ab56c681c27ef:a2fb37af5b2c990473e1792204f886dc01e8b5257f88bd739d27d63b7676ec40f8e2d771c087a2f690e81956aa402e3d636809fd822f1f32a286454fe62c156f2be15976e2cf5b1e7d7e5be2a36e5de613c90360f34fef63fc48ab213c80b6f375ea73da99c0cad8615993a95f0a6eb4b66c1aa7ddd8202781147b4d35d43d9dabd1e021d15f5dcd82b57fceb63c165a4f97391486ae07c7c2e58affac5d350018ce51f2a79a1a3bd317f2307f86faff4d4d8c1d751ced3e0fc0bfa4c0f0868e0b9f84ac5ccd91ee779ed59b0333fa41", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "238,00 €", product_shipping: "1,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(){ pmaWidgetInstance60b5dc2d0067a2ef59d650e5.initWidget("60b5dc2d0067a2ef59d650e5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }