var pmaWidgetInstance61c311b0069a975de59ff344 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5474c20bc9a0b32357ee8e27151e1e0b:5efaa650845e8fe9854249cb5d10350064df5a3dcb15e32de52311ca25ecbbdf437f854dd3566568856cd7885d3a368cb88f861c3b7ce3a04dd46ab4f386f8a164e115f2a86d996645c2472de400d0c00ee48d9e06bf3734810a518aece7a13f1db74b5aa850c4a9a62058c9726217b4c7660d91f1d3b342a7e7be970a2b29b9b4e58ab1704b4a9aec0c09a748cfb271ee7b08385bd570cf326c16d600953c2730124341d00fc7738cb7cb4b2d6db34a7279a3fa0f193ff85e66f96c285fa7c1", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "10,40 €", product_shipping: "", 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(){ pmaWidgetInstance61c311b0069a975de59ff344.initWidget("61c311b0069a975de59ff344"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }