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