var pmaWidgetInstance60924f8a0067a2ef59a2aa06 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d1c34c64b3c8e107d65fd8d7afa08913:13583f0009a8019a876df066d21b19dbe3c8cc4aacbc5eeaa8ea6e0fb852d118e52fee42f475b74e7eeb051523a3be1c0d70805234b193ef41c3d7ddcb72df11e2368c832475afe56358d925e36b1342c27acf87c333d40245829f1e5de7d8601a5d448527326a4f54a9ec54c1dae766b08989115865c873b4b3d23a21bbf89c05710dc15b96f057dcf883507188563149d960b5c08329f6b6b0fb1f7351ef2ca47d1b0313e57785864f33bbf33868b7b6f2fc6feeb74ceef155b3454bbd77ed68ec9389a514f42355d596207adc7732", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "500,92 €", product_shipping: "0,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(){ pmaWidgetInstance60924f8a0067a2ef59a2aa06.initWidget("60924f8a0067a2ef59a2aa06"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }