var pmaWidgetInstance5fca7ec9d9685ed2720a99db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=aa3f8ba55d8fd4b6ff0cd341965a2f36:abbdba27b07cf793ad10bc7431852018bacf91f2f54c556e149de2aa911258433362f897ed9dd31f8c4a87c8646d9b5b5baab25561341361b9ac40938435c11f5b86af9804a5b256a8300c2cba20b2c62c2a4d355a7e11a88102e2246c737398467ae7eda492bf621d9a52891692223263e836c61928e46c235428ed03d0ba4e709aedc15665c27532449e3932b8c327b61a6f95a843de6d933e827ea207187ac29b33df39740c404462d983316be26cba8107a978cde09ee39ccf24192ce796ac37ed81451715eef205f8d6ec8444d8", shop_name: "Supermobily.sk", shop_logo: "https://y1.sk/t/s/130x50/10067.jpg", product_price: "125,00 €", product_shipping: "3,50 €", 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(){ pmaWidgetInstance5fca7ec9d9685ed2720a99db.initWidget("5fca7ec9d9685ed2720a99db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }