From 0baa0824e5728305416bae6110202df133d9665a Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 16 Apr 2024 15:52:36 +1200 Subject: [PATCH] feat: allow the ability to configure a path when self-hosting (bundling) tinymce --- config/environment.js | 3 ++- index.js | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/environment.js b/config/environment.js index 65451d1..47cc01c 100644 --- a/config/environment.js +++ b/config/environment.js @@ -6,7 +6,8 @@ module.exports = function(/* environment, appConfig */) { load: true, apiKey: 'no-api-key', version: '6.3.1-12', - sriHash: '' + sriHash: '', + selfHostedPath: '' } }; }; diff --git a/index.js b/index.js index 5c6b909..fe5f80d 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,13 @@ module.exports = { let content = ''; if (type === 'head-footer' && config['tinyMCE'] && config['tinyMCE']['load']) { - let src = `https://cdn.tiny.cloud/1/${config['tinyMCE']['apiKey']}/tinymce/${config['tinyMCE']['version']}/tinymce.min.js`; + + 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'] !== '') {