var pmaWidgetInstance64d4e7f342183289058f4fc6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=aea1ea9ca2b342cf8800e1f7bdc18f64:da5478e2ff9a15b06f0ebc76a3624a8efea1c95dafe6d9d4936202e5da853495519cbb1eb61addfe21e6c52cf4ee81ca21681096d47fea87dd8b1cb33dc4ede3e22e8ff15cd94bb38ae893fafaefb059d6ceb4434eb7bed5c8d03d3c2e0c7c7fe753c2be37d328f4b86e82683bb4ea8b5702b937c4c58d1cbcd06537b9ccba5b73a79bd69438cc1dd88be8f5f34679335dd609aad7b78f65a6b4a1e881bddf37a42a705e1a2dea27b31b69b888872fdc04a4c804369be503657b1dec2a9eb393b28d62ed2a160fc70c5c902a4764aaee", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "36,26 €", product_shipping: "", 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(){ pmaWidgetInstance64d4e7f342183289058f4fc6.initWidget("64d4e7f342183289058f4fc6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }