var pmaWidgetInstance616fd7c2069a975de5259e93 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7e73d7153ba718cf7dbd60fd8f2533c9:466f8dcdc301a635c5df666b91be90a4d4bbf9ffa9e81f510603948f02b7b6dc02ec22724e66305c048115447ad8681a99b25af1ffe6ace50f52eee83e87dd9d37389aaf06c152384a811e6255ae3c5a37d7277de283e448485f226200a5fdd59607834a108bcf58387adeac524f2a3933f2a27873f48b6d76d9bb9ad165d74c59e2028143d2ebd40df0bd97f867e7ee3493c4ae5ef62dd33e6302040dcff37cf0ebe21925d2e649f247aecc2f92004dc0a75c0e787f41881567438299015243c3f73538d33c21bcc4a1609dedd324f7", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "8,20 €", product_shipping: "2,00 €", product_availability: "Skladom", 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(){ pmaWidgetInstance616fd7c2069a975de5259e93.initWidget("616fd7c2069a975de5259e93"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }