var pmaWidgetInstance60461c05d9685ed27228b02d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=df9a7e60ae801b3d2de381bbc510fda1:73d84958181d40e234501f562b7e6415b2a84b647dfab1188b65efaab827c70fc8c36e4ac201d926e7803ecfeff9ebcc1c2a7416891661e8cb063f9dbb6034fa0bd3e2e9eb99b0b9da10e2683cd944dffc3b99fcf9e76c04fd638c12d499936ee444ebf4557454a7253105da780a38c430be38ddfe0a8d3351b6cd779acae86f3634ff3fd39a31937b1f8cfa5d538fdc58d0e4abbfdc71b5b96461d9bb47079156ac5344bdebf9679b758416c6b76fc0dfd19a6f195a41478151a8394747257d", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "31,50 €", product_shipping: "1,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(){ pmaWidgetInstance60461c05d9685ed27228b02d.initWidget("60461c05d9685ed27228b02d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }