var pmaWidgetInstance60c3528f0067a2ef5990da3c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=391fddb9e4b027f211599e7b486767c3:13b9cdc5a31dc01fd6651063170d57fded466fbf0ca7ec72294f254b0a69a9e2ab85feb614cad6d4c8f1f6c3ea47b6765a8bcd6273f9484296c2fec3ddbbf3abb562f474d44ecfb89e00930532f39b979808b37cefbabdb055016ba04b8faea5f127e5254ae1259a7c69919f672abd38ab87b3b3df0e9d86b2a2edb9e783f7769cff02264acf225c48d11e4318ec9f03e3e7ee385802934ec8a7a80a703c2f1cc9cbf6c0b42f90934dd3d49d3857e42b93cdf09309c666b7f7f1a04db57e9510", 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); } }