var pmaWidgetInstance5fd0cc8cd9685ed272ccc690 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7b8c3e45b34d5604c7daf649997261ef:28bd1777cc603acb95044b1149423e86d5fad030ca60fc17c7c1a865de9fe42cae8db261dce2637e4d7ed38d83faddff7a052491120dcfd80e01f49a7d65ff71e4da615228d7f7878f4752b42de6da8538e21302403c60e4e3a47fc309ff483ecff5c76dcfed27ee16fd507dd73d443182dad0b19801d5b8bfd1065eccbf4672b58e32b00c2cb418988b2bb41b578bc6b3fed8df84a2b05e7cd0151ad947d7130c4a9a9758dde6d8f80a34e0dfd6ff578e91a3441f9f86b1b736d9bd1c458ec4", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "124,06 €", product_shipping: "5,00 €", 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(){ pmaWidgetInstance5fd0cc8cd9685ed272ccc690.initWidget("5fd0cc8cd9685ed272ccc690"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }