var pmaWidgetInstance64084eaa4218328905635a74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8f436ae8b27dbefde30384f6976262cb:f40f37c1176e9917097961944904de3bafca369c270b012c8ac652e4142aa78dd396feae59d3f01a3671acded6085dfbb2fce80ce20ec80c69a0012a000f7f0f0ba221c7bddaefc2e02274778079bf7e321dbbbea901763643a01bbe7b61c02bfb96f6ab1a2177f142d441203d87d34e0689b49211d912ddda674dc83de215ee77d0a43173c01e5988f06249a2ac0630f1a26db4a414f615c2ca6755b1f16454658c59001ee1c2b0c5553eb91a4900fe660004f27ff90495e366e85c724f34d74e023f45fe76c07b35887b2130eca354", shop_name: "bagport.sk", shop_logo: "https://y1.sk/t/s/130x50/58028.jpg", product_price: "170,95 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64084eaa4218328905635a74.initWidget("64084eaa4218328905635a74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }