var pmaWidgetInstance64142f4342183289059ceee6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=47297cd36456c2a06e0e3ade9920e255:c408ed871fd7b3c45c48626ec9050f6c5c8692452d97817ff78ed5b91947971268ff2273e356ce2830ef2219ec57ad7e3108dd656b95c49b4690d371c87e007e6032bf77edd65f41ec449805bc3e829c72be249d213aca61da1b552c790a72b3f573871168e537c6ec43e29c21055ec6c87e49e5fca60a3e44d2e3a0a7dc93365ff6980be0bd3d3a2d7be4160d05ef24affa425c8e39ddecd4a8b2d2cdbc75d67a731126314b8ebd66f770b59f5b1e24eadd37a26cc7f57241727bb41735d23a02124c49c9d5068135876af526b0f537", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "21,99 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance64142f4342183289059ceee6.initWidget("64142f4342183289059ceee6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }