var pmaWidgetInstance60545145d9685ed272b12186 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e7c998b99838abdc48dda69f212960e3:4dfc5b81c66e26fd03f8a926f892112085782e616ace2cd694a00e5b2b3070238a9b4381dc37ceac3ede4f41e6e9e39e850ab33be0441da62b62401cddf4fafee7146b9f4846aef1cb439d516a46728e3352694ff571ebd8944cf85d01473d8ca2a3fa5744f4fc06ab7282acd72979ffc52fe9451c94d86fb50e57b0a4a73629aa3d4043e9540fd23c758f5dfacd597418686faca513f74b088e512988a831203dfe33e7c6bfb026734ffc94fcd23fe21f087c2c12a40ab779a24b6a2a247eb2ede1d76df1da8ec88d1f456818ce331b", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "265,00 €", product_shipping: "1,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(){ pmaWidgetInstance60545145d9685ed272b12186.initWidget("60545145d9685ed272b12186"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }