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