var pmaWidgetInstance615959dd0067a2ef59080fc5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4daa69e22990ea99b4f39649b61bdb2c:d1fccac2b0171f547f303fb7411581424a2110ccf5a0dd984edd46eeae64793156e7594668975092cdc78a1178844159d5eaed8492ea7df5d89a554b869c4538f3b6a7a3f646f1f1b616fcae22d18dafc4266bffdae3c0f561f9cd0636901ed201246d77e7a7995bb32bd7c2ec2635887f66e0e174cc7ab09a75ce86809abacfb8de64883a1b1ae592737717083b71825bcd5d2e8bc45e5a8e611ad97aa094345bfbc01aa4558f4301fb6a8de34bce4057b80ef780faa65295c83adaa1e6256d", shop_name: "muziker.sk", shop_logo: "https://y1.sk/t/s/130x50/47997.jpg", product_price: "319,00 €", product_shipping: "0,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(){ pmaWidgetInstance615959dd0067a2ef59080fc5.initWidget("615959dd0067a2ef59080fc5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }