var pmaWidgetInstance659bd046ae16db346643c53b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=08412a7c042e4888093ec13463316cdf:f52df53ddd34e23c5a8bc60b1069b88c469b4c1beeb8bd2cd28f4a5f7238b1288c8f2cb38ecfcd372c4d1b3d706e31eed72abece664422cee88466c390da980286b5c56693e05cec19eef03cc2427bccdfeabed7f87aa6a6589069b5edbc097b1cc81de7ae8c9eb85670fe9b2a51a96978d1b9eeade32c7356d69e4b0b1c79e09ea191c9eb62ec763caae11a1e6d302e9ddf9c2a72b8a99b1c37861b42ea5a70be12cb6822453d381542cf383c8d43d496ccf04777449a18df8ae1ea82db420c22f99542ee8a45fe2d574820f5e96f1f", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "498,90 €", product_shipping: "15,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(){ pmaWidgetInstance659bd046ae16db346643c53b.initWidget("659bd046ae16db346643c53b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }