-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.js
29 lines (25 loc) · 824 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
/* eslint-env node */
'use strict';
module.exports = {
name: 'ember-cli-tinymce',
contentFor: function (type, config) {
const apiKey = config['tinyMCE']['apiKey'];
if (!apiKey) {
throw Error('No `apiKey` in tinyMCE env config');
}
if (
type === 'head-footer' &&
config['tinyMCE'] &&
config['tinyMCE']['load']
) {
const version = config['tinyMCE']['version'];
const referrerpolicy = config['tinyMCE']['refererPolicy'] || 'origin';
const src = config['tinyMCE']['scriptSrc'] || `https://cdn.tiny.cloud/1/${apiKey}/tinymce/${version}/tinymce.min.js`;
return `<script type='text/javascript' src='${src}' crossorigin='${referrerpolicy}'></script>`;
}
return '';
},
included: function (app) {
app.import('app/styles/addons.css');
},
};