mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Upgrade CKEditor and refactor configuration with use of typescript
This commit is contained in:
@@ -39,23 +39,5 @@ ClassicEditor.defaultConfig = {
|
||||
'redo'
|
||||
]
|
||||
},
|
||||
language: 'fr'
|
||||
language: 'fr',
|
||||
};
|
||||
|
||||
|
||||
let Fields = [];
|
||||
Fields.push.apply(Fields, document.querySelectorAll('textarea[ckeditor]'));
|
||||
// enable for custom fields
|
||||
//Fields.push.apply(Fields, document.querySelectorAll('.cf-fields textarea'));
|
||||
|
||||
Fields.forEach(function(field) {
|
||||
ClassicEditor
|
||||
.create( field )
|
||||
.then( editor => {
|
||||
//console.log( 'CkEditor was initialized', editor );
|
||||
})
|
||||
.catch( error => {
|
||||
console.error( error.stack );
|
||||
})
|
||||
;
|
||||
});
|
@@ -0,0 +1,15 @@
|
||||
import ClassicEditor from "./editor_config";
|
||||
|
||||
const ckeditorFields: NodeListOf<HTMLTextAreaElement> = document.querySelectorAll('textarea[ckeditor]');
|
||||
ckeditorFields.forEach((field: HTMLTextAreaElement): void => {
|
||||
ClassicEditor
|
||||
.create( field )
|
||||
.then( editor => {
|
||||
//console.log( 'CkEditor was initialized', editor );
|
||||
})
|
||||
.catch( error => {
|
||||
console.error( error.stack );
|
||||
})
|
||||
;
|
||||
});
|
||||
//Fields.push.apply(Fields, document.querySelectorAll('.cf-fields textarea'));
|
@@ -1,10 +1,10 @@
|
||||
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
|
||||
const { styles } = require( '@ckeditor/ckeditor5-dev-utils' );
|
||||
const {CKEditorTranslationsPlugin} = require("@ckeditor/ckeditor5-dev-translations");
|
||||
|
||||
buildCKEditor = function(encore)
|
||||
{
|
||||
encore
|
||||
.addPlugin( new CKEditorWebpackPlugin( {
|
||||
.addPlugin( new CKEditorTranslationsPlugin( {
|
||||
language: 'fr',
|
||||
addMainLanguageTranslationsToAllAssets: true,
|
||||
verbose: !encore.isProduction(),
|
||||
@@ -65,7 +65,7 @@ module.exports = function(encore, entries)
|
||||
encore.addEntry('mod_collection', __dirname + '/Resources/public/module/collection/index.ts');
|
||||
encore.addEntry('mod_forkawesome', __dirname + '/Resources/public/module/forkawesome/index.js');
|
||||
encore.addEntry('mod_bootstrap', __dirname + '/Resources/public/module/bootstrap/index.js');
|
||||
encore.addEntry('mod_ckeditor5', __dirname + '/Resources/public/module/ckeditor5/index.js');
|
||||
encore.addEntry('mod_ckeditor5', __dirname + '/Resources/public/module/ckeditor5/index');
|
||||
encore.addEntry('mod_disablebuttons', __dirname + '/Resources/public/module/disable-buttons/index.js');
|
||||
encore.addEntry('mod_blur', __dirname + '/Resources/public/module/blur/index.js');
|
||||
encore.addEntry('mod_input_address', __dirname + '/Resources/public/vuejs/Address/mod_input_address_index.js');
|
||||
|
Reference in New Issue
Block a user