var pmaWidgetInstance5fce1bc9d9685ed27263b87a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=260bf0e1867a7f97b3c2b38923c08b13:03d5388151f223c55597edcf5ab4a76a355a0fbd96dfbdd388046da28c0f3995f90d22ad636c9df72bb84ccb979c6df2e93993bb116be7e9b39c12eb840fd4ed84a74a8833c8a34332d8ca2af039966a4d14a5bbf7d1968d856de63b28ec6939ad6a13f96f8f45f086cbd8de283e17854885b88e3401a8cfef3194edfa1b03a8f91c32b1992eafdbe857f394a6aeed5297560f9e57e9c86313c6c478e13005743ada199461aff91935cc9ebe2ce72347f886c04c1f8f974f750df7e150bd846f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "4,89 €", 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(){ pmaWidgetInstance5fce1bc9d9685ed27263b87a.initWidget("5fce1bc9d9685ed27263b87a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }