var pmaWidgetInstance63579a27ac365ae374f8ae4b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c51931baaa0331f221729fcd56770fa1:4fbc13c281f44be028eae138054d8d20a83c1d3ca77a20532431135c89fe3e785fd521f6ae0ffffb9b7578401bb6fca927aee8722489be890a2b84b8c8dc90e7da1106e0abbbcda0c548dde97a3b5fbbb16011569dc088656d94947efe1ba89421084327d6bec18b41de6e97a8fde0e092173531ab9841b819abe266f43e4f9a4a6e0c52bcbd634953d78d2dac8bf54c95522381f5b48507d73fe505731bc13feb692de6d9d010bf729e38669fd2be24da60e5751ee92e2a104048fd6033d4009dcd03751c934bf1771d9c5858b8c010", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "23,71 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance63579a27ac365ae374f8ae4b.initWidget("63579a27ac365ae374f8ae4b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }