var pmaWidgetInstance5fce45f4d9685ed272bc3f1a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=93b0601d68ba526131fbbbf6616156b2:34c3533f1f4b8d49d24335f4ab0d3327fc2be8ae47b66fe95f3974ffa656308becec7b75c293a9d6d9ed2b7654f2fbc0fcaddfed54857358be12a40efd631427963d45c48bcb7c7659dd78782d1306add2a1b25fa955e2769d87465fb1eb4848ed6ee8bca5cfb9e9a8276ffa6d2ad02495849be888d6a15ae936671deb21b5a94439591f8f69d7fe1e41d696b03ee4cfce2a178bab4c636aa6b35152ee2f4009ae41d4f577947fabcac4bdc031fc58e7cd66eb1b02d9aa2ea912d13aa90951d0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "67,90 €", product_shipping: "", 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(){ pmaWidgetInstance5fce45f4d9685ed272bc3f1a.initWidget("5fce45f4d9685ed272bc3f1a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }