var pmaWidgetInstance5fcf8cd6d9685ed272f6c29d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e39a6defa55a19edef81c2ec00e36d33:10d4b18c01f5bf4e3f55c51e78a6cf7dc469b8a2c281182a4474ce4dbd2595fc2bb15e551d7751d36a9caa3396b3036ece3dd2d4526be460027ca6cdb8869cd968df0ef2e60aa8aa618c4554ed0d49c7f01746e6acd9783e12f4e706e4c137b4962ac0f0fc67ae1a7c5ec997099544a14dd0c0c255424e0af1eadeb4e44c8726df6d7828af536661485d5aeceb393054e85612c85ad2ece769933bed4281401e1899d4454183349a3d080b3248434c1c6d2ac54fd64cd81c924d6b82ec5144bb", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "142,27 €", 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(){ pmaWidgetInstance5fcf8cd6d9685ed272f6c29d.initWidget("5fcf8cd6d9685ed272f6c29d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }