var pmaWidgetInstance5fc0c642d9685ed2727990a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=efbc42510a777405e0f763b1f3b031b0:785820f2538076622f676c398b1f5189431d7340546af6cc002742b88a17b1896d848a42837bd54a77aa9d170e0badbb32f1609615e917a8ab3fd2079bce38158e7e9a3208d5356b4741a58e58476204a07bc4c9d6e8944e93cea4e4a83896e7008e6fa356de038a987e57c8db79dc9a1b8f5766a4851918a112ee97bf09397ffec3bca19526f5370a012bf5066783b6c8c45673d5d5f4b8e62d89bacad008b454b30349ab853a8466114dd81500e519652133cb1a07fc81801d90caf678b4638246e71d8fa0e56ea130435284c752f2", 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); } }