You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nodebb/src/meta.js

54 lines
1.2 KiB
JavaScript

"use strict";
11 years ago
var async = require('async'),
winston = require('winston'),
user = require('./user'),
11 years ago
groups = require('./groups'),
plugins = require('./plugins'),
emitter = require('./emitter');
11 years ago
(function (Meta) {
Meta.restartRequired = false;
11 years ago
require('./meta/configs')(Meta);
require('./meta/themes')(Meta);
require('./meta/title')(Meta);
require('./meta/js')(Meta);
require('./meta/css')(Meta);
require('./meta/sounds')(Meta);
require('./meta/settings')(Meta);
/* Assorted */
Meta.userOrGroupExists = function(slug, callback) {
async.parallel([
async.apply(user.exists, slug),
async.apply(groups.exists, slug)
], function(err, results) {
11 years ago
callback(err, results ? results.some(function(result) { return result; }) : false);
});
};
11 years ago
Meta.reload = function(callback) {
plugins.reload(function() {
async.parallel([
async.apply(Meta.js.minify, false),
async.apply(Meta.css.minify)
], function() {
emitter.emit('nodebb:ready');
callback.apply(null, arguments);
});
11 years ago
});
};
Meta.restart = function() {
if (process.send) {
process.send({
action: 'restart'
});
} else {
winston.error('[meta.restart] Could not restart, are you sure NodeBB was started with `./nodebb start`?');
}
};
}(exports));