var pmaWidgetInstance64d4e7f342183289058f4fc6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=aba3da5c6f77ff28355d2e55ecd81f99:ffd11b86a483dc757660d6824f9226c57df8f5fcdf5391055a65116a8248eba986e69b02ee06a2ed245600431da6d9f2da1b209704b0c3d7b24dcf7a2260151e25b3d2bce12183619cde5b51647adb20cbefc09c8827e2d5b044fd640216afc556e4bd9b0ca5f70bdf03af13477d5b07d157bd50cbcf53f7a3ce3c8086be3db7dff2b507c04b74799750ba103c338f36b289ac32390cea2ed6fa73c9ea1398c44a7a059e89a3f0efa909aaf2070c0e435a2497af8518c1cb4cee1544b362e6a8bef539a7c74eea74c5c20d919a8f7b72", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "36,26 €", 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(){ pmaWidgetInstance64d4e7f342183289058f4fc6.initWidget("64d4e7f342183289058f4fc6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }