var pmaWidgetInstance60ab2d8e0067a2ef59db2a83 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=51bcaa0f0d095ec2c99ede1c709215d5:ed481424c2e320a0a5a4faaba46de01efd2fa259ce2f510390f6603af12d77bd67794c0292ddde5fd5a2e0caea6efb0d799b5724a15c22d9bed98a2e3841770fec33e6f9d09e16ffa85b7b0bc8f8a7dcdd0cea5edcbe9aef329190f7b6580d51ba40d09a1e463ae39a82f43db94c12d9d2776dc8e8075fc1a30245a4623dc7e89d947a4219e0a199d2868b12f23e79e1c4fbed9f3c87d879c1dee50e6297606aa59022ad6bdba23573a281d5f4bbe592182924ab484e8d2f62186bafb6d05a0d", shop_name: "Odpudzovače.sk", shop_logo: "https://y1.sk/t/s/130x50/59075.jpg", product_price: "48,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(){ pmaWidgetInstance60ab2d8e0067a2ef59db2a83.initWidget("60ab2d8e0067a2ef59db2a83"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }