-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) · 950 Bytes
/
index.js
File metadata and controls
27 lines (22 loc) · 950 Bytes
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
'use strict';
const settings = require('ep_etherpad-lite/node/utils/Settings');
const {template} = require('ep_plugin_helpers');
exports.eejsBlock_editbarMenuLeft = template('ep_font_color/templates/editbarButtons.ejs', {
skip: () => JSON.stringify(settings.toolbar).indexOf('fontColor') > -1,
});
exports.eejsBlock_dd_format = template('ep_font_color/templates/fileMenu.ejs');
exports.padInitToolbar = (hook, args, cb) => {
const toolbar = args.toolbar;
const colors = ['black', 'red', 'green', 'blue', 'yellow', 'orange'];
const fontColor = toolbar.selectButton({
command: 'fontColor',
class: 'color-selection',
selectId: 'color-selection',
});
fontColor.addOption('dummy', 'color', {'data-l10n-id': 'ep_font_color.color'});
colors.forEach((color, value) => {
fontColor.addOption(value, color, {'data-l10n-id': `ep_font_color.${color}`});
});
toolbar.registerButton('fontColor', fontColor);
return cb();
};