Index: branches/5.2.x/core/admin_templates/js/forms.js =================================================================== diff -u -N -r14685 -r15042 --- branches/5.2.x/core/admin_templates/js/forms.js (.../forms.js) (revision 14685) +++ branches/5.2.x/core/admin_templates/js/forms.js (.../forms.js) (revision 15042) @@ -59,18 +59,17 @@ } function InitEditors() { - // process all FCKEditor instances - var iframes = document.getElementsByTagName('IFRAME'); + if ( !$.isEmptyObject($CKEditors) ) { + // process all CKEditor instances + CKEDITOR.on( + 'instanceReady', + function( ev ) { + FCKeditor_OnComplete( CKEDITOR.instances[ ev.editor.name ] ); + } + ) - for (var i = 0; i < iframes.length; i++) { - if (iframes[i].id.match(/___Frame$/) && iframes[i].getAttribute('latesrc')) { - var $iframe = iframes[i]; - - setTimeout( - function () { - LoadFCKEditor($iframe); - }, 0 - ); + for (var $editor_id in $CKEditors) { + CKEDITOR.replace($editor_id, $CKEditors[$editor_id]); } } @@ -80,10 +79,6 @@ } } -function LoadFCKEditor($iframe) { - $iframe.contentWindow.location = $iframe.getAttribute('latesrc'); -} - function Form() {} Form = new Form(); @@ -143,7 +138,7 @@ addEvent(window, 'resize', function() {Form.Resize()}) - this.Resize(); + this.Resize(false); if (isset(first_error)) { for (var i in first_error) { @@ -213,11 +208,19 @@ return parseInt($size); } -Form.Resize = function() { +Form.Resize = function($init_done) { if (!this.Div) { return ; } + if ( ($init_done === true || $init_done === undefined) && !$.isEmptyObject($CKEditors) ) { + // process all CKEditor instances + for (var $editor_id in $CKEditors) { + var $ckeditor_textarea = $( '#' + jq($editor_id) ); + CKEDITOR.instances[ $editor_id ].resize( $ckeditor_textarea.width(), $ckeditor_textarea.height() ); + } + } + var h = (document.all ? window.document.body.offsetHeight : window.innerHeight); var $div = $(this.Div);