var pmaWidgetInstance5ff4017ad9685ed272b4a0ec = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=80c50af4198f5fa908dd7e3df1e7d5a5:95137d50f061ca47957463fe6e34c43416fa242bb148700b09a615bf57734c44c3ebb534e7ec329cfd911131dfa3ad4e83afefcfde7b94c998adeb73c44e0c4523de9d026b6012a0fd0490cb08d872f7426d05cfd371a03cfb622bf42b1dfe860bdc72168867cfde841a2f5533f892f02fd8841bb880c9a01906138a39d310da863250311b2afce9998c0c5d66c9fe7ed529143c5b6cd0525c893be9a5d496209240d620312e3ba11508f05120d7c16fe65479b0ad8ef24a9d44af27eafe296199e8e6d6595d44655fc832539e0baf93", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "91,91 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5ff4017ad9685ed272b4a0ec.initWidget("5ff4017ad9685ed272b4a0ec"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }