var pmaWidgetInstance6038efa8d9685ed27265bc79 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8f4d12a916c8b07fdf1346d4703688d2:4ddd455b0a354a638d0bd03a84a8ec119df57b1330bf13e6e8e03801203e0858ecc7e212b46980e0bd44f042226cc1df0567a05efa49530dc25a0cb0f5a05ba029a443626f2903c379c9ec64a7495d3dd73f9b3570b3edd645cdc2a21bc57e2ea6887831b5f03c3761acca9faf4da595796e7e34c33f88be5c2d5aa0fae8817c9bf2b931c8a6c3badb2d22a7b432c2c7788118f5a5e12bc7f9dd4c2b14489533657f75fad4bef7c2a733948baf28f2048c2c3cb158260cc2b0447762a1f74d776973cad68c767593e308139a2307d0c0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "85,90 €", 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(){ pmaWidgetInstance6038efa8d9685ed27265bc79.initWidget("6038efa8d9685ed27265bc79"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }