var pmaWidgetInstance5fc0d5e8d9685ed27295d449 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=dbe9957a1cc1efcad7e8382891aa5f5a:0e55c6e67da6139b6c6740a75a4136922c53a6a9eaa6c99c540aac02249c156c70fefefbcd5f0effd5f1c9e68c9a3b22a4a79006a7cd22817f2634b40703b5676351e1929d8e33a5f3fe087e323e9e5845e8fa3adb2d2a2adbc17893c858b4b7e628f1d1f31e74b7c0aa1e05b466c38a8848f8e8cf0ca4357746ddcba21130de4f930a58beb8eb086e3b7767264a682cf48afcaab7eb0f55a00aff703f179ed81b728221716278a18abbd89c2b467b05c3be0f6536b7f2cd663a2f9f2587a231", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "49,99 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance5fc0d5e8d9685ed27295d449.initWidget("5fc0d5e8d9685ed27295d449"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }