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