var pmaWidgetInstance60c07b950067a2ef59ba8cbf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bc9fdd2c9402f9dd224dec22fb3c1886:d8dfebb86de2011f7a09b9e73b0a17026a8d2de6c88ad4fcb8a8e791dc28102ec693b06b3b924d7dd8aaaa631aede0a9fec70fa6324270e8be3466965efcf89c3a6964c8bda129c5dd1a4e90fd5a9b77b754763061b9a896c21283c9132f307073048a88b8cd7ff742b9b59663e06531172eb356f54e4368b1cf8f7e2c5752057a41cdd57c51b3ce9a563168a464900d7a504cd5d9490a7480451904fc2ae8c3705f7d2931020142cea1129eaa6b31b5b59fa0e1565f195dfcf7c1913d8699fa", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "211,30 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance60c07b950067a2ef59ba8cbf.initWidget("60c07b950067a2ef59ba8cbf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }