var pmaWidgetInstance5fd0c4bdd9685ed272a1553e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ec2901c990505fd99e6cafde4b99f96d:ab50051bf2a363a316b92696df1c57c34147131059dc6a5a147de429eefc49753fe50350f8ee2d1ad7c4523cd5b13b3e4fb4f4593c61c1993486162f5add8946f3cbe877fdcef48fd0d6e55cdbe6a591dd4c9aa51e82e6adadbc686bb194711a8ee40d1626931d01d63523c45ee3cc8c4ba85af35de3f104bcf57c4d6fd1966871e4a8316ab1a4173224813a1eba568b11a5210bdb4aee819a6c98b4118ec15f012ad2d90a25d82edaa11d58d783c61de0cabd84b6735ec604e7ef8ab8ac30d4", shop_name: "www.aldoshop.sk", shop_logo: "https://y1.sk/t/s/130x50/59034.jpg", product_price: "26,00 €", 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(){ pmaWidgetInstance5fd0c4bdd9685ed272a1553e.initWidget("5fd0c4bdd9685ed272a1553e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }