var pmaWidgetInstance659bc15cae16db34661c7895 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7489bfb52011e60d31b98fbd0ad59dca:5bf96ec09330e3473217279d4466efacbeebb0d202c4fa835669bceda561e16c3a607d763152907a31071cdb5ab0dc53f169d8f8337e43ea4378ee1a8dd9ea44098905cc89c5d127cd9e41d2321c53291f4fc864443db9760c0a7bcdefbaead695added6d41497d132872bca44817a471ae181fd49ca68909a46652a3325d8f809869be2fffd72969b8e7d63ff99781a57a97ed3f704b84f3d54327c16a9c6aab3729b71277e163ef16b03c74dddddcc7599dff64bfa00e2070c40094f65a0ba004ea584cc4d32f5b67aa8054b049fe1", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "349,00 €", 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(){ pmaWidgetInstance659bc15cae16db34661c7895.initWidget("659bc15cae16db34661c7895"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }