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