Ignore:
Timestamp:
2009-12-09 17:16:43 (2 years ago)
Author:
fredck
Message:

#4067 : Introduced the full page editing support. Merged the features/fullpage branch.

Location:
CKEditor/branches/versions/3.1.x
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • CKEditor/branches/versions/3.1.x

  • CKEditor/branches/versions/3.1.x/CHANGES.html

    r4626 r4636  
    4949                <li><a href="http://dev.fckeditor.net/ticket/4340">#4340</a> : Added the email protection option for link dialog.</li> 
    5050                <li><a href="http://dev.fckeditor.net/ticket/4210">#4210</a> : Added CKEditor plugin for jQuery.</li> 
     51                <li><a href="http://dev.fckeditor.net/ticket/4067">#4067</a> : Introduced the full page editing support (from &lt;html&gt; to &lt;/html&gt;).</li> 
    5152        </ul> 
    5253        <p> 
  • CKEditor/branches/versions/3.1.x/_samples/index.html

    r4623 r4636  
    1919                <li><a href="replacebyclass.html">Replace textareas by class name</a></li> 
    2020                <li><a href="replacebycode.html">Replace textareas by code</a></li> 
     21                <li><a href="fullpage.html">Full page support (editing from &lt;html&gt; to &lt;/html&gt;)</a></li> 
    2122        </ul> 
    2223        <h2> 
  • CKEditor/branches/versions/3.1.x/_source/core/config.js

    r4587 r4636  
    168168 
    169169        /** 
     170         * Sets the 'id' attribute to be used on body if it doesn't have one. 
     171         * @type String 
     172         * @default '' 
     173         */ 
     174        bodyId : '', 
     175 
     176        /** 
     177         * Sets the 'class' attribute to be used on body if it doesn't have one.   
     178         * @type String 
     179         * @default '' 
     180         */ 
     181        bodyClass : '', 
     182 
     183        /** 
    170184         * Indicates whether the contents to be edited are being inputted as a full 
    171185         * HTML page. A full page includes the &lt;html&gt;, &lt;head&gt; and 
  • CKEditor/branches/versions/3.1.x/_source/core/dom/element.js

    r4555 r4636  
    329329                getHtml : function() 
    330330                { 
    331                         return this.$.innerHTML; 
     331                        var retval = this.$.innerHTML; 
     332                        // Strip <?xml:namespace> tags in IE. (#3341). 
     333                        return CKEDITOR.env.ie ? retval.replace( /<\?[^>]*>/g, '' ) : retval; 
    332334                }, 
    333335 
  • CKEditor/branches/versions/3.1.x/_source/core/dtd.js

    r4578 r4636  
    3333CKEDITOR.dtd = (function() 
    3434{ 
    35     var X = CKEDITOR.tools.extend, 
     35        var X = CKEDITOR.tools.extend, 
    3636 
    3737                A = {isindex:1,fieldset:1}, 
     
    5252                O = X({param:1},K), 
    5353                P = X({form:1},A,D,E,I), 
    54                 Q = {li:1}; 
     54                Q = {li:1}, 
     55                R = {style:1,script:1}, 
     56                S = {base:1,link:1,meta:1,title:1}, 
     57                T = X(S,R), 
     58                U = {head:1,body:1}, 
     59                V = {html:1}; 
    5560 
    5661        var block = {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}; 
    5762 
    58     return /** @lends CKEDITOR.dtd */ { 
     63        return /** @lends CKEDITOR.dtd */ { 
    5964 
    6065                // The "$" items have been added manually. 
    6166 
     67                // List of elements living outside body. 
     68                $nonBodyContent: X(V,U,S), 
     69 
    6270                /** 
    6371                 * List of block elements, like "p" or "div". 
     
    7482                $blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1 }, 
    7583 
    76                 $body : X({script:1}, block), 
     84                $body : X({script:1,style:1}, block), 
    7785 
    7886                $cdata : {script:1,style:1}, 
     
    128136                $tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}, 
    129137 
     138        html: U, 
     139        head: T, 
     140        style: N, 
     141        script: N, 
     142        body: P, 
     143        base: {}, 
     144        link: {}, 
     145        meta: {}, 
     146        title: N, 
    130147        col : {}, 
    131148        tr : {td:1,th:1}, 
  • CKEditor/branches/versions/3.1.x/_source/core/htmlparser/basicwriter.js

    r3308 r4636  
    118118                { 
    119119                        this._.output = []; 
     120                        this._.indent = false; 
    120121                }, 
    121122 
  • CKEditor/branches/versions/3.1.x/_source/core/htmlparser/cdata.js

    r3712 r4636  
    2020                 */ 
    2121                this.value = value; 
    22  
    2322        }; 
    2423 
  • CKEditor/branches/versions/3.1.x/_source/core/htmlparser/element.js

    r4556 r4636  
    3838 
    3939        var dtd                 = CKEDITOR.dtd, 
    40                 isBlockLike     = !!( dtd.$block[ tagName ] || dtd.$listItem[ tagName ] || dtd.$tableContent[ tagName ] || dtd.$nonEditable[ tagName ] || tagName == 'br' ), 
     40                isBlockLike     = !!( dtd.$nonBodyContent[ tagName ] || dtd.$block[ tagName ] || dtd.$listItem[ tagName ] || dtd.$tableContent[ tagName ] || dtd.$nonEditable[ tagName ] || tagName == 'br' ), 
    4141                isEmpty         = !!dtd.$empty[ name ]; 
    4242 
  • CKEditor/branches/versions/3.1.x/_source/core/htmlparser/fragment.js

    r4625 r4636  
    115115                                else 
    116116                                        elementName =  element.name; 
    117                                 if ( !( elementName in CKEDITOR.dtd.$body ) ) 
     117                                if ( elementName 
     118                                                && !( elementName in CKEDITOR.dtd.$body ) 
     119                                                && !( elementName in CKEDITOR.dtd.$nonBodyContent )  ) 
    118120                                { 
    119121                                        var savedCurrent = currentNode; 
     
    180182                        } 
    181183 
    182                         var currentName = currentNode.name, 
    183                                 currentDtd = ( currentName && CKEDITOR.dtd[ currentName ] ) || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ); 
     184                        var currentName = currentNode.name; 
     185 
     186                        var currentDtd = currentName 
     187                                && ( CKEDITOR.dtd[ currentName ] 
     188                                        || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) ); 
    184189 
    185190                        // If the element cannot be child of the current element. 
    186                         if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] ) 
    187                         { 
    188                                 // If this is the fragment node, just ignore this tag and add 
    189                                 // its children. 
    190                                 if ( !currentName ) 
    191                                         return; 
     191                        if ( currentDtd   // Fragment could receive any elements. 
     192                                 && !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] ) 
     193                        { 
    192194 
    193195                                var reApply = false, 
     
    315317                                        currentNode = currentNode.parent; 
    316318                        } 
     319 
     320                        if( tagName == 'body' ) 
     321                                fixForBody = false; 
    317322                }; 
    318323 
     
    330335                        checkPending(); 
    331336 
    332                         if ( fixForBody && !currentNode.type ) 
     337                        if ( fixForBody 
     338                                 && ( !currentNode.type || currentNode.name == 'body' ) 
     339                                 && CKEDITOR.tools.trim( text ) ) 
     340                        { 
    333341                                this.onTagOpen( fixForBody, {} ); 
     342                        } 
    334343 
    335344                        // Shrinking consequential spaces into one single for all elements 
     
    360369                                node = currentNode; 
    361370 
    362                         if ( fixForBody && !parent.type && !CKEDITOR.dtd.$body[ node.name ] ) 
     371                        if ( fixForBody 
     372                                 && ( !parent.type || parent.name == 'body' ) 
     373                                 && !CKEDITOR.dtd.$body[ node.name ] ) 
    363374                        { 
    364375                                currentNode = parent; 
  • CKEditor/branches/versions/3.1.x/_source/plugins/htmldataprocessor/plugin.js

    r4556 r4636  
    110110 
    111111                                // All "_cke" attributes are to be ignored. 
    112                                 [ ( /^_cke.*/ ), '' ] 
     112                                [ ( /^_cke.*/ ), '' ], 
     113 
     114                                [ 'hidefocus', '' ] 
    113115                        ], 
    114116 
     
    117119                                $ : function( element ) 
    118120                                { 
    119                                         // Remove duplicated attributes - #3789. 
    120121                                        var attribs = element.attributes; 
    121122 
    122123                                        if ( attribs ) 
    123124                                        { 
     125                                                // Elements marked as temporary are to be ignored. 
     126                                                if ( attribs.cke_temp ) 
     127                                                        return false; 
     128 
     129                                                // Remove duplicated attributes - #3789. 
    124130                                                var attributeNames = [ 'name', 'href', 'src' ], 
    125131                                                        savedAttributeName; 
     
    130136                                                } 
    131137                                        } 
     138 
     139                                        return element; 
    132140                                }, 
    133141 
     
    163171                                                return false; 
    164172                                        } 
     173                                }, 
     174 
     175                                body : function( element ) 
     176                                { 
     177                                        delete element.attributes.spellcheck; 
     178                                        delete element.attributes.contenteditable; 
     179                                }, 
     180 
     181                                style : function( element ) 
     182                                { 
     183                                        var child = element.children[ 0 ]; 
     184                                        child && child.value && ( child.value = CKEDITOR.tools.trim( child.value )); 
     185 
     186                                        if ( !element.attributes.type ) 
     187                                                element.attributes.type = 'text/css'; 
    165188                                } 
    166189                        }, 
     
    210233        var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi; 
    211234 
     235        var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi, 
     236                encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi; 
     237 
     238        var protectElementNamesRegex = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi, 
     239                unprotectElementNamesRegex = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi; 
     240 
     241        var protectSelfClosingRegex = /<cke:(param|embed)([\s\S]*?)\/?>/gi; 
     242 
    212243        function protectAttributes( html ) 
    213244        { 
     
    215246        } 
    216247 
    217         var protectStyleTagsRegex = /<(style)(?=[ >])[^>]*>[^<]*<\/\1>/gi; 
    218         var encodedTagsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi; 
    219         var protectElementNamesRegex = /(<\/?)((?:object|embed|param)[\s\S]*?>)/gi; 
    220         var protectSelfClosingRegex = /<cke:(param|embed)([\s\S]*?)\/?>/gi; 
    221  
    222         function protectStyleTagsMatch( match ) 
    223         { 
    224                 return '<cke:encoded>' + encodeURIComponent( match ) + '</cke:encoded>'; 
    225         } 
    226  
    227         function protectStyleTags( html ) 
    228         { 
    229                 return html.replace( protectStyleTagsRegex, protectStyleTagsMatch ); 
    230         } 
     248        function protectElements( html ) 
     249        { 
     250                return html.replace( protectElementsRegex, function( match ) 
     251                        { 
     252                                return '<cke:encoded>' + encodeURIComponent( match ) + '</cke:encoded>'; 
     253                        }); 
     254        } 
     255 
     256        function unprotectElements( html ) 
     257        { 
     258                return html.replace( encodedElementsRegex, function( match, encoded ) 
     259                        { 
     260                                return decodeURIComponent( encoded ); 
     261                        }); 
     262        } 
     263 
    231264        function protectElementsNames( html ) 
    232265        { 
    233266                return html.replace( protectElementNamesRegex, '$1cke:$2'); 
    234267        } 
     268 
     269        function unprotectElementNames( html ) 
     270        { 
     271                return html.replace( unprotectElementNamesRegex, '$1$2' ); 
     272        } 
     273 
    235274        function protectSelfClosingElements( html ) 
    236275        { 
    237276                return html.replace( protectSelfClosingRegex, '<cke:$1$2></cke:$1>' ); 
    238         } 
    239  
    240         function unprotectEncodedTagsMatch( match, encoded ) 
    241         { 
    242                 return decodeURIComponent( encoded ); 
    243         } 
    244  
    245         function unprotectEncodedTags( html ) 
    246         { 
    247                 return html.replace( encodedTagsRegex, unprotectEncodedTagsMatch ); 
    248         } 
    249  
    250         function unprotectRealComments( html ) 
    251         { 
    252                 return html.replace( /<!--{cke_protected}{C}([\s\S]+?)-->/g, function( match, data ) 
    253                         { 
    254                                 return decodeURIComponent( data ); 
    255                         }); 
    256277        } 
    257278 
     
    264285                                                encodeURIComponent( match ).replace( /--/g, '%2D%2D' ) + 
    265286                                                '-->'; 
     287                        }); 
     288        } 
     289 
     290        function unprotectRealComments( html ) 
     291        { 
     292                return html.replace( /<!--{cke_protected}{C}([\s\S]+?)-->/g, function( match, data ) 
     293                        { 
     294                                return decodeURIComponent( data ); 
    266295                        }); 
    267296        } 
     
    356385                        data = protectAttributes( data ); 
    357386 
    358                         // IE remvoes style tags from innerHTML. (#3710). 
    359                         if ( CKEDITOR.env.ie ) 
    360                                 data = protectStyleTags( data ); 
     387                        // Protect elements than can't be set inside a DIV. E.g. IE removes 
     388                        // style tags from innerHTML. (#3710) 
     389                        data = protectElements( data ); 
    361390 
    362391                        // Certain elements has problem to go through DOM operation, protect 
    363                         // them by prefixing 'cke' namespace.(#3591) 
     392                        // them by prefixing 'cke' namespace. (#3591) 
    364393                        data = protectElementsNames( data ); 
    365394 
    366395                        // All none-IE browsers ignore self-closed custom elements, 
    367                         // protecting them into open-close.(#3591) 
     396                        // protecting them into open-close. (#3591) 
    368397                        data = protectSelfClosingElements( data ); 
    369398 
    370399                        // Call the browser to help us fixing a possibly invalid HTML 
    371400                        // structure. 
    372                         var div = document.createElement( 'div' ); 
     401                        var div = new CKEDITOR.dom.element( 'div' ); 
    373402                        // Add fake character to workaround IE comments bug. (#3801) 
    374                         div.innerHTML = 'a' + data; 
    375                         data = div.innerHTML.substr( 1 ); 
    376  
    377                         if ( CKEDITOR.env.ie ) 
    378                                 data = unprotectEncodedTags( data ); 
     403                        div.setHtml( 'a' + data ); 
     404                        data = div.getHtml().substr( 1 ); 
     405 
     406                        // Unprotect "some" of the protected elements at this point. 
     407                        data = unprotectElementNames( data ); 
     408 
     409                        data = unprotectElements( data ); 
    379410 
    380411                        // Restore the comments that have been protected, in this way they 
  • CKEditor/branches/versions/3.1.x/_source/plugins/htmlwriter/plugin.js

    r3676 r4636  
    6868                var dtd = CKEDITOR.dtd; 
    6969 
    70                 for ( var e in CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) 
     70                for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) 
    7171                { 
    7272                        this.setRules( e, 
     
    7979                                }); 
    8080                } 
     81 
    8182                this.setRules( 'br', 
    8283                        { 
    8384                                breakAfterOpen : true 
    8485                        }); 
     86 
     87                this.setRules( 'title', 
     88                        { 
     89                                indent : false, 
     90                                breakAfterOpen : false 
     91                        }); 
     92 
     93                this.setRules( 'style', 
     94                        { 
     95                                indent : false, 
     96                                breakBeforeClose : true 
     97                        }); 
     98 
    8599                // Disable indentation on <pre>. 
    86100                this.setRules( 'pre', 
    87                 { 
    88                   indent: false 
    89                 } ); 
     101                        { 
     102                          indent: false 
     103                        }); 
    90104        }, 
    91105 
     
    263277                 * </ul> 
    264278                 * 
    265                  * All rules default to "false". 
     279                 * All rules default to "false". Each call to the function overrides 
     280                 * already present rules, leaving the undefined untouched. 
    266281                 * 
    267282                 * By default, all elements available in the {@link CKEDITOR.dtd.$block), 
     
    284299                setRules : function( tagName, rules ) 
    285300                { 
    286                         this._.rules[ tagName ] = rules; 
     301                        var currentRules = this._.rules[ tagName ]; 
     302                         
     303                        if ( currentRules ) 
     304                                CKEDITOR.tools.extend( currentRules, rules, true ); 
     305                        else 
     306                                this._.rules[ tagName ] = rules; 
    287307                } 
    288308        } 
  • CKEditor/branches/versions/3.1.x/_source/plugins/preview/plugin.js

    r4621 r4636  
    1717                { 
    1818                        var sHTML, 
     19                                config = editor.config, 
     20                                baseTag = config.baseHref ? '<base href="' + config.baseHref + '"/>' : '', 
    1921                                isCustomDomain = CKEDITOR.env.isCustomDomain(); 
    20                         if ( editor.config.fullPage ) 
    21                                 sHTML = editor.getData(); 
     22 
     23                        if ( config.fullPage ) 
     24                        { 
     25                                sHTML = editor.getData() 
     26                                                .replace( /<head>/, '$&' + baseTag ) 
     27                                                .replace( /[^>]*(?=<\/title>)/, editor.lang.preview ); 
     28                        } 
    2229                        else 
    2330                        { 
    2431                                var bodyHtml = '<body ', 
    25                                         body = CKEDITOR.document.getBody(), 
    26                                         baseTag = ( editor.config.baseHref.length > 0 ) ? '<base href="' + editor.config.baseHref + '" _cktemp="true"></base>' : ''; 
     32                                                body = editor.document.getBody(); 
    2733 
    2834                                if ( body.getAttribute( 'id' ) ) 
  • CKEditor/branches/versions/3.1.x/_source/plugins/wysiwygarea/plugin.js

    r4621 r4636  
    1111(function() 
    1212{ 
    13         /** 
    14          * List of elements in which has no way to move editing focus outside. 
    15          */ 
     13        // List of elements in which has no way to move editing focus outside. 
    1614        var nonExitableElementNames = { table:1,pre:1 }; 
     15 
    1716        // Matching an empty paragraph at the end of document. 
    18         var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)\s*(:?<\/\1>)?\s*$/gi; 
     17        var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi; 
    1918 
    2019        function onInsertHtml( evt ) 
     
    583582                                                                isLoadingData = true; 
    584583 
     584                                                                var config = editor.config, 
     585                                                                        fullPage = config.fullPage, 
     586                                                                        docType = config.docType; 
     587 
     588                                                                // Build the additional stuff to be included into <head>. 
     589                                                                var headExtra = 
     590                                                                        '<style type="text/css" cke_temp="1">' + 
     591                                                                                editor._.styles.join( '\n' ) + 
     592                                                                        '</style>'; 
     593 
     594                                                                !fullPage && ( headExtra = 
     595                                                                        CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + 
     596                                                                        headExtra ); 
     597 
     598                                                                var baseTag = config.baseHref ? '<base href="' + config.baseHref + '" cke_temp="1" />' : ''; 
     599 
     600                                                                if ( fullPage ) 
     601                                                                { 
     602                                                                        // Search and sweep out the doctype declaration. 
     603                                                                        data = data.replace( /<!DOCTYPE[^>]*>/i, function( match ) 
     604                                                                                { 
     605                                                                                        editor.docType = docType = match; 
     606                                                                                        return ''; 
     607                                                                                }); 
     608                                                                } 
     609 
    585610                                                                // Get the HTML version of the data. 
    586611                                                                if ( editor.dataProcessor ) 
    587                                                                 { 
    588612                                                                        data = editor.dataProcessor.toHtml( data, fixForBody ); 
    589                                                                 } 
    590  
    591                                                                 data = 
    592                                                                         editor.config.docType + 
    593                                                                         '<html dir="' + editor.config.contentsLangDirection + '">' + 
    594                                                                         '<head>' + 
    595                                                                                 CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + 
    596                                                                                 '<style type="text/css" _fcktemp="true">' + 
    597                                                                                         editor._.styles.join( '\n' ) + 
    598                                                                                 '</style>'+ 
    599                                                                         '</head>' + 
    600                                                                         '<body>' + 
    601                                                                                 data + 
    602                                                                         '</body>' + 
    603                                                                         '</html>' + 
    604                                                                         activationScript; 
     613 
     614                                                                if ( fullPage ) 
     615                                                                { 
     616                                                                        // Check if the <body> tag is available. 
     617                                                                        if ( !(/<body[\s|>]/).test( data ) ) 
     618                                                                                data = '<body>' + data; 
     619 
     620                                                                        // Check if the <html> tag is available. 
     621                                                                        if ( !(/<html[\s|>]/).test( data ) ) 
     622                                                                                data = '<html>' + data + '</html>'; 
     623 
     624                                                                        // Check if the <head> tag is available. 
     625                                                                        if ( !(/<head[\s|>]/).test( data ) ) 
     626                                                                                data = data.replace( /<html[^>]*>/, '$&<head><title></title></head>' ) ; 
     627 
     628                                                                        // The base must be the first tag in the HEAD, e.g. to get relative 
     629                                                                        // links on styles. 
     630                                                                        baseTag && ( data = data.replace( /<head>/, '$&' + baseTag ) ); 
     631 
     632                                                                        // Inject the extra stuff into <head>. 
     633                                                                        // Attention: do not change it before testing it well. (V2) 
     634                                                                        // This is tricky... if the head ends with <meta ... content type>, 
     635                                                                        // Firefox will break. But, it works if we place our extra stuff as 
     636                                                                        // the last elements in the HEAD. 
     637                                                                        data = data.replace( /<\/head\s*>/, headExtra + '$&' ); 
     638 
     639                                                                        // Add the DOCTYPE back to it. 
     640                                                                        data = docType + data; 
     641                                                                } 
     642                                                                else 
     643                                                                { 
     644                                                                        data = 
     645                                                                                config.docType + 
     646                                                                                '<html dir="' + config.contentsLangDirection + '">' + 
     647                                                                                '<head>' + 
     648                                                                                        baseTag + 
     649                                                                                        headExtra + 
     650                                                                                '</head>' + 
     651                                                                                '<body' + ( config.bodyId ? ' id="' + config.bodyId + '"' : '' ) + 
     652                                                                                                  ( config.bodyClass ? ' class="' + config.bodyClass + '"' : '' ) + 
     653                                                                                                  '>' + 
     654                                                                                        data + 
     655                                                                                '</html>'; 
     656                                                                } 
     657                                                                 
     658                                                                data += activationScript; 
    605659 
    606660                                                                CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady; 
     
    610664                                                        getData : function() 
    611665                                                        { 
    612                                                                 var data = iframe.getFrameDocument().getBody().getHtml(); 
     666                                                                var config = editor.config, 
     667                                                                        fullPage = config.fullPage, 
     668                                                                        docType = fullPage && editor.docType, 
     669                                                                        doc = iframe.getFrameDocument(); 
     670                                                                 
     671                                                                var data = fullPage 
     672                                                                        ? doc.getDocumentElement().getOuterHtml() 
     673                                                                        : doc.getBody().getHtml(); 
    613674 
    614675                                                                if ( editor.dataProcessor ) 
     
    616677 
    617678                                                                // Strip the last blank paragraph within document. 
    618                                                                 if ( editor.config.ignoreEmptyParagraph ) 
     679                                                                if ( config.ignoreEmptyParagraph ) 
    619680                                                                        data = data.replace( emptyParagraphRegexp, '' ); 
     681 
     682                                                                if ( docType ) 
     683                                                                        data = docType + '\n' + data; 
    620684 
    621685                                                                return data; 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy