var pmaWidgetInstance603e075fd9685ed272a3fcf0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=331f0584278208d3d19236ad1184bbf5:0d5d6bec16b93e184e5fa6467ca9b0841d1a067bef4fa98a5c6eb91747434bf3e9ea8fad4b6323c8e554b7e482bd74aabff1cee9b45f6673bdfcab7f75fc44b33986c7fd506dd7c424ffed2dfbffd6a304aff6406b6cce2552495d6d1eed4fd69c86805d5c8786a3492fe0c5330600b73da716f3f9a47c67535ab7f57da0eeb296bc4f930cd9363dcdfdec6efe49aed57c4efd85110d0cbc9d5570b361631263cef40186caffe84b752cc6948ab2e4dd052c5210ebd166cb98a521145b6dd15a", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "9,42 €", 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(){ pmaWidgetInstance603e075fd9685ed272a3fcf0.initWidget("603e075fd9685ed272a3fcf0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }