var pmaWidgetInstance63f9de6c4218328905b51868 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b5917b425283e68ee849c3d2d8f72f13:a1c7ba2ee0ecd3e4cdc39b48500db3fe91c2166ec9df78afa30f80b0c35109823d7e194f6b445048c80a89cdd36aeb6195d9488c8f39e68c89d3b6d8f9e73f0a52d47a5762ca855f1d033cc775206839c47b3d6ecd0204ab1e2c513af98cca862ade802f5994fba0577b3321a72b2848a9d15ba77cbd47a0792655ddab3a8e3c0d3341a7e1a9dabd7a3c07e4408d2f7dccf4d31e13485ca5159e97272669ebdf59abc55c5a1dc7e9cb7dedcf6314e957810af6132e2dfdc55746a43011587d0c10acdf6e7808dc6f38773ca192d24593", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "192,90 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance63f9de6c4218328905b51868.initWidget("63f9de6c4218328905b51868"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }