var pmaWidgetInstance63e4ec3a42183289054ef8c0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=990f539594ecba7bbce1f119c5e95094:ac75c50883d7399d1f0e3b97e3e6d69dc7fbc0eac39a1918f340f288dc03badf1aa4b984c15b0ce1aed1cd3c3433c65689b74410c8d0a06aedbb27ea6ff4673e4066efb35c2138125bce6a3042c8cc76330d795680279e7281619f8367415fd5040e2f0f8301b731a7cc157d32c250e15047f15be2e24db3997e6961e5ebb442319fa90955eeef5688ea97a1db12b96b2045e39ccee3ce902cc3e81c5deda78d3d3cd4f82427ff7317fca47ff518d1efe3b4538e8f4ddbb42815c33b04d2d450046ad9c7a0b94b16228f07927584e801", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "163,90 €", 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(){ pmaWidgetInstance63e4ec3a42183289054ef8c0.initWidget("63e4ec3a42183289054ef8c0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }