var pmaWidgetInstance63e4eac442183289054bf900 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5cc60da2be8a6ae793c2196fac13fb0f:3f4c9f3a9a377c3cfe357e4c1df29bdefb480a18f5e2320258bcc485317bc6b790549f346b6643e371dc0f3e1566efe3ae9fcff55140a434d95cc05f49a2d8d5df7f8435e93d50086cb665d5cedb6718a8004e469cfa4545d7eebbfb1c8a8cbab603afe0a17dd011e86651d63d7d8a03aad5a82964a239c5966f354911b027690fb1705155f8c379769ec2e6b6bb61ceafefbb36223e59cb9592a8ff173eb7d315e1dc9ead6513ca1b24e62034909afa36a87c125e8f93c99637e4b9750c2f4037bce8620e553f668d9b0065a9aa5c25", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "195,90 €", 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(){ pmaWidgetInstance63e4eac442183289054bf900.initWidget("63e4eac442183289054bf900"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }