mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
for andrew
This commit is contained in:
@@ -1,34 +1,7 @@
|
||||
|
||||
(function() {
|
||||
jQuery('document').ready(function() {
|
||||
|
||||
var yourid = templates.get('yourid');
|
||||
var timeoutId = 0;
|
||||
|
||||
var url = window.location.href,
|
||||
parts = url.split('/'),
|
||||
active = parts[parts.length-1];
|
||||
|
||||
jQuery('.nav-pills li').removeClass('active');
|
||||
jQuery('.nav-pills li a').each(function() {
|
||||
if (this.getAttribute('href').match(active)) {
|
||||
jQuery(this.parentNode).addClass('active');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('#search-user').on('keyup', function () {
|
||||
if(timeoutId !== 0) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = 0;
|
||||
}
|
||||
|
||||
|
||||
timeoutId = setTimeout(function() {
|
||||
jQuery('.icon-spinner').removeClass('none');
|
||||
socket.emit('api:admin.user.search', $('#search-user').val());
|
||||
}, 250);
|
||||
});
|
||||
|
||||
function initUsers() {
|
||||
|
||||
|
||||
function isUserAdmin(element) {
|
||||
@@ -102,6 +75,41 @@
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
jQuery('document').ready(function() {
|
||||
|
||||
var yourid = templates.get('yourid');
|
||||
var timeoutId = 0;
|
||||
|
||||
var url = window.location.href,
|
||||
parts = url.split('/'),
|
||||
active = parts[parts.length-1];
|
||||
|
||||
jQuery('.nav-pills li').removeClass('active');
|
||||
jQuery('.nav-pills li a').each(function() {
|
||||
if (this.getAttribute('href').match(active)) {
|
||||
jQuery(this.parentNode).addClass('active');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('#search-user').on('keyup', function () {
|
||||
if(timeoutId !== 0) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = 0;
|
||||
}
|
||||
|
||||
timeoutId = setTimeout(function() {
|
||||
jQuery('.icon-spinner').removeClass('none');
|
||||
socket.emit('api:admin.user.search', $('#search-user').val());
|
||||
}, 250);
|
||||
});
|
||||
|
||||
initUsers();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
socket.emit('api:get_all_rooms');
|
||||
|
||||
socket.on('api:admin.user.search', function(data) {
|
||||
console.log('move this into user.js but it should execute only once');
|
||||
var html = templates.prepare(templates['admin/users'].blocks['users']).parse({
|
||||
users: data
|
||||
}),
|
||||
@@ -57,12 +58,14 @@
|
||||
.addClass('label-important')
|
||||
.removeClass('label-success');
|
||||
}
|
||||
else
|
||||
else {
|
||||
$('#user-notfound-notify').html(data.length + ' user'+(data.length>1?'s':'') + ' found!')
|
||||
.show()
|
||||
.addClass('label-success')
|
||||
.removeClass('label-important');
|
||||
}
|
||||
|
||||
user.initUsers();
|
||||
});
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user