I've tested it on IE 6, IE 7 and Firefox 3.5 - It all works as expected.
It seems limited to Chrome and Safari (as you point out).
Somehow the rendering at page load is faulty. Maybe it's a browser-file setting? Since the .NET engine renders the page (HTML) differently depending on the capabilities of the browser.
I'm experiencing the same problem. When using a set height of 300px, firefox will calculate the specific iframe (selector: #xEditingArea iframe) to height 265px. However, Google Chrome just sets this same iframe to 100% height. An iframe cannot have 100% height in any browser, it will use it's default height instead. This is exactly what's causing the problem!
This faulty '100%' height is set in /fckeditor/editor/_source/classes/fckeditingarea.js @ line 99. I can't locate where Firefox and IE are getting their correct computed values from, but I expect the problem should be solved there.
krappies wrote:I got Vista SP2, but SP1 worked as well, and Chrome 2.0.172.33 and FCK 2.6.4... Try a different doctype. The example I gave you worked with no doctype specified, but we also use it with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
After FCKeditor is properly loaded, you can use the Javascript API function SetHTML(). No matter what you inject, Google Chrome gets forced to set the causing iframe to it's proper height!
Note: this is not a fix! So the problem still needs further investigation!!!
var fck = FCKeditorAPI.GetInstance('instance_name');
fck.SetHTML('bla bla');
SpriteSODA wrote:Hi, the solution to the problem is to change in fckconfig.js:
FCKConfig.EnterMode = 'p' ;
Besided this would be a work-around and not the solution, FCK is configured that way already by default. So it doesn't work.
The problem lies in the height of that specific iframe being configured as 100%, instead of a fixed height in pixels. An iframe with 100% height will only be 100% when the browser is set to run in quirks mode. Since most of use use a more recent doctype - like xhtml strict -, this is a problem that needs to be fixed within FCK itself!
Just as many, I also experience this issue. I too believe this has something to do with the height set on the iframe.
My findings however indicate this is not just the height=100% on the iframe, but also the height of the table holding the EditingArea specified in fckeditor.html.
To get this issue resolved in all the three browsers I tested (IE6SP3, FF3.0.13 and Chrome 2.0.172, I had to make the following changes:
1. Set oFCKeditor->height = 500. This ensured the iframe height would be set to 500
2. Modify fckeditor.html, line 294 making <...style="height: 471px; table-layout: fixed"> from <...style="height: 100%; table-layout: fixed">
3. Modify fckeditor.html, line 313 making <td id="xEditingArea" valign="top" style="height: 471px"> from <td id="xEditingArea" valign="top" style="height: 100%">
I believe the difference of 29 pixels between the height I set and what I need to setup in 2 and 3 accounts for the height of the toolbar (set to basic).
I don't know if this fix applies to CKEditor as well but hopefully this will help some of you. I don't know if this is the best way to fix this problem or if this is considered a hack, but at least for now, it solved the issue on our site.
Re: Chrome loading problem (wrong height)
Re: Chrome loading problem (wrong height)
It seems limited to Chrome and Safari (as you point out).
Somehow the rendering at page load is faulty.
Maybe it's a browser-file setting? Since the .NET engine renders the page (HTML) differently depending on the capabilities of the browser.
Re: Chrome loading problem (wrong height)
This faulty '100%' height is set in /fckeditor/editor/_source/classes/fckeditingarea.js @ line 99. I can't locate where Firefox and IE are getting their correct computed values from, but I expect the problem should be solved there.
Attachments:
Re: Chrome loading problem (wrong height)
<script type="text/javascript"> window.onload = function() { var oFCKeditor = new FCKeditor('editor1'); oFCKeditor.BasePath = "./fckeditor/"; oFCKeditor.Height = 600; oFCKeditor.ReplaceTextarea(); }; </script> <body> <form method="post" id="myform" name="myform"> <p> My Editor:<br /> <textarea name="editor1">Initial Value</textarea> </p> </form> </body>Re: Chrome loading problem (wrong height)
At least I'm creating the FCKeditor by using the ASP.NET (2.0) version, with the .DLL as generator
Then it doesn't work!
Re: Chrome loading problem (wrong height)
This same code isn't working in my case, unfortunaly. I'm using Vista SP1 and Chrome 2.0.172.33
Re: Chrome loading problem (wrong height)
Re: Chrome loading problem (wrong height)
Re: Chrome loading problem (wrong height)
Re: Chrome loading problem (wrong height)
Re: Chrome loading problem (wrong height)
After FCKeditor is properly loaded, you can use the Javascript API function SetHTML(). No matter what you inject, Google Chrome gets forced to set the causing iframe to it's proper height!
Note: this is not a fix! So the problem still needs further investigation!!!
var fck = FCKeditorAPI.GetInstance('instance_name'); fck.SetHTML('bla bla');Re: Chrome loading problem (wrong height)
function FCKeditor_OnComplete(editorInstance) { var fck_iframe = document.getElementById(editorInstance.Name + '___Frame'); var fck_editing_area = fck_iframe.contentDocument.getElementById('xEditingArea'); fck_editing_area.style.height = '100.1%'; setTimeout(function() { fck_editing_area.style.height = '100%' }, 100); }Re: Chrome loading problem (wrong height)
from 'br'. if you want other browsers to use 'br', add a condition:
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if (is_chrome) { FCKConfig.EnterMode = 'p' ; // p | div | br } else { FCKConfig.EnterMode = 'br' ; // p | div | br }Re: Chrome loading problem (wrong height)
Besided this would be a work-around and not the solution, FCK is configured that way already by default. So it doesn't work.
The problem lies in the height of that specific iframe being configured as 100%, instead of a fixed height in pixels. An iframe with 100% height will only be 100% when the browser is set to run in quirks mode. Since most of use use a more recent doctype - like xhtml strict -, this is a problem that needs to be fixed within FCK itself!
Re: Chrome loading problem (wrong height)
Which page does this go on?
Re: Chrome loading problem (wrong height)
This is javascript and should go on every page that contains the editor, like this:
<script language="javascript"> function FCKeditor_OnComplete(editorInstance) { var fck_iframe = document.getElementById(editorInstance.Name + '___Frame'); var fck_editing_area = fck_iframe.contentDocument.getElementById('xEditingArea'); fck_editing_area.style.height = '100.1%'; setTimeout(function() { fck_editing_area.style.height = '100%' }, 100); } </script>a little annoying, but a temp fix none-the-less
Re: Chrome loading problem (wrong height)
My findings however indicate this is not just the height=100% on the iframe, but also the height of the table holding the EditingArea specified in fckeditor.html.
To get this issue resolved in all the three browsers I tested (IE6SP3, FF3.0.13 and Chrome 2.0.172, I had to make the following changes:
1. Set oFCKeditor->height = 500. This ensured the iframe height would be set to 500
2. Modify fckeditor.html, line 294 making <...style="height: 471px; table-layout: fixed"> from <...style="height: 100%; table-layout: fixed">
3. Modify fckeditor.html, line 313 making <td id="xEditingArea" valign="top" style="height: 471px"> from <td id="xEditingArea" valign="top" style="height: 100%">
I believe the difference of 29 pixels between the height I set and what I need to setup in 2 and 3 accounts for the height of the toolbar (set to basic).
Cheers to all.
JJO
Re: Chrome loading problem (wrong height)
http://ckeditor.com/whatsnew
Re: Chrome loading problem (wrong height)
Re: Chrome loading problem (wrong height)
Any ideas?
var iTimer; $(document).ready(function() { iTimer = setTimeout('FCKeditorIframe()', 1000); }); function FCKeditorIframe() { clearTimeout(iTimer); var isWebKit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1; if(isWebKit) { $(document).find('iframe').each(function() { if($(this).attr('id').indexOf('___Frame') != -1) { var currFrame = $(this).contents().find('#xEditingArea > iframe:eq(0)'); $(currFrame).load('load', function() { var currHeight = $(this).height(); $(this).css({'height': (currHeight - 17) + 'px'}); }); } }); } }Re: Chrome loading problem (wrong height)
In fckeditor.html, I changed line 286 from this:
To this:
I don't know if this fix applies to CKEditor as well but hopefully this will help some of you. I don't know if this is the best way to fix this problem or if this is considered a hack, but at least for now, it solved the issue on our site.
Re: Chrome loading problem (wrong height)