var pmaWidgetInstance5fd0cc8cd9685ed272ccc690 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=18c814d6b1f7fb21f313c13d028decba:5a858badc49d736a1c78bcb6f84860ad7f621c494bc3c7672bfd7ad35ca64a753a71135f6179306d77d41560b91a0dc304a639defae9ca3eaa046e6babc2f091d7036dd0219f6060c34631bc78fa5824edecce2b6455185f766ba9ac62983298be3bb3d3a08801ef7cb1ee56eac5b28e4aeda1165fc3946d8a67940a9430ab64dd65d8cd34c91099c404ad64265e7c3a226556bf1c407e4a95024428fe78f6a5177ee6c1302ebdc9ad5b0c93b101e1447dcc56f721bf25023b51e22627a49271", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "130,72 €", 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); } }