var pmaWidgetInstance64c0bf8942183289051f336c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5fc6d1d48e88d9b46503b061d448fc01:c3a2ff04ff6ed378da89d12b5d1f93e9e9340d2846d02b8d859e945ff4d7bddbf77a825d14203cd3ba07779cc5dbd8605951841ade9a314972cc2a16cd4028ead602a14c9f27cdc497c813992f121b24bfdc04f52e9e562e4aeced3b81ced5a4e31a7ca541c8c6aa099657e8778ec805eaa9a1d4f7e3926ada09ca9ddc0e09d9cbde1de385d6cc3c3511ea1ff198a63bddf14d9fba0e7a7f9ea054385989af453b146bfa296ef22688a2d6df49186ce7e5933959d5db3899e9392531404a3047b9b807c16a422f85521e12a34159052c", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "143,53 €", product_shipping: "4,40 €", 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(){ pmaWidgetInstance64c0bf8942183289051f336c.initWidget("64c0bf8942183289051f336c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }