var pmaWidgetInstance608954433975337b9e29b7d0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=81a8b7025683a3843285276e9e48e827:68eb1eafacfefea5986d6c89ec2a4b6fa97c88fa6c8799582634c6f380f443172806fe1bcc7c88a34c870b4e726b7354fc512274f9024f00eb7a8a6f0503cf20e02834780b362523d6f000676bf6ae17f4c410b285ac13710a880c48fd855da7452bcc7f7f6d79c83b4665dbffdd109539c0c1d39a7d40e1f9f841054175644e445b390ea58e1962d4e4592a03b56803e6607d285fde86cac5aca7e9c6b7b0eaf7114a089aea4dcbae4b31696313cd8f56a65c63169ff80212d80b150570c9fee52be2bca82e3679729a0c0ba14875af", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "15,20 €", product_shipping: "2,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(){ pmaWidgetInstance608954433975337b9e29b7d0.initWidget("608954433975337b9e29b7d0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }