var pmaWidgetInstance60ffbe840067a2ef59c1d712 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c0efc3912eb0066e476c586217a12cb2:67a258ba067b1df01e66e0feb822d097c6378a8a1697ee2423d31fdef666dd680b2db2d2e0bcd1e877a11648c48fb683452f8b017697e865f54f346b7760831726f3eab36c797addd169efa647c085e43f6dfd99c17b5e4b70f0846d817ffd896267132f92bc53d081ec53f29e034abcfcb9dc5485a0832acf4b95c9edba97fec1ac1dbb67cfcb2fd00a6a1541caa42a1b43a3f490ab3c16f528d3b71f4c3519277ec2b16065b004b702d06c29749f7f00f2092d06d7290169131c2644cd7a2a781310643a181b3d6e49b6871c82dea1", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "313,90 €", product_shipping: "", 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(){ pmaWidgetInstance60ffbe840067a2ef59c1d712.initWidget("60ffbe840067a2ef59c1d712"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }