var pmaWidgetInstance6155bd960067a2ef59ed9135 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=96cbae674b2aa0d06492a2343b8660af:40e9d7eb4cdd01ff5ee9b24bdf614de72f4b081c1dee19fab35ec089cb8fbbbc8d191adb23a12cf87bd319ee530976d9eccd6e2a35fd33450e81a35e91f30a703c2496e998fb5317ff7516b1dc8438a7c65adaf70445829ce220fb9b11d6e2d482d6ad7ca6d802d511939f66cf0141c95cf2207f4b6273203ccc4ebc75d89d45e6a6fe06920a742b46c4dfe328e77de2401c6b1819223ab6c35d796f1be9c8487355420ae3a7e8846f8fb0c0c3cf26caf45fca00ddeb9a3a232716334262d5ff", shop_name: "inhodinky.sk", shop_logo: "https://y1.sk/t/s/130x50/4102.jpg", product_price: "299,99 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance6155bd960067a2ef59ed9135.initWidget("6155bd960067a2ef59ed9135"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }