var pmaWidgetInstance6357a894ac365ae3748be133 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=edcca0abe85fe3589f90991300ccf499:041efe377818484632d65ac4a53053fd4ad6c96d4b7af3c6b823323150810451e9f95b17d8c123abeef42bb842cb7e7993a17b1e29b9973772e5161c2dfd60d06ac0ff5a28f1c64c560a343091ef0e6f0178f557bb587f306bd902201196c6aeb791e3dc74b4778b5c4b47dd817d6e0dadf7df06da17369441483e229eebb8ce6631807d1e954518ea9480cf16c27e592ab4ae1dad9b4890c75a51b4685e4101b7041f7d60b9c0509c5f2ecc4b6ad120b31f8b86c202165a3d6af5a5c83496c1d637b72c0a03cdea2098f29b582c384c", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "2,90 €", product_shipping: "", 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(){ pmaWidgetInstance6357a894ac365ae3748be133.initWidget("6357a894ac365ae3748be133"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }