var pmaWidgetInstance602fb4d1d9685ed272fce33c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=dbc9d7dd9db9aecf73530bc9e0cbec74:cdb2550f0cf94b3c388fe21fe25d3468ed324dcfa3af59b649618889ceb1ecf2a08d03a4fd806f4bb2ccbadc74a529e8a3313b279e28e05e846d07338c1a18f905667a3d423bd447a324b768594b24fa83f926af44f43baa14a2cda92d4e9a6cb6390496cfd19926f263cd9889232c4eeaae508cd8845fb940d7bf189fda8b38c7634293ca24deb6f7dc24d790d0df615164b6cf918bb0018823531acc75639b57b2b42220d49ff33410eb248da40eaa8b765d4a82c4fab585adf2767172b9cd", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "78,16 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance602fb4d1d9685ed272fce33c.initWidget("602fb4d1d9685ed272fce33c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }