var pmaWidgetInstance603e543ad9685ed2728baf0f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3d77a251f038cfefd126620d0460ca6f:b2ecbdbe4c2760ffdcb76ee892f18ea64431dd3c1c21048eefe6ef3d10dec4137b563bf6ea4b51b2588daf494279a2e1bb4710d10115b07bdc1d6ae4859cc766ab31d056685d76938ea8435f00fb3f0b51524e4d97355294986d9141cebbd2816c90f6960145cdd6ffb2939057cf21f8bc8fcd362d8ab17ddc7df0c4e8fc976214bd022441b80eaf24ba478bc4813cd92e186e265bc24873fb4df858401d33b0d39bc48f51ee431eae8957f93153c5ee04e64bf8cb2dd63d806299c7c54b9b38", shop_name: "Ekaviaren.sk", shop_logo: "https://y1.sk/t/s/130x50/51729.jpg", product_price: "14,99 €", product_shipping: "2,15 €", product_availability: "", 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(){ pmaWidgetInstance603e543ad9685ed2728baf0f.initWidget("603e543ad9685ed2728baf0f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }