var pmaWidgetInstance63e4f3dc42183289055db4e4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9aad3b085a3fd69abf3597b0aa8f0f3f:7250a4e51a15dcc95975d61b58e302895d16a9c7bbf9b71edb113404588d59c63c5fbdd2a27eb3d16aa1d3c9d48cff68327c0bb66d40437c0af8c43fe40a268740d142cbfe1dc16083a94bb29c5b97a0fb4d6a2132be1c4141cc26dd3f522552ffa5af3b0d0f77daf68cf969363621fdc1e5d812b2162213f24a03c95395107cfc2230588349c27449ed2ba7110f786edfdefb134986007a0098f3b7c7c2a8778d548d114f096152f8e9811c250b1d43a1c222d4aaad53a24b39c50ac8c398336d24b083312e7e7213f56e0775aba679", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "228,70 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63e4f3dc42183289055db4e4.initWidget("63e4f3dc42183289055db4e4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }