Changeset 451

Show
Ignore:
Timestamp:
2007-07-15 20:01:27 (17 months ago)
Author:
alfonsoml
Message:

Fix for #931. The settings for the body element now are controled in FCKConfig.

Location:
FCKeditor/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckdataprocessor.js

    r302 r451  
    8080                                html += ' style="overflow-y: scroll"' ; 
    8181 
    82                         html += '><head><title></title></head><body' ; 
    83  
    84                         // Add id and class to the body. 
    85                         if ( FCKConfig.BodyId.length > 0 ) 
    86                                 html += ' id="' + FCKConfig.BodyId + '"' ; 
    87                         if ( FCKConfig.BodyClass.length > 0 ) 
    88                                 html += ' class="' + FCKConfig.BodyClass + '"' ; 
    89  
    90                         html += 
    91                                 '>' + 
     82                        html += '><head><title></title></head>' + 
     83                                '<body' + FCKConfig.GetBodyAttributes() + '>' + 
    9284                                data + 
    9385                                '</body></html>' ; 
  • FCKeditor/trunk/editor/_source/classes/fcktoolbarfontformatcombo.js

    r411 r451  
    5353 
    5454        // Add ID and Class to the body 
    55         if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 ) 
    56                 oTargetDoc.body.id = FCKConfig.BodyId ; 
    57         if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 ) 
    58                 oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ; 
     55        FCKConfig.ApplyBodyAttributes( oTargetDoc.body ) ; 
    5956 
    6057        // Get the format names from the language file. 
  • FCKeditor/trunk/editor/_source/classes/fcktoolbarstylecombo.js

    r411 r451  
    5050 
    5151        // Add ID and Class to the body 
    52         if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 ) 
    53                 oTargetDoc.body.id = FCKConfig.BodyId ; 
    54         if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 ) 
    55                 oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ; 
    56  
     52        FCKConfig.ApplyBodyAttributes( oTargetDoc.body ) ; 
    5753 
    5854        // For some reason Gecko is blocking inside the "RefreshVisibleItems" function. 
  • FCKeditor/trunk/editor/_source/internals/fckconfig.js

    r421 r451  
    209209        return html.replace( /(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g, _Replace ) ; 
    210210} 
     211 
     212// Returns a string with the attributes that must be appended to the body 
     213FCKConfig.GetBodyAttributes = function() 
     214{ 
     215        var bodyAttributes = '' ; 
     216        // Add id and class to the body. 
     217        if ( this.BodyId && this.BodyId.length > 0 ) 
     218                bodyAttributes += ' id="' + this.BodyId + '"' ; 
     219        if ( this.BodyClass && this.BodyClass.length > 0 ) 
     220                bodyAttributes += ' class="' + this.BodyClass + '"' ; 
     221 
     222        return bodyAttributes ; 
     223} 
     224 
     225// Sets the body attributes directly on the node 
     226FCKConfig.ApplyBodyAttributes = function( oBody ) 
     227{ 
     228        // Add ID and Class to the body 
     229        if ( this.BodyId && this.BodyId.length > 0 ) 
     230                oBody.id = FCKConfig.BodyId ; 
     231        if ( this.BodyClass && this.BodyClass.length > 0 ) 
     232                oBody.className += ' ' + FCKConfig.BodyClass ; 
     233} 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r438 r451  
    517517                                '<title>' + FCKLang.Preview + '</title>' + 
    518518                                _FCK_GetEditorAreaStyleTags() + 
    519                                 '</head><body>' + 
     519                                '</head><body' + FCKConfig.GetBodyAttributes() + '>' + 
    520520                                FCK.GetXHTML() + 
    521521                                '</body></html>' ; 
  • FCKeditor/trunk/_testcases/010.html

    r450 r451  
    4949                FCKeditor - Test 010</h1> 
    5050        <p> 
    51                 <strong>Expected results</strong>: The editor content must be loaded and the the 
     51                <strong>Expected results</strong>: The editor content must be loaded and the 
    5252                user must be able to change the toolbar dinamically (without reloading the page).<br /> 
    5353                <strong>Configurations</strong>: Default<br /> 
  • FCKeditor/trunk/_whatsnew.html

    r447 r451  
    118118                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/299">#299</a>] The 'Browse Server' button in the Image 
    119119                        and Flash dialogs was a little too high.</li> 
     120                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/931">#931</a>] The BodyId and BodyClass configuration  
     121                        settings weren't applied in the preview window.</li> 
    120122        </ul> 
    121123        <h3>