forked from NodeBB/nodebb-plugin-poll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrary.js
47 lines (40 loc) · 1.06 KB
/
library.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var NodeBB = require('./lib/nodebb'),
Config = require('./lib/config'),
Sockets = require('./lib/sockets'),
Hooks = require('./lib/hooks'),
Utils = require('./lib/utils'),
Admin = require('./lib/admin'),
PluginSockets = NodeBB.pluginSockets,
AdminSockets = NodeBB.adminSockets,
app;
var Poll = {};
Poll.init = {
load: function(data, callback) {
app = data.app;
function renderAdmin(req, res, next) {
//Config.api(function(data) {
res.render('poll/admin', {});
//});
}
Utils.loadTranslations();
data.router.get('/admin/poll', data.middleware.admin.buildHeader, renderAdmin);
data.router.get('/api/admin/poll', renderAdmin);
PluginSockets.poll = Sockets;
AdminSockets.poll = Config.settingSockets;
Utils.app = data.router;
Utils.scheduler.init();
callback();
},
admin: {
addNavigation: function(custom_header, callback) {
custom_header.plugins.push({
route: Config.plugin.route,
icon: Config.plugin.icon,
name: Config.plugin.name
});
callback(null, custom_header);
}
}
};
Poll.hooks = Hooks;
module.exports = Poll;