diff --git a/phpgwapi/inc/class.egw_ckeditor_config.inc.php b/phpgwapi/inc/class.egw_ckeditor_config.inc.php index 92c900dd1a..d6c7eb1088 100644 --- a/phpgwapi/inc/class.egw_ckeditor_config.inc.php +++ b/phpgwapi/inc/class.egw_ckeditor_config.inc.php @@ -171,7 +171,7 @@ class egw_ckeditor_config * Adds the spellchecker configuration to the options and writes the name of * the spellchecker toolbar button to the "spellchecker_button" parameter */ - private static function add_spellchecker_options(&$config, &$spellchecker_button) + private static function add_spellchecker_options(&$config, &$spellchecker_button, &$scayt_button) { //error_log(__METHOD__.__LINE__.' Spellcheck:'.$GLOBALS['egw_info']['server']['enabled_spellcheck']); if (isset($GLOBALS['egw_info']['server']['enabled_spellcheck'])) @@ -187,6 +187,7 @@ class egw_ckeditor_config } if (!($GLOBALS['egw_info']['server']['enabled_spellcheck']=='YesNoSCAYT')) { + $scayt_button='Scayt'; $config['scayt_autoStartup'] = true; $config['scayt_sLang'] = self::get_lang().'_'.self::get_country(); } @@ -202,16 +203,18 @@ class egw_ckeditor_config * Writes the toolbar configuration to the options which depends on the chosen * mode and the spellchecker_button written by the add_spellchecker_options button */ - private static function add_toolbar_options(&$config, $mode, $spellchecker_button) + private static function add_toolbar_options(&$config, $mode, $spellchecker_button, $scayt_button=false) { $config['toolbar'] = array(); switch ($mode) { case 'advanced': - $config['toolbar'][] = array('Source','DocProps','-','Save','NewPage','Preview','-','Templates'); + $config['toolbar'][] = array('Source','DocProps','-','Preview','-','Templates'); $config['toolbar'][] = array('Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'); if ($spellchecker_button) $config['toolbar'][count($config['toolbar']) - 1][] = $spellchecker_button; + if ($scayt_button) + $config['toolbar'][count($config['toolbar']) - 1][] = $scayt_button; $config['toolbar'][] = array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'); $config['toolbar'][] = '/'; @@ -220,7 +223,7 @@ class egw_ckeditor_config $config['toolbar'][] = array('JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'); $config['toolbar'][] = array('BulletedList','NumberedList','-','Outdent','Indent'); $config['toolbar'][] = array('Link','Unlink','Anchor'); - $config['toolbar'][] = array('Maximize','Image','Table','HorizontalRule','SpecialChar','PageBreak'); + $config['toolbar'][] = array('Maximize','Image','Table','HorizontalRule','SpecialChar'/*,'Smiley'*/); $config['toolbar'][] = '/'; @@ -232,7 +235,7 @@ class egw_ckeditor_config case 'extended': default: $config['toolbar'][] = array('Bold','Italic','Underline'); $config['toolbar'][] = array('JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'); - $config['toolbar'][] = array('BulletedList','NumberedList','Outdent','Indent','Undo','Redo'); + $config['toolbar'][] = array('BulletedList','NumberedList'/*,'Smiley'*/,'Outdent','Indent','Undo','Redo'); $config['toolbar'][] = array('Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'); if ($mode == 'extended') @@ -240,9 +243,12 @@ class egw_ckeditor_config $config['toolbar'][] = array('Link','Unlink','Anchor'); $config['toolbar'][] = array('Find', 'Replace'); if ($spellchecker_button) - $config['toolbar'][] = array('Maximize', $spellchecker_button, 'Image', 'Table'); + $config['toolbar'][] = array('Maximize', $spellchecker_button);//, 'Image', 'Table'); else - $config['toolbar'][] = array('Maximize', 'Image', 'Table'); + $config['toolbar'][] = array('Maximize');//, 'Image', 'Table'); + if ($scayt_button) + $config['toolbar'][count($config['toolbar']) - 1][] = $scayt_button; + $config['toolbar'][count($config['toolbar']) - 1][] = array('Image', 'Table'); } else { @@ -250,10 +256,12 @@ class egw_ckeditor_config $config['toolbar'][] = array('Maximize', $spellchecker_button); else $config['toolbar'][] = array('Maximize'); + if ($scayt_button) + $config['toolbar'][count($config['toolbar']) - 1][] = $scayt_button; } $config['toolbar'][] = '/'; - + $config['toolbar'][] = array('Find','Replace','-','SelectAll','RemoveFormat'); $config['toolbar'][] = array('Format','Font','FontSize'); $config['toolbar'][] = array('TextColor','BGColor'); $config['toolbar'][] = array('ShowBlocks','-','About'); @@ -269,8 +277,8 @@ class egw_ckeditor_config $spellchecker_button = null; self::add_default_options($config, $height, $expanded_toolbar, $start_path); - self::add_spellchecker_options($config, $spellchecker_button); - self::add_toolbar_options($config, $mode, $spellchecker_button); + self::add_spellchecker_options($config, $spellchecker_button, $scayt_button); + self::add_toolbar_options($config, $mode, $spellchecker_button, $scayt_button); return $config; } diff --git a/phpgwapi/js/ckeditor3/CHANGES.html b/phpgwapi/js/ckeditor3/CHANGES.html index 9cb20e69c6..b30594741c 100644 --- a/phpgwapi/js/ckeditor3/CHANGES.html +++ b/phpgwapi/js/ckeditor3/CHANGES.html @@ -34,6 +34,73 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
+ New features:
+mode
event now carries the previous editor mode.autoGrow_onStartup
configuration option.autogrow
is now available as an editor command.<textarea>
elements through the dialog window.+ Fixed issues:
+filebrowserWindowFeatures
configuration setting corrected to match the documented name.float
property of label
elements.enterMode
is set to BR
.@@ -504,7 +571,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
document.documentElement
.
+ *
+ * For example, assuming <body>
is the second child
+ * of <html>
(<head>
being the first),
+ * and we would like to address the third child under the
+ * fourth child of <body>
, the tree address returned would be:
+ * [1, 3, 2]
+ *
+ * The tree address cannot be used for finding back the DOM tree node once
+ * the DOM tree structure has been modified.
+ */
+ getAddress : function( normalized )
+ {
+ var address = [];
+ var $documentElement = this.getDocument().$.documentElement;
+ var node = this.$;
+
+ while ( node && node != $documentElement )
+ {
+ var parentNode = node.parentNode;
+
+ if ( parentNode )
+ {
+ // Get the node index. For performance, call getIndex
+ // directly, instead of creating a new node object.
+ address.unshift( this.getIndex.call( { $ : node }, normalized ) );
+ }
+
+ node = parentNode;
+ }
+
+ return address;
+ },
+
+ /**
+ * Gets the document containing this element.
+ * @returns {CKEDITOR.dom.document} The document.
+ * @example
+ * var element = CKEDITOR.document.getById( 'example' );
+ * alert( element.getDocument().equals( CKEDITOR.document ) ); // "true"
+ */
+ getDocument : function()
+ {
+ return new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument );
+ },
+
+ getIndex : function( normalized )
+ {
+ // Attention: getAddress depends on this.$
+
+ var current = this.$,
+ index = 0;
+
+ while ( ( current = current.previousSibling ) )
+ {
+ // When normalizing, do not count it if this is an
+ // empty text node or if it's a text node following another one.
+ if ( normalized && current.nodeType == 3 &&
+ ( !current.nodeValue.length ||
+ ( current.previousSibling && current.previousSibling.nodeType == 3 ) ) )
+ {
+ continue;
+ }
+
+ index++;
+ }
+
+ return index;
+ },
+
+ getNextSourceNode : function( startFromSibling, nodeType, guard )
+ {
+ // If "guard" is a node, transform it in a function.
+ if ( guard && !guard.call )
+ {
+ var guardNode = guard;
+ guard = function( node )
+ {
+ return !node.equals( guardNode );
+ };
+ }
+
+ var node = ( !startFromSibling && this.getFirst && this.getFirst() ),
+ parent;
+
+ // Guarding when we're skipping the current element( no children or 'startFromSibling' ).
+ // send the 'moving out' signal even we don't actually dive into.
+ if ( !node )
+ {
+ if ( this.type == CKEDITOR.NODE_ELEMENT && guard && guard( this, true ) === false )
+ return null;
+ node = this.getNext();
+ }
+
+ while ( !node && ( parent = ( parent || this ).getParent() ) )
+ {
+ // The guard check sends the "true" paramenter to indicate that
+ // we are moving "out" of the element.
+ if ( guard && guard( parent, true ) === false )
+ return null;
+
+ node = parent.getNext();
+ }
+
+ if ( !node )
+ return null;
+
+ if ( guard && guard( node ) === false )
+ return null;
+
+ if ( nodeType && nodeType != node.type )
+ return node.getNextSourceNode( false, nodeType, guard );
+
+ return node;
+ },
+
+ getPreviousSourceNode : function( startFromSibling, nodeType, guard )
+ {
+ if ( guard && !guard.call )
+ {
+ var guardNode = guard;
+ guard = function( node )
+ {
+ return !node.equals( guardNode );
+ };
+ }
+
+ var node = ( !startFromSibling && this.getLast && this.getLast() ),
+ parent;
+
+ // Guarding when we're skipping the current element( no children or 'startFromSibling' ).
+ // send the 'moving out' signal even we don't actually dive into.
+ if ( !node )
+ {
+ if ( this.type == CKEDITOR.NODE_ELEMENT && guard && guard( this, true ) === false )
+ return null;
+ node = this.getPrevious();
+ }
+
+ while ( !node && ( parent = ( parent || this ).getParent() ) )
+ {
+ // The guard check sends the "true" paramenter to indicate that
+ // we are moving "out" of the element.
+ if ( guard && guard( parent, true ) === false )
+ return null;
+
+ node = parent.getPrevious();
+ }
+
+ if ( !node )
+ return null;
+
+ if ( guard && guard( node ) === false )
+ return null;
+
+ if ( nodeType && node.type != nodeType )
+ return node.getPreviousSourceNode( false, nodeType, guard );
+
+ return node;
+ },
+
+ getPrevious : function( evaluator )
+ {
+ var previous = this.$, retval;
+ do
+ {
+ previous = previous.previousSibling;
+ retval = previous && new CKEDITOR.dom.node( previous );
+ }
+ while ( retval && evaluator && !evaluator( retval ) )
+ return retval;
+ },
+
+ /**
+ * Gets the node that follows this element in its parent's child list.
+ * @param {Function} evaluator Filtering the result node.
+ * @returns {CKEDITOR.dom.node} The next node or null if not available.
+ * @example
+ * var element = CKEDITOR.dom.element.createFromHtml( '<div><b>Example</b> <i>next</i></div>' );
+ * var first = element.getFirst().getNext();
+ * alert( first.getName() ); // "i"
+ */
+ getNext : function( evaluator )
+ {
+ var next = this.$, retval;
+ do
+ {
+ next = next.nextSibling;
+ retval = next && new CKEDITOR.dom.node( next );
+ }
+ while ( retval && evaluator && !evaluator( retval ) )
+ return retval;
+ },
+
+ /**
+ * Gets the parent element for this node.
+ * @returns {CKEDITOR.dom.element} The parent element.
+ * @example
+ * var node = editor.document.getBody().getFirst();
+ * var parent = node.getParent();
+ * alert( node.getName() ); // "body"
+ */
+ getParent : function()
+ {
+ var parent = this.$.parentNode;
+ return ( parent && parent.nodeType == 1 ) ? new CKEDITOR.dom.node( parent ) : null;
+ },
+
+ getParents : function( closerFirst )
+ {
+ var node = this;
+ var parents = [];
+
+ do
+ {
+ parents[ closerFirst ? 'push' : 'unshift' ]( node );
+ }
+ while ( ( node = node.getParent() ) )
+
+ return parents;
+ },
+
+ getCommonAncestor : function( node )
+ {
+ if ( node.equals( this ) )
+ return this;
+
+ if ( node.contains && node.contains( this ) )
+ return node;
+
+ var start = this.contains ? this : this.getParent();
+
+ do
+ {
+ if ( start.contains( node ) )
+ return start;
+ }
+ while ( ( start = start.getParent() ) );
+
+ return null;
+ },
+
+ getPosition : function( otherNode )
+ {
+ var $ = this.$;
+ var $other = otherNode.$;
+
+ if ( $.compareDocumentPosition )
+ return $.compareDocumentPosition( $other );
+
+ // IE and Safari have no support for compareDocumentPosition.
+
+ if ( $ == $other )
+ return CKEDITOR.POSITION_IDENTICAL;
+
+ // Only element nodes support contains and sourceIndex.
+ if ( this.type == CKEDITOR.NODE_ELEMENT && otherNode.type == CKEDITOR.NODE_ELEMENT )
+ {
+ if ( $.contains )
+ {
+ if ( $.contains( $other ) )
+ return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
+
+ if ( $other.contains( $ ) )
+ return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING;
+ }
+
+ if ( 'sourceIndex' in $ )
+ {
+ return ( $.sourceIndex < 0 || $other.sourceIndex < 0 ) ? CKEDITOR.POSITION_DISCONNECTED :
+ ( $.sourceIndex < $other.sourceIndex ) ? CKEDITOR.POSITION_PRECEDING :
+ CKEDITOR.POSITION_FOLLOWING;
+ }
+ }
+
+ // For nodes that don't support compareDocumentPosition, contains
+ // or sourceIndex, their "address" is compared.
+
+ var addressOfThis = this.getAddress(),
+ addressOfOther = otherNode.getAddress(),
+ minLevel = Math.min( addressOfThis.length, addressOfOther.length );
+
+ // Determinate preceed/follow relationship.
+ for ( var i = 0 ; i <= minLevel - 1 ; i++ )
+ {
+ if ( addressOfThis[ i ] != addressOfOther[ i ] )
+ {
+ if ( i < minLevel )
+ {
+ return addressOfThis[ i ] < addressOfOther[ i ] ?
+ CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
+ }
+ break;
+ }
+ }
+
+ // Determinate contains/contained relationship.
+ return ( addressOfThis.length < addressOfOther.length ) ?
+ CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING :
+ CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING;
+ },
+
+ /**
+ * Gets the closest ancestor node of this node, specified by its name.
+ * @param {String} reference The name of the ancestor node to search or
+ * an object with the node names to search for.
+ * @param {Boolean} [includeSelf] Whether to include the current
+ * node in the search.
+ * @returns {CKEDITOR.dom.node} The located ancestor node or null if not found.
+ * @since 3.6.1
+ * @example
+ * // Suppose we have the following HTML structure:
+ * // <div id="outer"><div id="inner"><p><b>Some text</b></p></div></div>
+ * // If node == <b>
+ * ascendant = node.getAscendant( 'div' ); // ascendant == <div id="inner">
+ * ascendant = node.getAscendant( 'b' ); // ascendant == null
+ * ascendant = node.getAscendant( 'b', true ); // ascendant == <b>
+ * ascendant = node.getAscendant( { div: 1, p: 1} ); // Searches for the first 'div' or 'p': ascendant == <div id="inner">
+ */
+ getAscendant : function( reference, includeSelf )
+ {
+ var $ = this.$,
+ name;
+
+ if ( !includeSelf )
+ $ = $.parentNode;
+
+ while ( $ )
+ {
+ if ( $.nodeName && ( name = $.nodeName.toLowerCase(), ( typeof reference == 'string' ? name == reference : name in reference ) ) )
+ return new CKEDITOR.dom.node( $ );
+
+ $ = $.parentNode;
+ }
+ return null;
+ },
+
+ hasAscendant : function( name, includeSelf )
+ {
+ var $ = this.$;
+
+ if ( !includeSelf )
+ $ = $.parentNode;
+
+ while ( $ )
+ {
+ if ( $.nodeName && $.nodeName.toLowerCase() == name )
+ return true;
+
+ $ = $.parentNode;
+ }
+ return false;
+ },
+
+ move : function( target, toStart )
+ {
+ target.append( this.remove(), toStart );
+ },
+
+ /**
+ * Removes this node from the document DOM.
+ * @param {Boolean} [preserveChildren] Indicates that the children
+ * elements must remain in the document, removing only the outer
+ * tags.
+ * @example
+ * var element = CKEDITOR.dom.element.getById( 'MyElement' );
+ * element.remove();
+ */
+ remove : function( preserveChildren )
+ {
+ var $ = this.$;
+ var parent = $.parentNode;
+
+ if ( parent )
+ {
+ if ( preserveChildren )
+ {
+ // Move all children before the node.
+ for ( var child ; ( child = $.firstChild ) ; )
+ {
+ parent.insertBefore( $.removeChild( child ), $ );
+ }
+ }
+
+ parent.removeChild( $ );
+ }
+
+ return this;
+ },
+
+ replace : function( nodeToReplace )
+ {
+ this.insertBefore( nodeToReplace );
+ nodeToReplace.remove();
+ },
+
+ trim : function()
+ {
+ this.ltrim();
+ this.rtrim();
+ },
+
+ ltrim : function()
+ {
+ var child;
+ while ( this.getFirst && ( child = this.getFirst() ) )
+ {
+ if ( child.type == CKEDITOR.NODE_TEXT )
+ {
+ var trimmed = CKEDITOR.tools.ltrim( child.getText() ),
+ originalLength = child.getLength();
+
+ if ( !trimmed )
+ {
+ child.remove();
+ continue;
+ }
+ else if ( trimmed.length < originalLength )
+ {
+ child.split( originalLength - trimmed.length );
+
+ // IE BUG: child.remove() may raise JavaScript errors here. (#81)
+ this.$.removeChild( this.$.firstChild );
+ }
+ }
+ break;
+ }
+ },
+
+ rtrim : function()
+ {
+ var child;
+ while ( this.getLast && ( child = this.getLast() ) )
+ {
+ if ( child.type == CKEDITOR.NODE_TEXT )
+ {
+ var trimmed = CKEDITOR.tools.rtrim( child.getText() ),
+ originalLength = child.getLength();
+
+ if ( !trimmed )
+ {
+ child.remove();
+ continue;
+ }
+ else if ( trimmed.length < originalLength )
+ {
+ child.split( trimmed.length );
+
+ // IE BUG: child.getNext().remove() may raise JavaScript errors here.
+ // (#81)
+ this.$.lastChild.parentNode.removeChild( this.$.lastChild );
+ }
+ }
+ break;
+ }
+
+ if ( !CKEDITOR.env.ie && !CKEDITOR.env.opera )
+ {
+ child = this.$.lastChild;
+
+ if ( child && child.type == 1 && child.nodeName.toLowerCase() == 'br' )
+ {
+ // Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#324).
+ child.parentNode.removeChild( child ) ;
+ }
+ }
+ },
+
+ /**
+ * Checks if this node is read-only (should not be changed).
+ * @returns {Boolean}
+ * @since 3.5
+ * @example
+ * // For the following HTML:
+ * // <div contenteditable="false">Some <b>text</b></div>
+ *
+ * // If "ele" is the above <div>
+ * ele.isReadOnly(); // true
+ */
+ isReadOnly : function()
+ {
+ var element = this;
+ if ( this.type != CKEDITOR.NODE_ELEMENT )
+ element = this.getParent();
+
+ if ( element && typeof element.$.isContentEditable != 'undefined' )
+ return ! ( element.$.isContentEditable || element.data( 'cke-editable' ) );
+ else
+ {
+ // Degrade for old browsers which don't support "isContentEditable", e.g. FF3
+ var current = element;
+ while( current )
+ {
+ if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) )
+ break;
+
+ if ( current.getAttribute( 'contentEditable' ) == 'false' )
+ return true;
+ else if ( current.getAttribute( 'contentEditable' ) == 'true' )
+ break;
+
+ current = current.getParent();
+ }
+
+ return false;
+ }
+ }
+ }
+);
diff --git a/phpgwapi/js/ckeditor3/_source/core/dom/nodelist.js b/phpgwapi/js/ckeditor3/_source/core/dom/nodelist.js
new file mode 100644
index 0000000000..42efafc70f
--- /dev/null
+++ b/phpgwapi/js/ckeditor3/_source/core/dom/nodelist.js
@@ -0,0 +1,26 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @class
+ */
+CKEDITOR.dom.nodeList = function( nativeList )
+{
+ this.$ = nativeList;
+};
+
+CKEDITOR.dom.nodeList.prototype =
+{
+ count : function()
+ {
+ return this.$.length;
+ },
+
+ getItem : function( index )
+ {
+ var $node = this.$[ index ];
+ return $node ? new CKEDITOR.dom.node( $node ) : null;
+ }
+};
diff --git a/phpgwapi/js/ckeditor3/_source/core/dom/range.js b/phpgwapi/js/ckeditor3/_source/core/dom/range.js
new file mode 100644
index 0000000000..67759c80ad
--- /dev/null
+++ b/phpgwapi/js/ckeditor3/_source/core/dom/range.js
@@ -0,0 +1,2054 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * Creates a CKEDITOR.dom.range instance that can be used inside a specific
+ * DOM Document.
+ * @class Represents a delimited piece of content in a DOM Document.
+ * It is contiguous in the sense that it can be characterized as selecting all
+ * of the content between a pair of boundary-points....
[text) + // or at the start of block ([text...), by comparing the document position + // with 'enlargeable' node. + this.setStartAt( + blockBoundary, + !blockBoundary.is( 'br' ) && + ( !enlargeable && this.checkStartOfBlock() + || enlargeable && blockBoundary.contains( enlargeable ) ) ? + CKEDITOR.POSITION_AFTER_START : + CKEDITOR.POSITION_AFTER_END ); + + // Avoid enlarging the range further when end boundary spans right after the BR. (#7490) + if ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) + { + var theRange = this.clone(); + walker = new CKEDITOR.dom.walker( theRange ); + + var whitespaces = CKEDITOR.dom.walker.whitespaces(), + bookmark = CKEDITOR.dom.walker.bookmark(); + + walker.evaluator = function( node ) { return !whitespaces( node ) && !bookmark( node ); }; + var previous = walker.previous(); + if ( previous && previous.type == CKEDITOR.NODE_ELEMENT && previous.is( 'br' ) ) + return; + } + + + // Enlarging the end boundary. + walkerRange = this.clone(); + walkerRange.collapse(); + walkerRange.setEndAt( body, CKEDITOR.POSITION_BEFORE_END ); + walker = new CKEDITOR.dom.walker( walkerRange ); + + // tailBrGuard only used for on range end. + walker.guard = ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? + tailBrGuard : boundaryGuard; + blockBoundary = null; + // End the range right before the block boundary node. + + enlargeable = walker.lastForward(); + + // It's the body which stop the enlarging if no block boundary found. + blockBoundary = blockBoundary || body; + + // Close the range either before the found block start (text]
...
) or at the block end (...text]) + // by comparing the document position with 'enlargeable' node. + this.setEndAt( + blockBoundary, + ( !enlargeable && this.checkEndOfBlock() + || enlargeable && blockBoundary.contains( enlargeable ) ) ? + CKEDITOR.POSITION_BEFORE_END : + CKEDITOR.POSITION_BEFORE_START ); + // We must include the{@link CKEDITOR.config.skin}
setting.
+ * @name CKEDITOR.editor.prototype.skinName
+ * @type String
+ * @example
+ * alert( editor.skinName ); // E.g. "kama"
+ */
+ editor.skinName = skinName;
+
+ /**
+ * The full URL of the skin directory.
+ * @name CKEDITOR.editor.prototype.skinPath
+ * @type String
+ * @example
+ * alert( editor.skinPath ); // E.g. "http://example.com/ckeditor/skins/kama/"
+ */
+ editor.skinPath = skinPath;
+
+ /**
+ * The CSS class name used for skin identification purposes.
+ * @name CKEDITOR.editor.prototype.skinClass
+ * @type String
+ * @example
+ * alert( editor.skinClass ); // E.g. "cke_skin_kama"
+ */
+ editor.skinClass = 'cke_skin_' + skinName;
+
+ /**
+ * The tabbing
+ * navigation order that has been calculated for this editor
+ * instance. This can be set by the {@link CKEDITOR.config.tabIndex}
+ * setting or taken from the tabindex
attribute of the
+ * {@link #element}
associated with the editor.
+ * @name CKEDITOR.editor.prototype.tabIndex
+ * @type Number
+ * @default 0 (zero)
+ * @example
+ * alert( editor.tabIndex ); // E.g. "0"
+ */
+ editor.tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0;
+
+ /**
+ * Indicates the read-only state of this editor. This is a read-only property.
+ * @name CKEDITOR.editor.prototype.readOnly
+ * @type Boolean
+ * @since 3.6
+ * @see CKEDITOR.editor#setReadOnly
+ */
+ editor.readOnly = !!( editor.config.readOnly || editor.element.getAttribute( 'disabled' ) );
+
+ // Fire the "configLoaded" event.
+ editor.fireOnce( 'configLoaded' );
+
+ // Load language file.
+ loadSkin( editor );
+ };
+
+ var loadLang = function( editor )
+ {
+ CKEDITOR.lang.load( editor.config.language, editor.config.defaultLanguage, function( languageCode, lang )
+ {
+ /**
+ * The code for the language resources that have been loaded
+ * for the user interface elements of this editor instance.
+ * @name CKEDITOR.editor.prototype.langCode
+ * @type String
+ * @example
+ * alert( editor.langCode ); // E.g. "en"
+ */
+ editor.langCode = languageCode;
+
+ /**
+ * An object that contains all language strings used by the editor
+ * interface.
+ * @name CKEDITOR.editor.prototype.lang
+ * @type CKEDITOR.lang
+ * @example
+ * alert( editor.lang.bold ); // E.g. "Negrito" (if the language is set to Portuguese)
+ */
+ // As we'll be adding plugin specific entries that could come
+ // from different language code files, we need a copy of lang,
+ // not a direct reference to it.
+ editor.lang = CKEDITOR.tools.prototypedCopy( lang );
+
+ // We're not able to support RTL in Firefox 2 at this time.
+ if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' )
+ editor.lang.dir = 'ltr';
+
+ editor.fire( 'langLoaded' );
+
+ var config = editor.config;
+ config.contentsLangDirection == 'ui' && ( config.contentsLangDirection = editor.lang.dir );
+
+ loadPlugins( editor );
+ });
+ };
+
+ var loadPlugins = function( editor )
+ {
+ var config = editor.config,
+ plugins = config.plugins,
+ extraPlugins = config.extraPlugins,
+ removePlugins = config.removePlugins;
+
+ if ( extraPlugins )
+ {
+ // Remove them first to avoid duplications.
+ var removeRegex = new RegExp( '(?:^|,)(?:' + extraPlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' );
+ plugins = plugins.replace( removeRegex, '' );
+
+ plugins += ',' + extraPlugins;
+ }
+
+ if ( removePlugins )
+ {
+ removeRegex = new RegExp( '(?:^|,)(?:' + removePlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' );
+ plugins = plugins.replace( removeRegex, '' );
+ }
+
+ // Load the Adobe AIR plugin conditionally.
+ CKEDITOR.env.air && ( plugins += ',adobeair' );
+
+ // Load all plugins defined in the "plugins" setting.
+ CKEDITOR.plugins.load( plugins.split( ',' ), function( plugins )
+ {
+ // The list of plugins.
+ var pluginsArray = [];
+
+ // The language code to get loaded for each plugin. Null
+ // entries will be appended for plugins with no language files.
+ var languageCodes = [];
+
+ // The list of URLs to language files.
+ var languageFiles = [];
+
+ /**
+ * An object that contains references to all plugins used by this
+ * editor instance.
+ * @name CKEDITOR.editor.prototype.plugins
+ * @type Object
+ * @example
+ * alert( editor.plugins.dialog.path ); // E.g. "http://example.com/ckeditor/plugins/dialog/"
+ */
+ editor.plugins = plugins;
+
+ // Loop through all plugins, to build the list of language
+ // files to get loaded.
+ for ( var pluginName in plugins )
+ {
+ var plugin = plugins[ pluginName ],
+ pluginLangs = plugin.lang,
+ pluginPath = CKEDITOR.plugins.getPath( pluginName ),
+ lang = null;
+
+ // Set the plugin path in the plugin.
+ plugin.path = pluginPath;
+
+ // If the plugin has "lang".
+ if ( pluginLangs )
+ {
+ // Resolve the plugin language. If the current language
+ // is not available, get the first one (default one).
+ lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] );
+
+ if ( !plugin.langEntries || !plugin.langEntries[ lang ] )
+ {
+ // Put the language file URL into the list of files to
+ // get downloaded.
+ languageFiles.push( CKEDITOR.getUrl( pluginPath + 'lang/' + lang + '.js' ) );
+ }
+ else
+ {
+ CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ lang ] );
+ lang = null;
+ }
+ }
+
+ // Save the language code, so we know later which
+ // language has been resolved to this plugin.
+ languageCodes.push( lang );
+
+ pluginsArray.push( plugin );
+ }
+
+ // Load all plugin specific language files in a row.
+ CKEDITOR.scriptLoader.load( languageFiles, function()
+ {
+ // Initialize all plugins that have the "beforeInit" and "init" methods defined.
+ var methods = [ 'beforeInit', 'init', 'afterInit' ];
+ for ( var m = 0 ; m < methods.length ; m++ )
+ {
+ for ( var i = 0 ; i < pluginsArray.length ; i++ )
+ {
+ var plugin = pluginsArray[ i ];
+
+ // Uses the first loop to update the language entries also.
+ if ( m === 0 && languageCodes[ i ] && plugin.lang )
+ CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ languageCodes[ i ] ] );
+
+ // Call the plugin method (beforeInit and init).
+ if ( plugin[ methods[ m ] ] )
+ plugin[ methods[ m ] ]( editor );
+ }
+ }
+
+ // Load the editor skin.
+ editor.fire( 'pluginsLoaded' );
+ loadTheme( editor );
+ });
+ });
+ };
+
+ var loadSkin = function( editor )
+ {
+ CKEDITOR.skins.load( editor, 'editor', function()
+ {
+ loadLang( editor );
+ });
+ };
+
+ var loadTheme = function( editor )
+ {
+ var theme = editor.config.theme;
+ CKEDITOR.themes.load( theme, function()
+ {
+ /**
+ * The theme used by this editor instance.
+ * @name CKEDITOR.editor.prototype.theme
+ * @type CKEDITOR.theme
+ * @example
+ * alert( editor.theme ); // E.g. "http://example.com/ckeditor/themes/default/"
+ */
+ var editorTheme = editor.theme = CKEDITOR.themes.get( theme );
+ editorTheme.path = CKEDITOR.themes.getPath( theme );
+ editorTheme.build( editor );
+
+ if ( editor.config.autoUpdateElement )
+ attachToForm( editor );
+ });
+ };
+
+ var attachToForm = function( editor )
+ {
+ var element = editor.element;
+
+ // If are replacing a textarea, we must
+ if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.is( 'textarea' ) )
+ {
+ var form = element.$.form && new CKEDITOR.dom.element( element.$.form );
+ if ( form )
+ {
+ function onSubmit()
+ {
+ editor.updateElement();
+ }
+ form.on( 'submit',onSubmit );
+
+ // Setup the submit function because it doesn't fire the
+ // "submit" event.
+ if ( !form.$.submit.nodeName && !form.$.submit.length )
+ {
+ form.$.submit = CKEDITOR.tools.override( form.$.submit, function( originalSubmit )
+ {
+ return function()
+ {
+ editor.updateElement();
+
+ // For IE, the DOM submit function is not a
+ // function, so we need thid check.
+ if ( originalSubmit.apply )
+ originalSubmit.apply( this, arguments );
+ else
+ originalSubmit();
+ };
+ });
+ }
+
+ // Remove 'submit' events registered on form element before destroying.(#3988)
+ editor.on( 'destroy', function()
+ {
+ form.removeListener( 'submit', onSubmit );
+ } );
+ }
+ }
+ };
+
+ function updateCommands()
+ {
+ var command,
+ commands = this._.commands,
+ mode = this.mode;
+
+ if ( !mode )
+ return;
+
+ for ( var name in commands )
+ {
+ command = commands[ name ];
+ command[ command.startDisabled ? 'disable' :
+ this.readOnly && !command.readOnly ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ]();
+ }
+ }
+
+ /**
+ * Initializes the editor instance. This function is called by the editor
+ * contructor (editor_basic.js
).
+ * @private
+ */
+ CKEDITOR.editor.prototype._init = function()
+ {
+ // Get the properties that have been saved in the editor_base
+ // implementation.
+ var element = CKEDITOR.dom.element.get( this._.element ),
+ instanceConfig = this._.instanceConfig;
+ delete this._.element;
+ delete this._.instanceConfig;
+
+ this._.commands = {};
+ this._.styles = [];
+
+ /**
+ * The DOM element that was replaced by this editor instance. This
+ * element stores the editor data on load and post.
+ * @name CKEDITOR.editor.prototype.element
+ * @type CKEDITOR.dom.element
+ * @example
+ * var editor = CKEDITOR.instances.editor1;
+ * alert( editor.element.getName() ); // E.g. "textarea"
+ */
+ this.element = element;
+
+ /**
+ * The editor instance name. It may be the replaced element ID, name, or
+ * a default name using the progressive counter (editor1
,
+ * editor2
, ...).
+ * @name CKEDITOR.editor.prototype.name
+ * @type String
+ * @example
+ * var editor = CKEDITOR.instances.editor1;
+ * alert( editor.name ); // "editor1"
+ */
+ this.name = ( element && ( this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+ && ( element.getId() || element.getNameAtt() ) )
+ || getNewName();
+
+ if ( this.name in CKEDITOR.instances )
+ throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.';
+
+ /**
+ * A unique random string assigned to each editor instance on the page.
+ * @name CKEDITOR.editor.prototype.id
+ * @type String
+ */
+ this.id = CKEDITOR.tools.getNextId();
+
+ /**
+ * The configurations for this editor instance. It inherits all
+ * settings defined in (@link CKEDITOR.config}
, combined with settings
+ * loaded from custom configuration files and those defined inline in
+ * the page when creating the editor.
+ * @name CKEDITOR.editor.prototype.config
+ * @type Object
+ * @example
+ * var editor = CKEDITOR.instances.editor1;
+ * alert( editor.config.theme ); // E.g. "default"
+ */
+ this.config = CKEDITOR.tools.prototypedCopy( CKEDITOR.config );
+
+ /**
+ * The namespace containing UI features related to this editor instance.
+ * @name CKEDITOR.editor.prototype.ui
+ * @type CKEDITOR.ui
+ * @example
+ */
+ this.ui = new CKEDITOR.ui( this );
+
+ /**
+ * Controls the focus state of this editor instance. This property
+ * is rarely used for normal API operations. It is mainly
+ * intended for developers adding UI elements to the editor interface.
+ * @name CKEDITOR.editor.prototype.focusManager
+ * @type CKEDITOR.focusManager
+ * @example
+ */
+ this.focusManager = new CKEDITOR.focusManager( this );
+
+ CKEDITOR.fire( 'instanceCreated', null, this );
+
+ this.on( 'mode', updateCommands, null, null, 1 );
+ this.on( 'readOnly', updateCommands, null, null, 1 );
+
+ initConfig( this, instanceConfig );
+ };
+})();
+
+CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
+ /** @lends CKEDITOR.editor.prototype */
+ {
+ /**
+ * Adds a command definition to the editor instance. Commands added with
+ * this function can be executed later with the {@link #execCommand}
method.
+ * @param {String} commandName The indentifier name of the command.
+ * @param {CKEDITOR.commandDefinition} commandDefinition The command definition.
+ * @example
+ * editorInstance.addCommand( 'sample',
+ * {
+ * exec : function( editor )
+ * {
+ * alert( 'Executing a command for the editor name "' + editor.name + '"!' );
+ * }
+ * });
+ */
+ addCommand : function( commandName, commandDefinition )
+ {
+ return this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
+ },
+
+ /**
+ * Adds a piece of CSS code to the editor which will be applied to the WYSIWYG editing document.
+ * This CSS would not be added to the output, and is there mainly for editor-specific editing requirements.
+ * Note: This function should be called before the editor is loaded to take effect.
+ * @param css {String} CSS text.
+ * @example
+ * editorInstance.addCss( 'body { background-color: grey; }' );
+ */
+ addCss : function( css )
+ {
+ this._.styles.push( css );
+ },
+
+ /**
+ * Destroys the editor instance, releasing all resources used by it.
+ * If the editor replaced an element, the element will be recovered.
+ * @param {Boolean} [noUpdate] If the instance is replacing a DOM
+ * element, this parameter indicates whether or not to update the
+ * element with the instance contents.
+ * @example
+ * alert( CKEDITOR.instances.editor1 ); // E.g "object"
+ * CKEDITOR.instances.editor1.destroy();
+ * alert( CKEDITOR.instances.editor1 ); // "undefined"
+ */
+ destroy : function( noUpdate )
+ {
+ if ( !noUpdate )
+ this.updateElement();
+
+ this.fire( 'destroy' );
+ this.theme && this.theme.destroy( this );
+
+ CKEDITOR.remove( this );
+ CKEDITOR.fire( 'instanceDestroyed', null, this );
+ },
+
+ /**
+ * Executes a command associated with the editor.
+ * @param {String} commandName The indentifier name of the command.
+ * @param {Object} [data] Data to be passed to the command.
+ * @returns {Boolean} true
if the command was executed
+ * successfully, otherwise false
.
+ * @see CKEDITOR.editor.addCommand
+ * @example
+ * editorInstance.execCommand( 'bold' );
+ */
+ execCommand : function( commandName, data )
+ {
+ var command = this.getCommand( commandName );
+
+ var eventData =
+ {
+ name: commandName,
+ commandData: data,
+ command: command
+ };
+
+ if ( command && command.state != CKEDITOR.TRISTATE_DISABLED )
+ {
+ if ( this.fire( 'beforeCommandExec', eventData ) !== true )
+ {
+ eventData.returnValue = command.exec( eventData.commandData );
+
+ // Fire the 'afterCommandExec' immediately if command is synchronous.
+ if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== true )
+ return eventData.returnValue;
+ }
+ }
+
+ // throw 'Unknown command name "' + commandName + '"';
+ return false;
+ },
+
+ /**
+ * Gets one of the registered commands. Note that after registering a
+ * command definition with {@link #addCommand}
, it is
+ * transformed internally into an instance of
+ * {@link CKEDITOR.command}
, which will then be returned
+ * by this function.
+ * @param {String} commandName The name of the command to be returned.
+ * This is the same name that is used to register the command with
+ * addCommand
.
+ * @returns {CKEDITOR.command} The command object identified by the
+ * provided name.
+ */
+ getCommand : function( commandName )
+ {
+ return this._.commands[ commandName ];
+ },
+
+ /**
+ * Gets the editor data. The data will be in raw format. It is the same
+ * data that is posted by the editor.
+ * @type String
+ * @returns (String) The editor data.
+ * @example
+ * if ( CKEDITOR.instances.editor1.getData() == '' )
+ * alert( 'There is no data available' );
+ */
+ getData : function()
+ {
+ this.fire( 'beforeGetData' );
+
+ var eventData = this._.data;
+
+ if ( typeof eventData != 'string' )
+ {
+ var element = this.element;
+ if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+ eventData = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
+ else
+ eventData = '';
+ }
+
+ eventData = { dataValue : eventData };
+
+ // Fire "getData" so data manipulation may happen.
+ this.fire( 'getData', eventData );
+
+ return eventData.dataValue;
+ },
+
+ /**
+ * Gets the "raw data" currently available in the editor. This is a
+ * fast method which returns the data as is, without processing, so it is
+ * not recommended to use it on resulting pages. Instead it can be used
+ * combined with the {@link #loadSnapshot}
method in order
+ * to be able to automatically save the editor data from time to time
+ * while the user is using the editor, to avoid data loss, without risking
+ * performance issues.
+ * @see CKEDITOR.editor.getData
+ * @example
+ * alert( editor.getSnapshot() );
+ */
+ getSnapshot : function()
+ {
+ var data = this.fire( 'getSnapshot' );
+
+ if ( typeof data != 'string' )
+ {
+ var element = this.element;
+ if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+ data = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
+ }
+
+ return data;
+ },
+
+ /**
+ * Loads "raw data" into the editor. The data is loaded with processing
+ * straight to the editing area. It should not be used as a way to load
+ * any kind of data, but instead in combination with
+ * {@link #getSnapshot}
produced data.
+ * @see CKEDITOR.editor.setData
+ * @example
+ * var data = editor.getSnapshot();
+ * editor.loadSnapshot( data );
+ */
+ loadSnapshot : function( snapshot )
+ {
+ this.fire( 'loadSnapshot', snapshot );
+ },
+
+ /**
+ * Sets the editor data. The data must be provided in the raw format (HTML).callback
parameter must
+ * be used if interaction with the editor is needed after setting the data.
+ * @param {String} data HTML code to replace the curent content in the
+ * editor.
+ * @param {Function} callback Function to be called after the setData
+ * is completed.
+ *@param {Boolean} internal Whether to suppress any event firing when copying data
+ * internally inside the editor.
+ * @example
+ * CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' );
+ * @example
+ * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function()
+ * {
+ * this.checkDirty(); // true
+ * });
+ */
+ setData : function( data , callback, internal )
+ {
+ if( callback )
+ {
+ this.on( 'dataReady', function( evt )
+ {
+ evt.removeListener();
+ callback.call( evt.editor );
+ } );
+ }
+
+ // Fire "setData" so data manipulation may happen.
+ var eventData = { dataValue : data };
+ !internal && this.fire( 'setData', eventData );
+
+ this._.data = eventData.dataValue;
+
+ !internal && this.fire( 'afterSetData', eventData );
+ },
+
+ /**
+ * Puts or restores the editor into read-only state. When in read-only,
+ * the user is not able to change the editor contents, but can still use
+ * some editor features. This function sets the {@link CKEDITOR.config.readOnly}
+ * property of the editor, firing the {@link CKEDITOR.editor#readOnly}
event.true
, default) or be restored and made editable
+ * (false
).
+ * @since 3.6
+ */
+ setReadOnly : function( isReadOnly )
+ {
+ isReadOnly = ( isReadOnly == undefined ) || isReadOnly;
+
+ if ( this.readOnly != isReadOnly )
+ {
+ this.readOnly = isReadOnly;
+
+ // Fire the readOnly event so the editor features can update
+ // their state accordingly.
+ this.fire( 'readOnly' );
+ }
+ },
+
+ /**
+ * Inserts HTML code into the currently selected position in the editor in WYSIWYG mode.
+ * @param {String} data HTML code to be inserted into the editor.
+ * @example
+ * CKEDITOR.instances.editor1.insertHtml( '<p>This is a new paragraph.</p>' );
+ */
+ insertHtml : function( data )
+ {
+ this.fire( 'insertHtml', data );
+ },
+
+ /**
+ * Insert text content into the currently selected position in the
+ * editor in WYSIWYG mode. The styles of the selected element will be applied to the inserted text.
+ * Spaces around the text will be leaving untouched.
+ * Note: two subsequent line-breaks will introduce one paragraph. This depends on {@link CKEDITOR.config.enterMode}
;
+ * A single line-break will be instead translated into one <br />.
+ * @since 3.5
+ * @param {String} text Text to be inserted into the editor.
+ * @example
+ * CKEDITOR.instances.editor1.insertText( ' line1 \n\n line2' );
+ */
+ insertText : function( text )
+ {
+ this.fire( 'insertText', text );
+ },
+
+ /**
+ * Inserts an element into the currently selected position in the
+ * editor in WYSIWYG mode.
+ * @param {CKEDITOR.dom.element} element The element to be inserted
+ * into the editor.
+ * @example
+ * var element = CKEDITOR.dom.element.createFromHtml( '<img src="hello.png" border="0" title="Hello" />' );
+ * CKEDITOR.instances.editor1.insertElement( element );
+ */
+ insertElement : function( element )
+ {
+ this.fire( 'insertElement', element );
+ },
+
+ /**
+ * Checks whether the current editor contents contain changes when
+ * compared to the contents loaded into the editor at startup, or to
+ * the contents available in the editor when {@link #resetDirty}
+ * was called.
+ * @returns {Boolean} "true" is the contents contain changes.
+ * @example
+ * function beforeUnload( e )
+ * {
+ * if ( CKEDITOR.instances.editor1.checkDirty() )
+ * return e.returnValue = "You will lose the changes made in the editor.";
+ * }
+ *
+ * if ( window.addEventListener )
+ * window.addEventListener( 'beforeunload', beforeUnload, false );
+ * else
+ * window.attachEvent( 'onbeforeunload', beforeUnload );
+ */
+ checkDirty : function()
+ {
+ return ( this.mayBeDirty && this._.previousValue !== this.getSnapshot() );
+ },
+
+ /**
+ * Resets the "dirty state" of the editor so subsequent calls to
+ * {@link #checkDirty}
will return false
if the user will not
+ * have made further changes to the contents.
+ * @example
+ * alert( editor.checkDirty() ); // E.g. "true"
+ * editor.resetDirty();
+ * alert( editor.checkDirty() ); // "false"
+ */
+ resetDirty : function()
+ {
+ if ( this.mayBeDirty )
+ this._.previousValue = this.getSnapshot();
+ },
+
+ /**
+ * Updates the <textarea>
element that was replaced by the editor with
+ * the current data available in the editor.
+ * @see CKEDITOR.editor.element
+ * @example
+ * CKEDITOR.instances.editor1.updateElement();
+ * alert( document.getElementById( 'editor1' ).value ); // The current editor data.
+ */
+ updateElement : function()
+ {
+ var element = this.element;
+ if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+ {
+ var data = this.getData();
+
+ if ( this.config.htmlEncodeOutput )
+ data = CKEDITOR.tools.htmlEncode( data );
+
+ if ( element.is( 'textarea' ) )
+ element.setValue( data );
+ else
+ element.setHtml( data );
+ }
+ }
+ });
+
+CKEDITOR.on( 'loaded', function()
+ {
+ // Run the full initialization for pending editors.
+ var pending = CKEDITOR.editor._pending;
+ if ( pending )
+ {
+ delete CKEDITOR.editor._pending;
+
+ for ( var i = 0 ; i < pending.length ; i++ )
+ pending[ i ]._init();
+ }
+ });
+
+/**
+ * Whether to escape HTML when the editor updates the original input element.
+ * @name CKEDITOR.config.htmlEncodeOutput
+ * @since 3.1
+ * @type Boolean
+ * @default false
+ * @example
+ * config.htmlEncodeOutput = true;
+ */
+
+/**
+ * If true
, makes the editor start in read-only state. Otherwise, it will check
+ * if the linked <textarea>
element has the disabled
attribute.
+ * @name CKEDITOR.config.readOnly
+ * @see CKEDITOR.editor#setReadOnly
+ * @type Boolean
+ * @default false
+ * @since 3.6
+ * @example
+ * config.readOnly = true;
+ */
+
+/**
+ * Fired when a CKEDITOR instance is created, but still before initializing it.
+ * To interact with a fully initialized instance, use the
+ * {@link CKEDITOR#instanceReady}
event instead.
+ * @name CKEDITOR#instanceCreated
+ * @event
+ * @param {CKEDITOR.editor} editor The editor instance that has been created.
+ */
+
+/**
+ * Fired when a CKEDITOR instance is destroyed.
+ * @name CKEDITOR#instanceDestroyed
+ * @event
+ * @param {CKEDITOR.editor} editor The editor instance that has been destroyed.
+ */
+
+/**
+ * Fired when the language is loaded into the editor instance.
+ * @name CKEDITOR.editor#langLoaded
+ * @event
+ * @since 3.6.1
+ * @param {CKEDITOR.editor} editor This editor instance.
+ */
+
+/**
+ * Fired when all plugins are loaded and initialized into the editor instance.
+ * @name CKEDITOR.editor#pluginsLoaded
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ */
+
+/**
+ * Fired before the command execution when {@link #execCommand}
is called.
+ * @name CKEDITOR.editor#beforeCommandExec
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.name The command name.
+ * @param {Object} data.commandData The data to be sent to the command. This
+ * can be manipulated by the event listener.
+ * @param {CKEDITOR.command} data.command The command itself.
+ */
+
+/**
+ * Fired after the command execution when {@link #execCommand}
is called.
+ * @name CKEDITOR.editor#afterCommandExec
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.name The command name.
+ * @param {Object} data.commandData The data sent to the command.
+ * @param {CKEDITOR.command} data.command The command itself.
+ * @param {Object} data.returnValue The value returned by the command execution.
+ */
+
+/**
+ * Fired when the custom configuration file is loaded, before the final
+ * configurations initialization.{@link CKEDITOR.config.customConfig}
setting. Several files can be loaded
+ * by changing this setting.
+ * @name CKEDITOR.editor#customConfigLoaded
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ */
+
+/**
+ * Fired once the editor configuration is ready (loaded and processed).
+ * @name CKEDITOR.editor#configLoaded
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ */
+
+/**
+ * Fired when this editor instance is destroyed. The editor at this
+ * point is not usable and this event should be used to perform the clean-up
+ * in any plugin.
+ * @name CKEDITOR.editor#destroy
+ * @event
+ */
+
+/**
+ * Internal event to get the current data.
+ * @name CKEDITOR.editor#beforeGetData
+ * @event
+ */
+
+/**
+ * Internal event to perform the #getSnapshot
call.
+ * @name CKEDITOR.editor#getSnapshot
+ * @event
+ */
+
+/**
+ * Internal event to perform the #loadSnapshot
call.
+ * @name CKEDITOR.editor#loadSnapshot
+ * @event
+ */
+
+/**
+ * Event fired before the #getData
call returns allowing additional manipulation.
+ * @name CKEDITOR.editor#getData
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.dataValue The data that will be returned.
+ */
+
+/**
+ * Event fired before the #setData
call is executed allowing additional manipulation.
+ * @name CKEDITOR.editor#setData
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.dataValue The data that will be used.
+ */
+
+/**
+ * Event fired at the end of the #setData
call execution. Usually it is better to use the
+ * {@link CKEDITOR.editor.prototype.dataReady}
event.
+ * @name CKEDITOR.editor#afterSetData
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.dataValue The data that has been set.
+ */
+
+/**
+ * Internal event to perform the #insertHtml
call
+ * @name CKEDITOR.editor#insertHtml
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data The HTML to insert.
+ */
+
+/**
+ * Internal event to perform the #insertText
call
+ * @name CKEDITOR.editor#insertText
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} text The text to insert.
+ */
+
+/**
+ * Internal event to perform the #insertElement
call
+ * @name CKEDITOR.editor#insertElement
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {Object} element The element to insert.
+ */
+
+/**
+ * Event fired after the {@link CKEDITOR.editor#readOnly}
property changes.
+ * @name CKEDITOR.editor#readOnly
+ * @event
+ * @since 3.6
+ * @param {CKEDITOR.editor} editor This editor instance.
+ */
diff --git a/phpgwapi/js/ckeditor3/_source/core/editor_basic.js b/phpgwapi/js/ckeditor3/_source/core/editor_basic.js
new file mode 100644
index 0000000000..8d109c82de
--- /dev/null
+++ b/phpgwapi/js/ckeditor3/_source/core/editor_basic.js
@@ -0,0 +1,186 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+if ( !CKEDITOR.editor )
+{
+ /**
+ * No element is linked to the editor instance.
+ * @constant
+ * @example
+ */
+ CKEDITOR.ELEMENT_MODE_NONE = 0;
+
+ /**
+ * The element is to be replaced by the editor instance.
+ * @constant
+ * @example
+ */
+ CKEDITOR.ELEMENT_MODE_REPLACE = 1;
+
+ /**
+ * The editor is to be created inside the element.
+ * @constant
+ * @example
+ */
+ CKEDITOR.ELEMENT_MODE_APPENDTO = 2;
+
+ /**
+ * Creates an editor class instance. This constructor should be rarely
+ * used, in favor of the {@link CKEDITOR} editor creation functions.
+ * @ class Represents an editor instance.
+ * @param {Object} instanceConfig Configuration values for this specific
+ * instance.
+ * @param {CKEDITOR.dom.element} [element] The element linked to this
+ * instance.
+ * @param {Number} [mode] The mode in which the element is linked to this
+ * instance. See {@link #elementMode}.
+ * @param {String} [data] Since 3.3. Initial value for the instance.
+ * @augments CKEDITOR.event
+ * @example
+ */
+ CKEDITOR.editor = function( instanceConfig, element, mode, data )
+ {
+ this._ =
+ {
+ // Save the config to be processed later by the full core code.
+ instanceConfig : instanceConfig,
+ element : element,
+ data : data
+ };
+
+ /**
+ * The mode in which the {@link #element} is linked to this editor
+ * instance. It can be any of the following values:
+ *