var pmaWidgetInstance62f61889524818ceae15fa11 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f823a06771d9a391c485069de4da7c15:6efd6b32fd4b159078cc12e6a7fb5a50320ee0efd82622c078f8ec9361567ddb87a227e6882dc776031e7f4a15b1447e53ee6470a346b1ba09fedf2dd18d0e8e031fc7bfaf0dddf79c0bc9109aae8f203fec68d1efd314cd3f8be1a35fe981d3810d6791b059c45d451d2597b1c3c26d74beae9050012f53583e0beaf929799fd66cbaa9ea0d582493c4cc123bcfca31752724c4ec443f24951f1ffec033e58d3f3fe9dfdd62859bb11d617a780e91882fbc7d4de026781f854c99fa7d822018", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "9,60 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance62f61889524818ceae15fa11.initWidget("62f61889524818ceae15fa11"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }