Changeset 645

Show
Ignore:
Timestamp:
2007-08-09 12:14:32 (3 years ago)
Author:
martinkou
Message:

Fixed JavaScript error in IE when the user is switching to and from Source mode.
Fixed #462 : Fixed the issue where Firefox freezes if it is fed HTML code missing an ending </body> tag in Source mode.

Location:
FCKeditor/trunk/editor/_source
Files:
3 modified

Legend:

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

    r626 r645  
    7575 
    7676                        // Extract the BODY contents from the html. 
    77                         var oMatch = html.match( FCKRegexLib.BodyContents ) ; 
    78  
    79                         if ( oMatch ) 
    80                         { 
     77                        var oMatchBefore = html.match( FCKRegexLib.BeforeBody ) ; 
     78                        var oMatchAfter = html.match( FCKRegexLib.AfterBody ) ; 
     79 
     80                        if ( oMatchBefore && oMatchAfter ) 
     81                        { 
     82                                var sBody = html.substr( oMatchBefore[1].length, 
     83                                               html.length - oMatchBefore[1].length - oMatchAfter[1].length ) ; // This is the BODY tag contents. 
     84 
    8185                                html = 
    82                                         oMatch[1] +                                     // This is the HTML until the <body...> tag, inclusive. 
     86                                        oMatchBefore[1] +                       // This is the HTML until the <body...> tag, inclusive. 
    8387                                        '&nbsp;' + 
    84                                         oMatch[3] ;                                     // This is the HTML from the </body> tag, inclusive. 
    85  
    86                                 var sBody = oMatch[2].Trim() ;  // This is the BODY tag contents. 
     88                                        oMatchAfter[1] ;                        // This is the HTML from the </body> tag, inclusive. 
    8789 
    8890                                // If nothing in the body, place a BOGUS tag so the cursor will appear. 
  • FCKeditor/trunk/editor/_source/internals/fckregexlib.js

    r302 r645  
    3333NamedCommands   : /^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i , 
    3434 
    35 BodyContents    : /([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i , 
     35BeforeBody      : /(^[\s\S]*\<body[^\>]*\>)/i, 
     36AfterBody       : /(\<\/body\>[\s\S]*$)/i, 
    3637 
    3738// Temporary text used to solve some browser specific limitations. 
  • FCKeditor/trunk/editor/_source/internals/fckundo.js

    r636 r645  
    9696FCKUndo._CheckIsBookmarksEqual = function( bookmark1, bookmark2 ) 
    9797{ 
     98        if ( ! ( bookmark1 && bookmark2 ) ) 
     99                return false ; 
    98100        if ( FCKBrowserInfo.IsIE ) 
    99101        {