var pmaWidgetInstance5fcdf3c6d9685ed2721bd318 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0bf28acc9ffffd4e4e7b71926a1c515f:0137cccd07dc282bdd987b74097326da6ef159f79acce67998d0efc2e7832e12d151c5102501abbaf88a5e47a1ab6ee6f4f87c15ec26b0b3decc41b82a20c0fd34a8b29cea17512ff9eb06f5ace0833a33e9a915863f6b324ced81ed2399dd855f17c96592825e75fce4888328ca6ab5c7e336c26719497c7b9b1582fba24754dd5a7d23081ae19ba8e5e8f42ed825ea3d0fb8902669004272fb91fcf7b8dd08ec8989d6839a36af057657735db9687fbd5bbbb291e0389934645beab5ea1115", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "24,76 €", 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(){ pmaWidgetInstance5fcdf3c6d9685ed2721bd318.initWidget("5fcdf3c6d9685ed2721bd318"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }