var pmaWidgetInstance60c112760067a2ef595eb643 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ddef06ec377e774796e07cdcf8980059:907b746f120989096afae919acf45202201924bb79651a865aebcc47b44c554b40a3c9cf802d6b0872640216b5a06ab4215b6ad25ec8757b45f8d0c6317feb96b6623e6d50beadbdb471a92792b08f25384fcba52d190cf3391b652368f249798a6ac0a3bbc7e63fef6b5d46509d110f2da48d2648bc2cfe40eaf31a788864269d3157a54dc734c5afabb31c6fa6732ed09eafc4165dedcd67b4e1f871479d5eea4caf77f2fdca31595f18a6c82b7442e93de785369f91cca121a82891b071f4", shop_name: "exkalibr.sk", shop_logo: "https://y1.sk/t/s/130x50/49853.jpg", product_price: "124,55 €", 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(){ pmaWidgetInstance60c112760067a2ef595eb643.initWidget("60c112760067a2ef595eb643"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }