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