Changeset 172

Show
Ignore:
Timestamp:
2007-03-01 15:43:26 (3 years ago)
Author:
alfonsoml
Message:

New fix for #118, make SelectAll work in source mode

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

Legend:

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

    r152 r172  
    251251        } 
    252252} 
    253  
    254 // Select the contents of the editing area 
    255 FCKEditingArea.prototype.SelectAll = function() 
    256 { 
    257                 if ( this.Mode == FCK_EDITMODE_WYSIWYG ) 
    258                 { 
    259                         FCK.ExecuteNamedCommand( 'SelectAll' ) ; 
    260                 } 
    261                 else 
    262                 { 
    263                         // Select the contents of the textarea 
    264                         var textarea = this.Textarea ; 
    265                         if ( FCKBrowserInfo.IsIE ) 
    266                         { 
    267         var range = textarea.createTextRange() ; 
    268         range.collapse( true ) ; 
    269         range.moveEnd( 'character', textarea.value.length ) ; 
    270         range.moveStart( 'character', 0 ) ; 
    271         range.select() ; 
    272                         } 
    273                         else 
    274                         { 
    275                                 textarea.selectionStart = 0; 
    276                                 textarea.selectionEnd = textarea.value.length ; 
    277                         } 
    278                         textarea.focus() ; 
    279                 } 
    280  
    281 } 
  • FCKeditor/trunk/editor/_source/commandclasses/fck_othercommands.js

    r152 r172  
    333333FCKSelectAllCommand.prototype.Execute = function() 
    334334{ 
    335         FCK.EditingArea.SelectAll() ; 
     335        if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) 
     336        { 
     337                FCK.ExecuteNamedCommand( 'SelectAll' ) ; 
     338        } 
     339        else 
     340        { 
     341                // Select the contents of the textarea 
     342                var textarea = FCK.EditingArea.Textarea ; 
     343                if ( FCKBrowserInfo.IsIE ) 
     344                { 
     345                        textarea.createTextRange().execCommand( 'SelectAll' ) ; 
     346                } 
     347                else 
     348                { 
     349                        textarea.selectionStart = 0; 
     350                        textarea.selectionEnd = textarea.value.length ; 
     351                } 
     352                textarea.focus() ; 
     353        } 
    336354} 
    337355