Ticket #2860: 2860.patch

File 2860.patch, 9.7 KB (added by Frederico Caldeira Knabben, 15 years ago)
  • _source/core/config.js

     
    146146         * @example
    147147         * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
    148148         */
    149         plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,removeformat,smiley,sourcearea,specialchar,tab,toolbar,wysiwygarea',
     149        plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,removeformat,smiley,sourcearea,specialchar,tab,toolbar,wysiwygarea',
    150150
    151151        /**
    152152         * The theme to be used to build the UI.
  • _source/core/dom/element.js

     
    259259                        return this.$.innerHTML;
    260260                },
    261261
     262                getOuterHtml : function()
     263                {
     264                        if ( this.$.outerHTML )
     265                                return this.$.outerHTML;
     266                       
     267                        var tmpDiv = this.$.ownerDocument.createElement( 'div' );
     268                        tmpDiv.appendChild( this.$.cloneNode( true ) );
     269                        return tmpDiv.innerHTML;
     270                },
     271
    262272                /**
    263273                 * Sets the inner HTML of this element.
    264274                 * @param {String} html The HTML to be set for this element.
     
    563573                        return $ ? new CKEDITOR.dom.node( $ ) : null;
    564574                },
    565575
     576                getStyle : function( name )
     577                {
     578                        return this.$.style[ CKEDITOR.tools.cssStyleToDomStyle( name ) ];
     579                },
     580
    566581                /**
    567582                 * Checks if the element name matches one or more names.
    568583                 * @param {String} name[,name[,...]] One or more names to be checked.
  • _source/core/dom/node.js

     
    416416                        }
    417417
    418418                        return this;
     419                },
     420
     421                replace : function( nodeToReplace )
     422                {
     423                        this.insertBefore( nodeToReplace );
     424                        nodeToReplace.remove();
    419425                }
    420426        }
    421427);
  • _source/core/editor.js

     
    264264                        delete this._.instanceConfig;
    265265
    266266                        this._.commands = {};
     267                        this._.styles = [];
    267268
    268269                        /**
    269270                         * The DOM element that has been replaced by this editor instance. This
     
    348349                        this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
    349350                },
    350351
     352                addCss : function( css )
     353                {
     354                        this._.styles.push( css );
     355                },
     356
    351357                /**
    352358                 * Destroys the editor instance, releasing all resources used by it.
    353359                 * If the editor replaced an element, the element will be recovered.
  • _source/core/htmlparser/element.js

     
    1313 */
    1414CKEDITOR.htmlParser.element = function( name, attributes )
    1515{
     16        if ( attributes._cke_saved_src )
     17                attributes.src = attributes._cke_saved_src;
     18
     19        if ( attributes._cke_saved_href )
     20                attributes.href = attributes._cke_saved_href;
     21
    1622        /**
    1723         * The element name.
    1824         * @type String
     
    97103                 */
    98104                writeHtml : function( writer )
    99105                {
     106                        var attributes = this.attributes;
     107                       
     108                        // The "_cke_realelement" attribute indicates that the current
     109                        // element is a placeholder for another element.
     110                        if ( attributes._cke_realelement )
     111                        {
     112                                var realFragment = new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( attributes._cke_realelement ) );
     113                                realFragment.writeHtml( writer );
     114                                return;
     115                        }
     116                       
     117                        // The "_cke_replacedata" indicates that this element is replacing
     118                        // a data snippet, which should be outputted as is.
     119                        if ( attributes._cke_replacedata )
     120                        {
     121                                writer.write( attributes._cke_replacedata );
     122                                return;
     123                        }
     124               
    100125                        // Open element tag.
    101126                        writer.openTag( this.name, this.attributes );
    102127
    103128                        // Copy all attributes to an array.
    104129                        var attribsArray = [];
    105                         for ( var a in this.attributes )
    106                                 attribsArray.push( [ a, this.attributes[ a ] ] );
     130                        for ( var a in attributes )
     131                        {
     132                                // Ignore all attributes starting with "_cke".
     133                                if ( !/^_cke/.test( a ) )
     134                                        attribsArray.push( [ a, this.attributes[ a ] ] );
     135                        }
    107136
    108137                        // Sort the attributes by name.
    109138                        attribsArray.sort( sortAttribs );
     
    112141                        for ( var i = 0, len = attribsArray.length ; i < len ; i++ )
    113142                        {
    114143                                var attrib = attribsArray[ i ];
    115                                 // IE's treated expand fields as dom attributes, skip it
    116                                 if ( CKEDITOR.env.ie && attrib === '_cke_expando' )
    117                                         continue;
    118144                                writer.attribute( attrib[0], attrib[1] );
    119145                        }
    120146
  • _source/plugins/htmlwriter/plugin.js

     
    225225        /**
    226226         * Writes the current indentation chars. It uses the
    227227         * {@link #indentationChars} property, repeating it for the current
    228          * intentation steps.
     228         * indentation steps.
    229229         * @example
    230230         * // Writes "\t" (e.g.).
    231231         * writer.indentation();
     
    237237        },
    238238
    239239        /**
     240         * Writes any kind of data to the ouput.
     241         * @example
     242         * writer.write( 'This is an &lt;b&gt;example&lt;/b&gt;.' );
     243         */
     244        write : function( data )
     245        {
     246                this._.output.push( data );
     247        },
     248
     249        /**
    240250         * Empties the current output buffer.
    241251         * @example
    242252         * writer.reset();
  • _source/plugins/toolbar/plugin.js

     
    211211                'Bold', 'Italic', 'Underline', 'Strike', '-',
    212212                'Subscript', 'Superscript', '-',
    213213                'SelectAll', 'RemoveFormat', '-',
    214                 'Smiley', 'HorizontalRule', 'SpecialChar'
     214                'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak'
    215215        ]
    216216];
  • _source/plugins/wysiwygarea/plugin.js

     
    4444        // #### protectEvents - END
    4545
    4646        // #### protectAttributes - START
     47       
     48        // TODO: Clean and simplify these regexes.
    4749        var protectUrlTagRegex = /<(?:a|area|img)(?=\s).*?\s(?:href|src)=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi,
    48                 protectUrlAttributeRegex = /\s(href|src)(\s*=\s*?('|")[\s\S]*?\3)/gi,
    49                 protectedUrlTagRegex = /<(?:a|area|img)(?=\s)(?:"[^"]*"|'[^']*'|[^<])*>/gi,
    50                 protectedAttributeRegex = /_cke_saved_/gi,
    51                 protectUrls = function( html )
    52                 {
    53                         return html.replace( protectUrlTagRegex, protectUrls_ReplaceTags );
    54                 },
    55                 protectUrls_ReplaceTags = function( tagMatch )
    56                 {
    57                         return tagMatch.replace( protectUrlAttributeRegex, '$& _cke_saved_$1$2');
    58                 },
    59                 protectUrlsRestore = function( html )
    60                 {
    61                         return html.replace( protectedUrlTagRegex, protectUrlsRestore_ReplaceTags );
    62                 },
    63                 protectUrlsRestore_ReplaceTags = function( tagMatch )
    64                 {
    65                         return tagMatch.replace( protectUrlAttributeRegex, '' ).replace( protectedAttributeRegex, '' );
    66                 };
     50                protectUrlAttributeRegex = /\s(href|src)(\s*=\s*?('|")[\s\S]*?\3)/gi;
     51       
     52        var protectUrls = function( html )
     53        {
     54                return html.replace( protectUrlTagRegex, protectUrls_ReplaceTags );
     55        };
     56
     57        var protectUrls_ReplaceTags = function( tagMatch )
     58        {
     59                return tagMatch.replace( protectUrlAttributeRegex, '$& _cke_saved_$1$2');
     60        };
     61
    6762        // #### protectAttributes - END
    6863
    6964        var onInsertHtml = function( evt )
     
    300295                                                                // Protect src or href attributes.
    301296                                                                data = protectUrls( data );
    302297
    303                                                                 // Replace tags with fake elements.
    304                                                                 if ( editor.fakeobjects )
    305                                                                         data = editor.fakeobjects.protectHtml( data );
    306 
    307298                                                                data =
    308299                                                                        editor.config.docType +
    309300                                                                        '<html dir="' + editor.config.contentsLangDirection + '">' +
    310301                                                                        '<head>' +
    311302                                                                                '<link href="' + editor.config.contentsCss + '" type="text/css" rel="stylesheet" _fcktemp="true"/>' +
     303                                                                                '<style type="text/css" _fcktemp="true">' +
     304                                                                                        editor._.styles.join( '\n' ) +
     305                                                                                '</style>'+
    312306                                                                        '</head>' +
    313307                                                                        '<body>' +
    314308                                                                                data +
     
    356350                                                                // Restore protected attributes.
    357351                                                                data = protectEventsRestore( data );
    358352
    359                                                                 // Restore protected URLs.
    360                                                                 data = protectUrlsRestore( data );
    361 
    362                                                                 // Restore fake elements.
    363                                                                 if ( editor.fakeobjects )
    364                                                                         data = editor.fakeobjects.restoreHtml( data );
    365 
    366353                                                                return data;
    367354                                                        },
    368355
  • contents.css

     
    1212        /* Remove the background color to make it transparent */
    1313        background-color: #fff;
    1414}
    15 
    16 /* The following declarations are to be removed from this file (#2786) */
    17 
    18 img.cke_fakeobject
    19 {
    20         background-position: center center;
    21         background-repeat: no-repeat;
    22         border: 1px solid #a9a9a9;
    23         width: 80px;
    24         height: 80px;
    25 }
    26 
    27 img.cke_fakeobject.flash
    28 {
    29         background-image: url(images/flashlogo.gif);
    30 }
    31 
    32 img.cke_fakeobject.object
    33 {
    34         background-image: url(images/plugin.gif);
    35 }
    36 
    37 img.cke_fakeobject.anchor
    38 {
    39         background-image: url(images/anchor.gif);
    40         width: 18px;
    41         height: 18px;
    42 }
    43 
    44 img.cke_fakeobject.pagebreak
    45 {
    46         background-image: url(images/pagebreak.gif);
    47         width: 100%;
    48         height: 7px;
    49 }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy