var pmaWidgetInstance60c7511f0067a2ef59a9548f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=283a595ec1f9fdbfa3c14693303240ae:3536076b1e6afd407d40a558cc3db171b17982561965aabdbcdfad4b669278350483c3bbdcd4d969497732fe4d2a7f970595e303615d488a72144fa8dd602688890744b04993da40a2df4cbfa80131ab22f25cd5d705bd87f12cb1fed3c460ce4398e3cd4269126d1318b03a9dade73a0b804dc4fb2d83c6a3e137c0c9427df01ce93e8e770c57b098eadd8fe95afac36fc4b07a865d64114d5bd655d94237f2b474ea3d223a2ab439fe921bc78c18d6af4c5814357b136ef4c89b34cddfb92254e38c1de3f7d666a9d1bd28fe5e419a", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "501,22 €", product_shipping: "", 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(){ pmaWidgetInstance60c7511f0067a2ef59a9548f.initWidget("60c7511f0067a2ef59a9548f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }