var pmaWidgetInstance5fc0c642d9685ed2727990a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6ac12c9b599ac19f8ba68d738c32c20f:6b4868ad4f4cb4a91dbe1c036e1f17cbd52e39f06d9b6e414ffbb3c613f31a84b093c2e61df671a6f97786f3ca7e02d2654d6ae140c126fc0fe5d43500088d7a4a79a9e72278e17c81a9b37d11e8fbc25e6fa2e2ed851ab9f0a72caba6a29ea006f9d82a2bf6f09d499b0050203f9d69ddf3ef763787b0d699a9025983ab0175310d753866df0726de9f75ace32984fbfb4a472ecc6442c141a14ded0de1d5264c716c98e6715563141ef0e273c9a1684e1727b0e6477aac459c3bada9f1417e2a26ae5992c9ecacc6fa961916e83655", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fc0c642d9685ed2727990a0.initWidget("5fc0c642d9685ed2727990a0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }