var pmaWidgetInstance5fd089e4d9685ed272a9e34f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d060f92c2408253a9cecc219a460685f:65e76ce39ed4a4b941c59e51388c67202d9a8479bc943d6fcb8af9cc7416af1f9bcc8ef7892af05c111a5cb84a2300c8ddfcbde219374a6b7c296aa19df20c6cc536790c6d2ad9520d2b7ca455c37d9c426fa44895ed70855f40554d6d0a8cba8dc11a38b1e2837d9a68df9e70950857713fb3998e89f40683febb8eeffa3bf0db62840c2d0edddccea19d5432056d349b2e28d16d4a0d6aa5b619c374b74c16355e1ebd18471d25efb42ebb7bb63768f6f5e0579f040890a08cc9ada6340493", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "214,39 €", 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(){ pmaWidgetInstance5fd089e4d9685ed272a9e34f.initWidget("5fd089e4d9685ed272a9e34f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }