removed modules/admin and moved mousetrap + keybindings out of client #2245

This commit is contained in:
psychobunny
2014-10-08 17:06:35 -04:00
parent 339d2b0143
commit 8abf2835a5
5 changed files with 22 additions and 33 deletions

View File

@@ -4,7 +4,6 @@
var admin = {};
(function() {
admin.enableColorPicker = function(inputEl, callback) {
(inputEl instanceof jQuery ? inputEl : $(inputEl)).each(function() {
var $this = $(this);
@@ -48,6 +47,8 @@ var admin = {};
activate(parentEl);
}
});
setupKeybindings();
});
socket.emit('admin.config.get', function(err, config) {
@@ -63,5 +64,23 @@ var admin = {};
// move this to admin.config
app.config = config;
});
});
function setupKeybindings() {
Mousetrap.bind('ctrl+shift+a r', function() {
console.log('[admin] Reloading NodeBB...');
socket.emit('admin.reload');
});
Mousetrap.bind('ctrl+shift+a R', function() {
console.log('[admin] Restarting NodeBB...');
socket.emit('admin.restart');
});
Mousetrap.bind('/', function(e) {
$('#acp-search input').focus();
return false;
});
}
}());