|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
|
|
|
|
|
|
function initUsers() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isUserAdmin(element) {
|
|
|
|
|
var parent = $(element).parents('.users-box');
|
|
|
|
|
return (parent.attr('data-admin') !== "0");
|
|
|
|
@ -78,7 +77,6 @@ function initUsers() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
|
jQuery('document').ready(function() {
|
|
|
|
|
|
|
|
|
|
var yourid = templates.get('yourid');
|
|
|
|
@ -103,13 +101,43 @@ function initUsers() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
timeoutId = setTimeout(function() {
|
|
|
|
|
var username = $('#search-user').val();
|
|
|
|
|
|
|
|
|
|
jQuery('.icon-spinner').removeClass('none');
|
|
|
|
|
socket.emit('api:admin.user.search', $('#search-user').val());
|
|
|
|
|
socket.emit('api:admin.user.search', username);
|
|
|
|
|
|
|
|
|
|
}, 250);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
initUsers();
|
|
|
|
|
|
|
|
|
|
socket.removeAllListeners('api:admin.user.search');
|
|
|
|
|
|
|
|
|
|
socket.on('api:admin.user.search', function(data) {
|
|
|
|
|
|
|
|
|
|
var html = templates.prepare(templates['admin/users'].blocks['users']).parse({
|
|
|
|
|
users: data
|
|
|
|
|
}),
|
|
|
|
|
userListEl = document.querySelector('.users');
|
|
|
|
|
|
|
|
|
|
userListEl.innerHTML = html;
|
|
|
|
|
jQuery('.icon-spinner').addClass('none');
|
|
|
|
|
|
|
|
|
|
if(data && data.length === 0) {
|
|
|
|
|
$('#user-notfound-notify').html('User not found!')
|
|
|
|
|
.show()
|
|
|
|
|
.addClass('label-important')
|
|
|
|
|
.removeClass('label-success');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$('#user-notfound-notify').html(data.length + ' user'+(data.length>1?'s':'') + ' found!')
|
|
|
|
|
.show()
|
|
|
|
|
.addClass('label-success')
|
|
|
|
|
.removeClass('label-important');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initUsers();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|