var pmaWidgetInstance6048a73ad9685ed27224323d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=26e058282f09a8372fb08b9550980710:8f022a15164cad98c8e30252dd4d25280d9fb68ed374bc4c6564cc5432faca9968e3e5fb9327317c6966038cb0535c27bcf1269babcc8b17fa0eccd54a8d03b389cc183a382c705461cd3c4de4f8054fbb204d25da1dc46df368bbb2fd9bc7f8487895a1f393d517dff153a054c9748d2f30f5d40ca1e0d4cd09001aa81b486c6c6f1eb14f250a04fb456ce2a5592d4b0ce1dcffd3a902c0fd0bed073b20009897efe36e4f6257ff55aaac7fc12800ef1156f06f8ae5d952280b4982e6cacce833fdb8c7f3183636559a6fe9e09d15c0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "350,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(){ pmaWidgetInstance6048a73ad9685ed27224323d.initWidget("6048a73ad9685ed27224323d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }