var pmaWidgetInstance5fcf8cd6d9685ed272f6c29d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d8580dd1aa3d2dd06c3d654a13d38d9e:18a63a6e63fe39357d731f9a6fcd4baa0b0c127adcd28dffcba9e269a5dfa66b587375390c961444ac62c6cd0c5fd42f4cb883b15005928c502cfd74b2bcb8a2be280bece65238e8f22f5196f699801f92cb9cdb837d1f11666a096829f32d4408c48fe32f851c6b58f32cd1fecb8c588a9a2a5aa6d5e7e973aa7eba9072bc54fa99c607254627cfdb505212a34a14b6fd2a080f30b16049e4a9edd42a03997423f3ac176927a308bfd8f15f1484aaa93751bbf77c756f33c1174433df96801f", 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); } }