-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrary.js
44 lines (35 loc) · 1.01 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
"use strict";
var plugin = {};
plugin.init = function(params, callback) {
var router = params.router,
hostMiddleware = params.middleware;
require('./routes')(router, hostMiddleware);
require('./routes/admin')(router, hostMiddleware);
callback();
};
plugin.addMenuItem = function(custom_header, callback) {
custom_header.plugins.push({
route: '/plugins/mobile-api',
icon: 'fa-cogs',
name: 'Mobile API'
});
callback(null, custom_header);
};
// plugin.getFields = function(data, callback) {
// if(data.posts && data.posts.length) {
// for(var i = 0; i < data.posts.length; i++) {
// data.posts[i]['contentRaw'] = data.posts[i]['content'];
// }
// }
// if(data.fields && data.fields.length) {
// data.fields.concat(['contentRaw']);
// }
// callback(null, data);
// };
plugin.parseSignature = function (data, callback) {
if(data && data.userData && data.userData.signature !== undefined) {
data.userData.contentRaw == data.userData.signature;
}
callback(null, data);
};
module.exports = plugin;