var pmaWidgetInstance614b8f6c0067a2ef59e5d50e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bffd66428467928fe78f16cd2984b6a9:7bb6cc396915fc220612d4d1feeca320c4b687a3762dcfa00e60fa0a2cb7f91367f71e517d01cdc8ceefeaea0fedf5e7899960c9c73d49f002a06bbc96a627ae197170f2ff97b27c839f1883a73e7864ca34c8b47177d16699cffaf93941a1d7ad2b12476e565ae865869382830639a6356d17ec136eb64407f1451f047f477b279dde512b5a71c7b9653d977bf0824f5efcf530e18e489c81610c68c00581c08d32e66f4512de31bb57c7d8fa8af28b38107490ca408ed5149b1518de5e73ede3b78ac891948fb99e2e3a3463e5a33b", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "163,90 €", product_shipping: "", 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(){ pmaWidgetInstance614b8f6c0067a2ef59e5d50e.initWidget("614b8f6c0067a2ef59e5d50e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }