var pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2b01bc2f3af539ee2a024e5c821f346a:c61d6f5be933ae3474e94b3bc6c6f336af92b7eaaed23cb29a224b8973b104f0d6ea3d0644b9ee0043fb1216985198201963679065f7c743189a57446490800ebd323ada346e4e177aa12338f1478ca486ad943bb946a5f4fcb59d478bff947b9d43d267f8c1f64ccb33da8e1eec9ccaa28a4fae614b12f1ae707b167e6372541eae789bb0d3e8838fecb612f9f17f24aa2940c3bb037fce1c7a3e0f65d80418e18bea0d3903306a20fda4ceb80062e900f90f4fa62b31e1b9e4f5408ef6f74671f408ea2b2984583d96baab02c974c4", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "68,96 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6.initWidget("5fcdf8c1d9685ed2721ee8c6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }