2019-03-27 20:40:26 -04:00
|
|
|
|
$(document).ready(function () {
|
2018-02-21 20:29:23 -05:00
|
|
|
|
/*
|
|
|
|
|
Expand alias tab if they have any
|
|
|
|
|
*/
|
|
|
|
|
$('#profile_aliases_btn').click(function (e) {
|
2018-02-22 01:06:21 -05:00
|
|
|
|
const aliases = $('#profile_aliases').text().trim();
|
2018-02-21 20:29:23 -05:00
|
|
|
|
if (aliases && aliases.length !== 0) {
|
|
|
|
|
$('#profile_aliases').slideToggle(150);
|
2018-04-02 01:25:06 -04:00
|
|
|
|
$(this).toggleClass('oi-caret-top');
|
2018-02-21 20:29:23 -05:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2019-06-27 21:06:30 -04:00
|
|
|
|
/* set the end time for initial event query */
|
|
|
|
|
startAt = $('#profile_events').children().last().data('time');
|
|
|
|
|
|
2018-06-05 17:31:36 -04:00
|
|
|
|
/*
|
|
|
|
|
* load context of chat
|
|
|
|
|
*/
|
2019-03-29 22:56:56 -04:00
|
|
|
|
$(document).off('click', '.client-message');
|
2018-06-05 17:31:36 -04:00
|
|
|
|
$(document).on('click', '.client-message', function (e) {
|
|
|
|
|
showLoader();
|
|
|
|
|
const location = $(this);
|
|
|
|
|
$.get('/Stats/GetMessageAsync', {
|
|
|
|
|
'serverId': $(this).data('serverid'),
|
|
|
|
|
'when': $(this).data('when')
|
|
|
|
|
})
|
2019-03-26 22:02:11 -04:00
|
|
|
|
.done(function (response) {
|
|
|
|
|
$('.client-message-context').remove();
|
|
|
|
|
location.after(response);
|
|
|
|
|
hideLoader();
|
|
|
|
|
})
|
|
|
|
|
.fail(function (jqxhr, textStatus, error) {
|
|
|
|
|
errorLoader();
|
|
|
|
|
});
|
2018-06-05 17:31:36 -04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* load info on ban/flag
|
|
|
|
|
*/
|
2019-03-29 22:56:56 -04:00
|
|
|
|
$(document).off('click', '.automated-penalty-info-detailed');
|
2018-06-05 17:31:36 -04:00
|
|
|
|
$(document).on('click', '.automated-penalty-info-detailed', function (e) {
|
|
|
|
|
showLoader();
|
|
|
|
|
const location = $(this).parent();
|
|
|
|
|
$.get('/Stats/GetAutomatedPenaltyInfoAsync', {
|
2019-07-19 15:54:39 -04:00
|
|
|
|
'clientId': $(this).data('clientid')
|
2018-06-05 17:31:36 -04:00
|
|
|
|
})
|
|
|
|
|
.done(function (response) {
|
2018-06-07 22:19:12 -04:00
|
|
|
|
$('.penalty-info-context').remove();
|
2018-06-05 17:31:36 -04:00
|
|
|
|
location.after(response);
|
|
|
|
|
hideLoader();
|
|
|
|
|
})
|
|
|
|
|
.fail(function (jqxhr, textStatus, error) {
|
|
|
|
|
errorLoader();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2018-03-09 03:01:12 -05:00
|
|
|
|
/*
|
|
|
|
|
get ip geolocation info into modal
|
|
|
|
|
*/
|
|
|
|
|
$('.ip-locate-link').click(function (e) {
|
2018-03-13 17:30:22 -04:00
|
|
|
|
e.preventDefault();
|
|
|
|
|
const ip = $(this).data("ip");
|
2018-04-04 15:38:34 -04:00
|
|
|
|
$.getJSON('https://extreme-ip-lookup.com/json/' + ip)
|
2018-03-09 03:01:12 -05:00
|
|
|
|
.done(function (response) {
|
2018-03-28 23:01:09 -04:00
|
|
|
|
$('#mainModal .modal-title').text(ip);
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').text('');
|
2018-04-04 15:38:34 -04:00
|
|
|
|
if (response.ipName.length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_HOSTNAME']} — ${response.ipName}<br/>`);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response.isp.length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ISP']} — ${response.isp}<br/>`);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response.org.length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ORG']} — ${response.org}<br/>`);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response['businessName'].length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_BUSINESS']} — ${response.businessName}<br/>`);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response['businessWebsite'].length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_WEBSITE']} — ${response.businessWebsite}<br/>`);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response.city.length > 0 || response.region.length > 0 || response.country.length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_LOCATION']} — `);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response.city.length > 0) {
|
|
|
|
|
$('#mainModal .modal-body').append(response.city);
|
|
|
|
|
}
|
|
|
|
|
if (response.region.length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append((response.city.length > 0 ? ', ' : '') + response.region);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
if (response.country.length > 0) {
|
2019-05-17 10:02:09 -04:00
|
|
|
|
$('#mainModal .modal-body').append((response.country.length > 0 ? ', ' : '') + response.country);
|
2018-04-04 15:38:34 -04:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-28 23:01:09 -04:00
|
|
|
|
$('#mainModal').modal();
|
|
|
|
|
})
|
|
|
|
|
.fail(function (jqxhr, textStatus, error) {
|
|
|
|
|
$('#mainModal .modal-title').text("Error");
|
2018-06-05 17:31:36 -04:00
|
|
|
|
$('#mainModal .modal-body').html('<span class="text-danger">—' + error + '</span>');
|
2018-03-09 03:01:12 -05:00
|
|
|
|
$('#mainModal').modal();
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-02-21 20:29:23 -05:00
|
|
|
|
});
|