var pmaWidgetInstance5fc90a75d9685ed2723a9ce6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=950add797e2bceb47e2fb0a00ea697fb:11e7aec9eb71ff8520cb0ed40830a56b92c672980c18aaa2edd9e9aa2f2a2c3420f055cf7ad9aa725f2e78a834339be4b89edfa7eccd00ad0130986aaf8558129f16435524548963b083374aed04d58dc62b221ff6d3bafa94c589eb8be4ff8213bf543733ec799377eb26e2a4753d9c7c3a7ec3607f56bc41623f701479731ddfe38f2e12f2e31c4bb07d351c9a6c296d9cfdadfe066d9de292b637d3b3efa7bb58e0d57d24570dca84eaf35ca2a73e1564ce82d54ca0f8f2cfa1bdde7b9bda", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "171,58 €", 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(){ pmaWidgetInstance5fc90a75d9685ed2723a9ce6.initWidget("5fc90a75d9685ed2723a9ce6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }