-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverHooksUserList.js
More file actions
69 lines (59 loc) · 1.57 KB
/
serverHooksUserList.js
File metadata and controls
69 lines (59 loc) · 1.57 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict';
const eejs = require('ep_etherpad-lite/node/eejs/');
/**
* padInitToolbar hook
*
* Add a button to the toolbar
*
* @param {string} hookName Hook name
* @param {object} args Arguments
* @param {method} cb Callback
*
* @returns {void}
*
* @see {@link http://etherpad.org/doc/v1.5.7/#index_padinittoolbar}
*/
exports.padInitToolbar = (hookName, args, cb) => {
const toolbar = args.toolbar;
const button = toolbar.button({
command: 'epCitizenOSUserListToggle',
localizationId: 'pad.toolbar.showusers.title', // Reusing existing translations
class: 'buttonicon buttonicon-showusers epCitizenOSUserListToggle',
});
toolbar.registerButton('epCitizenOSUserListToggle', button);
return cb();
};
/**
* eejsBlock_afterEditbar hook
*
* Add user list template to the DOM
*
* @param {string} hookName Hook name
* @param {object} args Arguments
* @param {function} cb Callback
*
* @returns {void}
*
* @see {@link http://etherpad.org/doc/v1.5.7/#index_eejsblock_name}
*/
exports.eejsBlock_afterEditbar = (hookName, args, cb) => {
args.content += eejs.require('ep_auth_citizenos/templates/userList.ejs');
return cb();
};
/**
* eejsBlock_styles hook
*
* Add plugin stylesheet to the DOM
*
* @param {string} hookName Hook name
* @param {object} args Arguments
* @param {function} cb Callback
*
* @returns {void}
*
* @see {@link http://etherpad.org/doc/v1.5.7/#index_eejsblock_name}
*/
exports.eejsBlock_styles = (hookName, args, cb) => {
args.content += eejs.require('ep_auth_citizenos/templates/userListStylesheets.ejs');
return cb();
};