add light editor
This commit is contained in:
parent
4e184da77c
commit
901a7cab8c
|
@ -3,7 +3,6 @@ const initEditor = function(element) {
|
||||||
selector: element,
|
selector: element,
|
||||||
base_url: '/vendor/tinymce/',
|
base_url: '/vendor/tinymce/',
|
||||||
cache_suffix: '?v=4.1.6',
|
cache_suffix: '?v=4.1.6',
|
||||||
language: 'fr_FR',
|
|
||||||
plugins: 'print preview importcss searchreplace visualblocks visualchars fullscreen template table charmap hr pagebreak nonbreaking toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars link image code autoresize',
|
plugins: 'print preview importcss searchreplace visualblocks visualchars fullscreen template table charmap hr pagebreak nonbreaking toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars link image code autoresize',
|
||||||
menubar: 'file edit view insert format tools table tc help',
|
menubar: 'file edit view insert format tools table tc help',
|
||||||
toolbar: 'undo redo | bold italic underline strikethrough | link image | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist checklist | forecolor backcolor casechange permanentpen formatpainter removeformat | pagebreak | charmap | fullscreen preview',
|
toolbar: 'undo redo | bold italic underline strikethrough | link image | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist checklist | forecolor backcolor casechange permanentpen formatpainter removeformat | pagebreak | charmap | fullscreen preview',
|
||||||
|
@ -16,6 +15,44 @@ const initEditor = function(element) {
|
||||||
tinycomments_mode: 'embedded',
|
tinycomments_mode: 'embedded',
|
||||||
contextmenu: "link image imagetools table configurepermanentpen",
|
contextmenu: "link image imagetools table configurepermanentpen",
|
||||||
convert_urls: false,
|
convert_urls: false,
|
||||||
|
init_instance_callback: function (editor) {
|
||||||
|
editor.on('SetContent', () => {
|
||||||
|
tinymce.triggerSave(false, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.on('Change', () => {
|
||||||
|
tinymce.triggerSave(false, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const initLightEditor = function(element) {
|
||||||
|
tinymce.init({
|
||||||
|
selector: element,
|
||||||
|
base_url: '/vendor/tinymce/',
|
||||||
|
cache_suffix: '?v=4.1.6',
|
||||||
|
plugins: '',
|
||||||
|
menubar: '',
|
||||||
|
toolbar: 'undo redo | bold italic underline',
|
||||||
|
importcss_append: true,
|
||||||
|
image_caption: true,
|
||||||
|
quickbars_selection_toolbar: 'bold italic',
|
||||||
|
noneditable_noneditable_class: "mceNonEditable",
|
||||||
|
toolbar_drawer: 'sliding',
|
||||||
|
spellchecker_dialog: true,
|
||||||
|
tinycomments_mode: 'embedded',
|
||||||
|
contextmenu: "link image imagetools table configurepermanentpen",
|
||||||
|
convert_urls: false,
|
||||||
|
init_instance_callback: function (editor) {
|
||||||
|
editor.on('SetContent', () => {
|
||||||
|
tinymce.triggerSave(false, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.on('Change', () => {
|
||||||
|
tinymce.triggerSave(false, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +63,7 @@ module.exports = function() {
|
||||||
|
|
||||||
const doInitEditor = function() {
|
const doInitEditor = function() {
|
||||||
initEditor('*[data-tinymce]');
|
initEditor('*[data-tinymce]');
|
||||||
|
initLightEditor('*[data-tinymce-light]');
|
||||||
}
|
}
|
||||||
const observer = new MutationObserver(doInitEditor);
|
const observer = new MutationObserver(doInitEditor);
|
||||||
const config = {attributes: false, childList: true, subtree: true};
|
const config = {attributes: false, childList: true, subtree: true};
|
||||||
|
|
Loading…
Reference in a new issue