var pmaWidgetInstance60535eccd9685ed27249e623 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e92c8fa21fa6e98695534966988a0035:ceaf1b03f29dcfd2e1447af305f2792aea067dbc28f84e2358762423970c3068db2e393e8ef2014841a0867e9d5e893fc72f7e4da916e9b6a1d54c9166df8a1ef78f182e6798a8ebad151368f3920f238eada5aea59fab3d014c327f39c5cd975e6df9ac5b710ec0714f5863083f110a5dc783ce7774e64c4375aef7be02d4e66eb969300ab570bf734a416bf4ba9a8f0df1f7dd86cc80d5fce2b1dd1912ea06b26873cd185ec5679f949c6aa63c84353da8ce4949ad7ea48089cb03c8a51926a07a5c63f7efb782a09a791752f3d450", shop_name: "pelotony.sk", shop_logo: "https://y1.sk/t/s/130x50/59907.jpg", product_price: "297,70 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60535eccd9685ed27249e623.initWidget("60535eccd9685ed27249e623"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }