var pmaWidgetInstance609151550067a2ef59ff1d19 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=28a7389c7d70221b7f218e0cc25d70ed:f5d27b83a740b04c67b9750743cb11c9083eb1b012cbb65245efde1f4a95d964577c09909937d7891ecc1bb4634c1abf1d3e1ef79b72b5e4e25f021dba336ee618e5bc75a1fb5d8497ddac381a5fed906f8a9b0622e9c9be5c133105efc97758902890a8187ff89d7faae97acc4ab7f8e183f8c12ef67dab6a4d9dace6997638abca8b89d7949c91c646e41d66158e78c474cf91fa2218f2db199ea627265f2cdfdbaa0416dc0312fab50277b5712f91431200d5306720464a8466bac74cdc77", shop_name: "exkalibr.sk", shop_logo: "https://y1.sk/t/s/130x50/49853.jpg", product_price: "77,46 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance609151550067a2ef59ff1d19.initWidget("609151550067a2ef59ff1d19"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }