var pmaWidgetInstance63e4eac442183289054bf900 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=79dddf01c8e8f1bf398bd92f832cd97d:925f7806a4bad2d593eec920f763b41cfee1f2a48a6a58c7d98e9030e9eb26f504a96fb771d9e6ea0321941018389972e852f00041e461af47eb2e91ce6abf9bcd9e773c30854608360a1bdd4b9f57b20560f174df3edf5a0da224125a921512eeb54109031cf7facd999e8ae122087dd9cc02f32e87fb6ef498abaa1292ccc2f18b3cb17bae6295ea36d5b6132774f70b2e10c5b5ca61b066f18db3572a746414152960957758c884538525da3574a4c5e8799c38b2719937c80d03e4c2d5b621b95606d0ed7c48c2527d54367d094e", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "190,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(){ pmaWidgetInstance63e4eac442183289054bf900.initWidget("63e4eac442183289054bf900"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }