var pmaWidgetInstance604b348bd9685ed272f7d5dd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=022c3bbd45fd09dc3cdc429d93f6c997:63bef7f268a5bf42b9ceeb31019352fb515e9e452d6053ccf9af7233cf322d37083965d39b7e646c03712ece7fb1f7f091e163cdded1287946cf341a27247929414f969d404c2f328a52a4e9ea6a95e97f44f6b85b62901a92df365f319589f8e8506be8d793fd2531995b3cdac495570e9b786f1c7234a539ff175833b2d4b5f9dffadb314df2db1ff4d9b7d5029de60a9d106a0f794e90ccd8a2e2041c288ec32e16050cc2a6c7834df4aec5a45e1471506bfb0bc1897fb72240530b8a1ffc81a4b2ec1b877e30f3ed1d6ada10e7cf", shop_name: "compy.sk", shop_logo: "https://y1.sk/t/s/130x50/44165.jpg", product_price: "52,32 €", 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(){ pmaWidgetInstance604b348bd9685ed272f7d5dd.initWidget("604b348bd9685ed272f7d5dd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }