// keeps track of how many events have been displayed let count = 1; $(document).ready(function () { /* Expand alias tab if they have any */ $('#profile_aliases_btn').click(function (e) { const aliases = $('#profile_aliases').text().trim(); if (aliases && aliases.length !== 0) { $('#profile_aliases').slideToggle(150); } }); /* load the initial 40 events */ $.each(clientInfo.Meta, function (index, meta) { if (meta.key.includes("Event")) { loadMeta(meta); if (count % 40 === 0) { count++; return false; } count++ } }); /* load additional events on scroll */ $(window).scroll(function () { if ($(window).scrollTop() === $(document).height() - $(window).height() || $(document).height() === $(window).height()) { while (count % 40 !== 0 && count < clientInfo.Meta.length) { loadMeta(clientInfo.Meta[count - 1]); count++; } count++; } }); /* load meta thats not an event */ $.each(clientInfo.Meta, function (index, meta) { if (!meta.key.includes("Event")) { let metaString = `
`; $("#profile_meta").append(metaString); } }); /* get ip geolocation info into modal */ $('.ip-locate-link').click(function (e) { e.preventDefault(); const ip = $(this).data("ip"); $.getJSON("http://ip-api.com/json/" + ip) .done(function (response) { $('.modal-title').text(ip); $('.modal-body').text(""); $('.modal-body').append("ASN — " + response["as"] + "