var pmaWidgetInstance60c3528f0067a2ef5990da3c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1c5f048c89eda7c7c7155f36a559ff70:97d314b23faaeacd2a04730aacab967b67a1da16ea6ee0401ac03513b36fa0d4ecef5d06b12129d85772bc7dd7c17e2fbff818d46cea2217f74662ae1f9a284fb61e69487c7bd5ab824bad5c6a93f03728eb61152901aa4cb56802799dcacfeb34459674a2cfff18267bce2e77c03ae965fb907dbe566e84af15e9340983156ce442a62016eb866ca1b667396ed241311d7865543d63f67b7a57a9bf42658feb62dab9a173675d941ca2eaf35bccb7c2e956e835437eb0a16928fc80eadb8b5f", shop_name: "www.aldoshop.sk", shop_logo: "https://y1.sk/t/s/130x50/59034.jpg", product_price: "4,30 €", 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(){ pmaWidgetInstance60c3528f0067a2ef5990da3c.initWidget("60c3528f0067a2ef5990da3c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }