Index: _source/core/config.js =================================================================== --- _source/core/config.js (revision 3025) +++ _source/core/config.js (working copy) @@ -146,7 +146,7 @@ * @example * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea'; */ - plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,removeformat,smiley,sourcearea,specialchar,tab,toolbar,wysiwygarea', + plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,removeformat,smiley,sourcearea,specialchar,tab,toolbar,wysiwygarea', /** * The theme to be used to build the UI. Index: _source/core/dom/element.js =================================================================== --- _source/core/dom/element.js (revision 3025) +++ _source/core/dom/element.js (working copy) @@ -259,6 +259,16 @@ return this.$.innerHTML; }, + getOuterHtml : function() + { + if ( this.$.outerHTML ) + return this.$.outerHTML; + + var tmpDiv = this.$.ownerDocument.createElement( 'div' ); + tmpDiv.appendChild( this.$.cloneNode( true ) ); + return tmpDiv.innerHTML; + }, + /** * Sets the inner HTML of this element. * @param {String} html The HTML to be set for this element. @@ -563,6 +573,11 @@ return $ ? new CKEDITOR.dom.node( $ ) : null; }, + getStyle : function( name ) + { + return this.$.style[ CKEDITOR.tools.cssStyleToDomStyle( name ) ]; + }, + /** * Checks if the element name matches one or more names. * @param {String} name[,name[,...]] One or more names to be checked. Index: _source/core/dom/node.js =================================================================== --- _source/core/dom/node.js (revision 3025) +++ _source/core/dom/node.js (working copy) @@ -416,6 +416,12 @@ } return this; + }, + + replace : function( nodeToReplace ) + { + this.insertBefore( nodeToReplace ); + nodeToReplace.remove(); } } ); Index: _source/core/editor.js =================================================================== --- _source/core/editor.js (revision 3025) +++ _source/core/editor.js (working copy) @@ -264,6 +264,7 @@ delete this._.instanceConfig; this._.commands = {}; + this._.styles = []; /** * The DOM element that has been replaced by this editor instance. This @@ -348,6 +349,11 @@ this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition ); }, + 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. Index: _source/core/htmlparser/element.js =================================================================== --- _source/core/htmlparser/element.js (revision 3025) +++ _source/core/htmlparser/element.js (working copy) @@ -13,6 +13,12 @@ */ CKEDITOR.htmlParser.element = function( name, attributes ) { + if ( attributes._cke_saved_src ) + attributes.src = attributes._cke_saved_src; + + if ( attributes._cke_saved_href ) + attributes.href = attributes._cke_saved_href; + /** * The element name. * @type String @@ -97,13 +103,36 @@ */ writeHtml : function( writer ) { + var attributes = this.attributes; + + // The "_cke_realelement" attribute indicates that the current + // element is a placeholder for another element. + if ( attributes._cke_realelement ) + { + var realFragment = new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( attributes._cke_realelement ) ); + realFragment.writeHtml( writer ); + return; + } + + // The "_cke_replacedata" indicates that this element is replacing + // a data snippet, which should be outputted as is. + if ( attributes._cke_replacedata ) + { + writer.write( attributes._cke_replacedata ); + return; + } + // Open element tag. writer.openTag( this.name, this.attributes ); // Copy all attributes to an array. var attribsArray = []; - for ( var a in this.attributes ) - attribsArray.push( [ a, this.attributes[ a ] ] ); + for ( var a in attributes ) + { + // Ignore all attributes starting with "_cke". + if ( !/^_cke/.test( a ) ) + attribsArray.push( [ a, this.attributes[ a ] ] ); + } // Sort the attributes by name. attribsArray.sort( sortAttribs ); @@ -112,9 +141,6 @@ for ( var i = 0, len = attribsArray.length ; i < len ; i++ ) { var attrib = attribsArray[ i ]; - // IE's treated expand fields as dom attributes, skip it - if ( CKEDITOR.env.ie && attrib === '_cke_expando' ) - continue; writer.attribute( attrib[0], attrib[1] ); } Index: _source/plugins/htmlwriter/plugin.js =================================================================== --- _source/plugins/htmlwriter/plugin.js (revision 3025) +++ _source/plugins/htmlwriter/plugin.js (working copy) @@ -225,7 +225,7 @@ /** * Writes the current indentation chars. It uses the * {@link #indentationChars} property, repeating it for the current - * intentation steps. + * indentation steps. * @example * // Writes "\t" (e.g.). * writer.indentation(); @@ -237,6 +237,16 @@ }, /** + * Writes any kind of data to the ouput. + * @example + * writer.write( 'This is an <b>example</b>.' ); + */ + write : function( data ) + { + this._.output.push( data ); + }, + + /** * Empties the current output buffer. * @example * writer.reset(); Index: _source/plugins/toolbar/plugin.js =================================================================== --- _source/plugins/toolbar/plugin.js (revision 3025) +++ _source/plugins/toolbar/plugin.js (working copy) @@ -211,6 +211,6 @@ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'SelectAll', 'RemoveFormat', '-', - 'Smiley', 'HorizontalRule', 'SpecialChar' + 'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak' ] ]; Index: _source/plugins/wysiwygarea/plugin.js =================================================================== --- _source/plugins/wysiwygarea/plugin.js (revision 3025) +++ _source/plugins/wysiwygarea/plugin.js (working copy) @@ -44,26 +44,21 @@ // #### protectEvents - END // #### protectAttributes - START + + // TODO: Clean and simplify these regexes. var protectUrlTagRegex = /<(?:a|area|img)(?=\s).*?\s(?:href|src)=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi, - protectUrlAttributeRegex = /\s(href|src)(\s*=\s*?('|")[\s\S]*?\3)/gi, - protectedUrlTagRegex = /<(?:a|area|img)(?=\s)(?:"[^"]*"|'[^']*'|[^<])*>/gi, - protectedAttributeRegex = /_cke_saved_/gi, - protectUrls = function( html ) - { - return html.replace( protectUrlTagRegex, protectUrls_ReplaceTags ); - }, - protectUrls_ReplaceTags = function( tagMatch ) - { - return tagMatch.replace( protectUrlAttributeRegex, '$& _cke_saved_$1$2'); - }, - protectUrlsRestore = function( html ) - { - return html.replace( protectedUrlTagRegex, protectUrlsRestore_ReplaceTags ); - }, - protectUrlsRestore_ReplaceTags = function( tagMatch ) - { - return tagMatch.replace( protectUrlAttributeRegex, '' ).replace( protectedAttributeRegex, '' ); - }; + protectUrlAttributeRegex = /\s(href|src)(\s*=\s*?('|")[\s\S]*?\3)/gi; + + var protectUrls = function( html ) + { + return html.replace( protectUrlTagRegex, protectUrls_ReplaceTags ); + }; + + var protectUrls_ReplaceTags = function( tagMatch ) + { + return tagMatch.replace( protectUrlAttributeRegex, '$& _cke_saved_$1$2'); + }; + // #### protectAttributes - END var onInsertHtml = function( evt ) @@ -300,15 +295,14 @@ // Protect src or href attributes. data = protectUrls( data ); - // Replace tags with fake elements. - if ( editor.fakeobjects ) - data = editor.fakeobjects.protectHtml( data ); - data = editor.config.docType + '' + '
' + '' + + ''+ '' + '' + data + @@ -356,13 +350,6 @@ // Restore protected attributes. data = protectEventsRestore( data ); - // Restore protected URLs. - data = protectUrlsRestore( data ); - - // Restore fake elements. - if ( editor.fakeobjects ) - data = editor.fakeobjects.restoreHtml( data ); - return data; }, Index: contents.css =================================================================== --- contents.css (revision 3025) +++ contents.css (working copy) @@ -12,38 +12,3 @@ /* Remove the background color to make it transparent */ background-color: #fff; } - -/* The following declarations are to be removed from this file (#2786) */ - -img.cke_fakeobject -{ - background-position: center center; - background-repeat: no-repeat; - border: 1px solid #a9a9a9; - width: 80px; - height: 80px; -} - -img.cke_fakeobject.flash -{ - background-image: url(images/flashlogo.gif); -} - -img.cke_fakeobject.object -{ - background-image: url(images/plugin.gif); -} - -img.cke_fakeobject.anchor -{ - background-image: url(images/anchor.gif); - width: 18px; - height: 18px; -} - -img.cke_fakeobject.pagebreak -{ - background-image: url(images/pagebreak.gif); - width: 100%; - height: 7px; -}