allow to use window.tinymceModes
to add or override tinymce modes
This commit is contained in:
parent
70329ceeda
commit
aeb0e6c109
|
@ -1,5 +1,7 @@
|
|||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
* allow to use `window.tinymceModes` to add or override tinymce modes
|
||||
### Fixed
|
||||
* fix default crud sort
|
||||
* fix hidden save button in file manager
|
||||
|
|
|
@ -53,7 +53,7 @@ const fileManagerBrowser = function (callback) {
|
|||
})
|
||||
}
|
||||
|
||||
if (typeof window.tinymce !== 'undefined') {
|
||||
const createTinymceConfig = function () {
|
||||
window.tinymce.murph = window.tinymce.murph || {}
|
||||
window.tinymce.murph.selector = window.tinymce.murph.selector || '*[data-tinymce]'
|
||||
window.tinymce.murph.configurationBase = window.tinymce.murph.configurationBase || {
|
||||
|
@ -80,6 +80,7 @@ if (typeof window.tinymce !== 'undefined') {
|
|||
}
|
||||
|
||||
window.tinymce.murph.modes = window.tinymce.murph.modes || {}
|
||||
window.tinymceModes = window.tinymceModes || {}
|
||||
|
||||
window.tinymce.murph.modes.default = window.tinymce.murph.modes.default || {
|
||||
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',
|
||||
|
@ -95,6 +96,11 @@ if (typeof window.tinymce !== 'undefined') {
|
|||
toolbar: 'undo redo | bold italic underline'
|
||||
}
|
||||
|
||||
window.tinymce.murph.modes = {
|
||||
...window.tinymce.murph.modes,
|
||||
...window.tinymceModes
|
||||
}
|
||||
|
||||
tinymce.addI18n('fr_FR', {
|
||||
Redo: 'R\u00e9tablir',
|
||||
Undo: 'Annuler',
|
||||
|
@ -612,15 +618,12 @@ const doInitEditor = () => {
|
|||
}
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof tinymce === 'undefined') {
|
||||
return
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(doInitEditor)
|
||||
const config = { attributes: false, childList: true, subtree: true }
|
||||
observer.observe(document.querySelector('body'), config)
|
||||
|
||||
$(() => {
|
||||
createTinymceConfig()
|
||||
doInitEditor()
|
||||
|
||||
$('body').on('hidden.bs.modal', '.modal', (e) => {
|
||||
|
|
Loading…
Reference in a new issue