Imported CKEDITOR 3.0

Monotone-Parent: 5f9c08dd6b5b34d815ddb2108abbf4055e846934
Monotone-Revision: b2cf7eda0ef8f15fb6e78f8c38a7406a47bcdd2f

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-08-26T14:03:12
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-08-26 14:03:12 +00:00
parent 4d1a003124
commit 0ce87017d6
329 changed files with 5266 additions and 3451 deletions
@@ -24,7 +24,6 @@ CKEDITOR.themes.add( 'default', (function()
var bottomHtml = editor.fireOnce( 'themeSpace', { space : 'bottom', html : '' } ).html;
var height = contentsHtml && editor.config.height;
var width = editor.config.width;
var tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0;
@@ -34,8 +33,16 @@ CKEDITOR.themes.add( 'default', (function()
else if ( !isNaN( height ) )
height += 'px';
if ( !isNaN( width ) )
width += 'px';
var style = '';
var width = editor.config.width;
if ( width )
{
if ( !isNaN( width ) )
width += 'px';
style += "width: " + width + ";";
}
var container = CKEDITOR.dom.element.createFromHtml( [
'<span' +
@@ -45,10 +52,12 @@ CKEDITOR.themes.add( 'default', (function()
' dir="', editor.lang.dir, '"' +
' title="', ( CKEDITOR.env.gecko ? ' ' : '' ), '"' +
' lang="', editor.langCode, '"' +
' tabindex="' + tabIndex + '">' +
' tabindex="' + tabIndex + '"' +
( style ? ' style="' + style + '"' : '' ) +
'>' +
'<span class="' , CKEDITOR.env.cssClass, '">' +
'<span class="cke_wrapper cke_', editor.lang.dir, '">' +
'<table class="cke_editor" border="0" cellspacing="0" cellpadding="0" style="width:', width, '"><tbody>' +
'<table class="cke_editor" border="0" cellspacing="0" cellpadding="0"><tbody>' +
'<tr', topHtml ? '' : ' style="display:none"', '><td id="cke_top_' , name, '" class="cke_top">' , topHtml , '</td></tr>' +
'<tr', contentsHtml ? '' : ' style="display:none"', '><td id="cke_contents_', name, '" class="cke_contents" style="height:', height, '">', contentsHtml, '</td></tr>' +
'<tr', bottomHtml ? '' : ' style="display:none"', '><td id="cke_bottom_' , name, '" class="cke_bottom">' , bottomHtml , '</td></tr>' +
@@ -145,11 +154,36 @@ CKEDITOR.themes.add( 'default', (function()
{
var container = editor.container;
/*
* IE BUG: Removing the editor DOM elements while the selection is inside
* the editing area would break IE7/8's selection system. So we need to put
* the selection back to the parent document without scrolling the window.
* (#3812)
*/
if ( CKEDITOR.env.ie )
{
container.setStyle( 'display', 'none' );
var $range = document.body.createTextRange();
$range.moveToElementText( container.$ );
try
{
// Putting the selection to a display:none element - this will certainly
// fail. But! We've just put the selection document back to the parent
// document without scrolling the window!
$range.select();
}
catch ( e ) {}
}
if ( container )
container.remove();
if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
{
editor.element.show();
delete editor.element;
}
}
};
})() );