var pmaWidgetInstance60c6f1ea0067a2ef59e5796e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=462a8ea0f56c90ee31c427061d6390f2:36537467642f09321d8f35c23c4782c965c61f5f8be6131b03780aea0fc175beba6ebbc27ce53f185d4820e8f0a62aa779fc7ce863402ed1c88a5a8d14642cfaac5d38801400b84d7dd821783343fbf9734d1c71d9daeeb4d3fa3c28657dda6e4c1ec5e961279ce6a8b9b18c9bbc0eac09f24e81f15ec3cad5e11099decd81f187971340d5bd262150db9514b8de9456578dc9f06087408f36cbca3b5544127e80592a9899b8ab0b55ff5e8cb6e59811734f42e9b74c61603068c6b25efb4ae7289252cac02c431b4dbcd452e421b026", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "23,20 €", product_shipping: "8,99 €", 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(){ pmaWidgetInstance60c6f1ea0067a2ef59e5796e.initWidget("60c6f1ea0067a2ef59e5796e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }