var pmaWidgetInstance642e6d0e4218328905ee43ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8cd3b61081a5ca4009efa4f903fcd1d6:fee54061f7817edeb3570f426521789b4a80a9250eef1fc2cb44843a98aa5509987c8c873847ad8fdd318063965f081db46767d4df5e81e18bb96712f8a0678f6cd2cd6ad3d66a426dbe2e5f33ef79355e97265c47815cbc69d3b162b5142ff7cefe726193d09006eedf826d8b27199945cb64ba73d4293e57269cf6064fd36275d11dbe74eac25d3fdbc502426271bb603f5e2c4216cdb851828e94d2dcf381061f8f79cb459f53f04c1b5fd17602e0c89c91d54e1c7dd091d17e1d9632694de1d99fc609b3d644dec61c4d4d092804", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "201,62 €", 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(){ pmaWidgetInstance642e6d0e4218328905ee43ae.initWidget("642e6d0e4218328905ee43ae"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }