-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (25 loc) · 883 Bytes
/
index.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
/* eslint-env node */
'use strict';
module.exports = {
name: require('./package').name,
contentFor: function (type, config) {
let content = '';
if (type === 'head-footer' && config['tinyMCE'] && config['tinyMCE']['load']) {
let src = '';
if (config['tinyMCE']['selfHostedPath'] !== '') {
src = config['tinyMCE']['selfHostedPath']
} else {
src = `https://cdn.tiny.cloud/1/${config['tinyMCE']['apiKey']}/tinymce/${config['tinyMCE']['version']}/tinymce.min.js`;
}
let sriHash = '';
if (config['tinyMCE']['sriHash'] !== '') {
sriHash = `integrity="${config['tinyMCE']['sriHash']}"`;
}
content = `<script type="text/javascript" src="${src}" ${sriHash} crossorigin="anonymous"></script>`;
}
return content;
},
included: function (app) {
app.import('app/styles/addons.css');
}
};