hi,
great job, thanks
i've made a little change in the tv replacement code as it was throwing a js error when editing a ressource (i have to say that it's page with quite many tv as i'm using yams as usual but i think the problem may be the same for any kind of page with many tvs)
i've replaced
var myTextArea = document.getElementsByName('$textarea_name')[0];
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, config);
if (document.getElementById('tv_body') !== null) {
var tv_textareas = document.getElementById('tv_body').getElementsByTagName('textarea');
if (tv_textareas) {
for (var i = 0; i < tv_textareas.length; i++) {
var ta = tv_textareas[i];
CodeMirror.fromTextArea(document.getElementById(ta.id), config);
}
}
}
(line 163 in codemirror.plugin.php)
by
//when editing a snippet a chunk or else
if (document.getElementById('tv_body') === null) {
var myTextArea = document.getElementsByName('$textarea_name')[0];
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, config);
}
//pages with one or more TVs
else {
var tv_textareas = $$('#tv_body textarea');
if (tv_textareas.length != 0) {
tv_textareas.each(function(el,t){
CodeMirror.fromTextArea(el, config);
});
}
}
as you can see i've used the mootols syntax for the loop, a little shorter and some more effective
)
now, next thing for me to do, allow code mirror to replace tv textareas even if the page wysiwyg editor is set to yes, would be great to be able to mix tinymce and codemirror depending on what kind of content you want to manage
have swing