var pmaWidgetInstance650d35d942183289050b2951 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ca0a6853c3f77f3da9179e2f1bedeb6c:6172c741f702caae4a05c6181cdb4e4c440fa7f35e84f1161285c5e45b6e64a73be9e02f1da09673bf2b43d7dccccb6714770fffaa64bb081f8f47ccbaeb6526fe28dd40081ba24cfed9be514513e3e9d6cda0727bd41cb5bd814811d413e88a0879ed31769cc252251aacc506b7fb9ecd029228e7b1f76a1d71af3b5c998ec226a4fb17d46df7414eec56ceaec02c91f896470473ac0075bfaf4f4c38403f990ff77ea0b3797dbc5db29e8e4807d459d7eb21b6bcbfdfa281c338884127379f54a15ccdaf6f833978d75850845efc04", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "22,00 €", product_shipping: "4,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(){ pmaWidgetInstance650d35d942183289050b2951.initWidget("650d35d942183289050b2951"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }