mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
removed modules/admin and moved mousetrap + keybindings out of client #2245
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
var admin = {};
|
var admin = {};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
admin.enableColorPicker = function(inputEl, callback) {
|
admin.enableColorPicker = function(inputEl, callback) {
|
||||||
(inputEl instanceof jQuery ? inputEl : $(inputEl)).each(function() {
|
(inputEl instanceof jQuery ? inputEl : $(inputEl)).each(function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
@@ -48,6 +47,8 @@ var admin = {};
|
|||||||
activate(parentEl);
|
activate(parentEl);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setupKeybindings();
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.emit('admin.config.get', function(err, config) {
|
socket.emit('admin.config.get', function(err, config) {
|
||||||
@@ -64,4 +65,22 @@ var admin = {};
|
|||||||
// move this to admin.config
|
// move this to admin.config
|
||||||
app.config = 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;
|
||||||
|
});
|
||||||
|
}
|
||||||
}());
|
}());
|
||||||
@@ -582,11 +582,6 @@ var socket,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Admin keyboard shortcuts
|
|
||||||
require(['admin'], function(Admin) {
|
|
||||||
Admin.init();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
define('admin', ['mousetrap'], function(Mousetrap) {
|
|
||||||
var Admin= {};
|
|
||||||
|
|
||||||
Admin.init = function() {
|
|
||||||
if (app.isAdmin) {
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return Admin;
|
|
||||||
});
|
|
||||||
@@ -38,7 +38,6 @@ module.exports = function(Meta) {
|
|||||||
'public/vendor/xregexp/xregexp.js',
|
'public/vendor/xregexp/xregexp.js',
|
||||||
'public/vendor/xregexp/unicode/unicode-base.js',
|
'public/vendor/xregexp/unicode/unicode-base.js',
|
||||||
'public/vendor/buzz/buzz.min.js',
|
'public/vendor/buzz/buzz.min.js',
|
||||||
'public/vendor/mousetrap/mousetrap.js',
|
|
||||||
'./node_modules/templates.js/lib/templates.js',
|
'./node_modules/templates.js/lib/templates.js',
|
||||||
'public/src/utils.js',
|
'public/src/utils.js',
|
||||||
'public/src/app.js',
|
'public/src/app.js',
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
<script type="text/javascript" src="{relative_path}/vendor/semver/semver.browser.js"></script>
|
<script type="text/javascript" src="{relative_path}/vendor/semver/semver.browser.js"></script>
|
||||||
<script type="text/javascript" src="{relative_path}/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js"></script>
|
<script type="text/javascript" src="{relative_path}/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js"></script>
|
||||||
<script type="text/javascript" src="{relative_path}/vendor/jquery/deserialize/jquery.deserialize.min.js"></script>
|
<script type="text/javascript" src="{relative_path}/vendor/jquery/deserialize/jquery.deserialize.min.js"></script>
|
||||||
|
<script type="text/javascript" src="{relative_path}/vendor/mousetrap/mousetrap.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
require.config({
|
require.config({
|
||||||
|
|||||||
Reference in New Issue
Block a user