var pmaWidgetInstance5ff3fca4d9685ed272aed087 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1bb65e5faa2f3ac7259e8d2cbfe47eb0:b6a963fdb9b7b1efae7782317fb1300203cca5b9fd06eba255a998fc23b8198f23d4521a62390a860ac1ac3f8384ec3d2736863241e596d2d8d964d79a821955c99cbfe8fb992138ea41254a7f5b65ecf7a38ad650e74dd2176a1073e868ee6d24c87b02cb210d5dca159e0186932b5e38518ac70429c31cf2b7a50d8a9c9bb9986fc1f6a7998712c064a899c3dee1a59b856c634e64e0aa71228a4c3c0040a41ea6e5fd58f3a01eda179164f1331f9d0d64252b5914c03b06ec48543def960c", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "259,00 €", product_shipping: "2,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(){ pmaWidgetInstance5ff3fca4d9685ed272aed087.initWidget("5ff3fca4d9685ed272aed087"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }