forked from LokeshN/ep_foot_note
-
Notifications
You must be signed in to change notification settings - Fork 1
/
footNote.js
35 lines (29 loc) · 977 Bytes
/
footNote.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
'use strict';
const eejs = require('ep_etherpad-lite/node/eejs/');
const settings = require('ep_etherpad-lite/node/utils/Settings');
exports.eejsBlock_styles = (hook, args, cb) => {
args.content += eejs.require('ep_foot_note/templates/styles.html', {}, module);
return cb();
};
exports.eejsBlock_body = (hook, args, cb) => {
args.content += eejs.require('ep_foot_note/templates/popup.html');
return cb();
};
exports.aceAttribClasses = (hook, attr, cb) => {
attr.fnss = 'tag:sup';
attr.fn = 'tag:sup';
attr.sup = 'tag:sup';
cb(attr);
};
exports.padInitToolbar = (hookName, args) => {
const toolbar = args.toolbar;
if (JSON.stringify(settings.toolbar).indexOf('addFootNote') === -1) {
settings.toolbar.left.push(['addFootNote']);
}
const button = toolbar.button({
command: 'addFootNote',
localizationId: 'ep_foot_note.toolbar.add_foot_note.title',
class: 'buttonicon fnbtn',
});
toolbar.registerButton('addFootNote', button);
};