var pmaWidgetInstance5fc0c642d9685ed2727990a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bdc40efd465d2ff5a261d09fa86774a9:f918b6440ef9aa40a7b7f1cc131dfca0e64424945e4a24a89f704d699d51b9872d22902c9c81482644f444f7620c7afea37a55845fb3f0a741f7ad1b4f47630e9800d5a6eaf6eca8b450119b7e3376ef7e525f1880e3a74a71f4ea1a4cf5862cdb1f6711fd8b7ce2db2549482e009d9aff97e0f3d805e6987b8fb4b397ddb8f66102e3e8cb386e7dce855b3d2666d8c6f5d61833c3d4ab5adf30b6d18d5a84b415eb486c2dbd36c896545f40f3a05380fc38b391680a6485bfc6d89e4d5f2339", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", 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(){ pmaWidgetInstance5fc0c642d9685ed2727990a0.initWidget("5fc0c642d9685ed2727990a0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }