@rx2
I see that too.
This is what I am doing in the meantime until Bruno checks it out. (not sure about MIGXdb)
In TinymceWrapperMIGX chunk, replace content with:
tinymce.init({
mode : "specific_textareas", //DO NOT TOUCH
editor_selector : "migx-richtext", //DO NOT TOUCH
[[+commonTinyMCECode]]
plugins:"autoresize,preview,paste,contextmenu,image,wordcount,fullscreen,code,link,charmap,searchreplace,textpattern,emoticons,insertdatetime",
paste_word_valid_elements: "a,div,b,strong,i,em,h1,h2,h3,p,blockquote,ol,ul,pre",
valid_elements: "iframe[*],object[*],audio[*],-span[!title|!class<test test2],a[href|target|class|rel|title|data-ajax|data-iframe],strong,b,-p[class<text-align-left?text-align-center?text-align-right],br,-h1[class|data-ajax|data-iframe],-h2[class|data-ajax|data-iframe],-h3[class|data-ajax|data-iframe],-img[!src|!alt|!class=round_img|data-ajax|data-iframe],em,-blockquote,pre[class],-ol,-ul,-li,-code[class]",
valid_children: "-li[ul],-li[ol],-li[div],-strong[*],-em[*],-h1[*],-h2[*],-h3[*],-a[strong|em|h1|h2|h3|p|div],blockquote[p|ol|ul],pre,div",
resize:true,
autoresize_min_height:100,
autoresize_max_height:400,
toolbar: "newdocument | fullscreen preview | undo redo | blockquote | bold | italic | aligncenter | bullist numlist | link unlink | image | styleselect | charmap emoticons insertdatetime | searchreplace",
contextmenu: "removeformat | link | image | code",
setup: function(editor) {
editor.on('mouseleave', function(evt) {
tinyMCE.activeEditor.save();
//console.log("saved");//debug stuff
});
}
});
In TinymceWrapper plugin default properties,
create this property:
migxRichText
set type to
yes/no
set value to
true
set area to
01 Textareas to transform
SAVE PROPERTY SET
In TinymceWrapper plugin
before last curly bracket, paste:
$migxRichText = $modx->getOption('migxRichText', $sp);
$migx = '';
$migxChunk = $modx->getChunk('TinymceWrapperMIGX' . $suffix, array('commonTinyMCECode'=>$commonCode));
if ($migxChunk) {
$migx = $migxChunk;
}
if ($migxRichText == 1){
//do not load these twice when resources are being edited
if ($modxEventName == 'OnManagerPageInit') {
if ($jQuerySrc) {
$modx->regClientStartupHTMLBlock("<script src='" . $jQuerySrc . "'></script>");
}
if ($tinySrc) {
$modx->regClientStartupHTMLBlock("<script src='" . $tinySrc . "'></script>");
}
}
$migxTinyMCE = '
$(document).on("mouseenter", "div[id^=modx-window-mi-grid]", function() {
'.$migx.'
})
';
$modx->regClientStartupHTMLBlock("<script>" . $browserFunctions . $migxTinyMCE . "</script>");
}
SAVE PLUGIN
In
core/components/migx/elements/tv/tinymcewrapper.tpl, replace content with:
<input id="tv{$tv->id}_checkbox" data-tiny="tv{$tv->id}" checked="checked" title="Disable TinyMCE" type="checkbox" class="tinyTVcheck" />
<textarea rows="15" style="width:99%;" id="tv{$tv->id}" name="tv{$tv->id}" class="modx-richtext rtf-tinymcetv tv{$tv->id} migx-richtext" {literal}onchange="MODx.fireResourceFormChange();"{/literal}>{$tv->get('value')|escape}</textarea>
<script>
$(".tinyTVcheck").on("mouseup",function() {
autoSaveTextAreas($(this).attr("data-tiny"));
if (this.checked) {
tinymce.get($(this).attr("data-tiny")).hide();
$(this).trigger("change").attr("title","Enable TinyMCE");
}
else{
tinymce.get($(this).attr("data-tiny")).show();
$(this).trigger("change").attr("title","Disable TinyMCE");
}
});
</script>
I hope this is clear enough.