var pmaWidgetInstance60e818fd0067a2ef5900a0b1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b7fafeb7db272a14bcd61d9afa5eee65:9268538cf18961cb943be024520baaba681cce796b326c5428a5d84bba9dadde38676aa1ac01a959e6a47206dfcf0b6d41b78868493f906666f75e03b465dfd83b2db1587d8f3598ad4a1bf562ae3033204c3b2b7da2831be911a8950f30a86e929a2d2bb2863764bd19da8200aa06d119c20a11df6eee07932236803943af9fcebe680520c4ed99c89c8f7448e55a6be0d68e408b645fa5062d0053cbaefd621a4e22864e1d7458314f9be3812f656bd7e3783f9f867f588d384e3e720fa6e7a679be74ff643f7e9390b85eb1c1ccff", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "332,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(){ pmaWidgetInstance60e818fd0067a2ef5900a0b1.initWidget("60e818fd0067a2ef5900a0b1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }