Ticket #4478: 4478.patch

File 4478.patch, 901 bytes (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/selection/plugin.js

     
    7272
    7373        var selectAllCmd =
    7474        {
     75                modes : { wysiwyg : 1, source : 1 },
    7576                exec : function( editor )
    7677                {
    7778                        switch ( editor.mode )
     
    8081                                        editor.document.$.execCommand( 'SelectAll', false, null );
    8182                                        break;
    8283                                case 'source' :
    83                                         // TODO
     84                                        // Select the contents of the textarea
     85                                        var textarea = editor.textarea.$ ;
     86                                        if ( CKEDITOR.env.ie )
     87                                        {
     88                                                textarea.createTextRange().execCommand( 'SelectAll' ) ;
     89                                        }
     90                                        else
     91                                        {
     92                                                textarea.selectionStart = 0 ;
     93                                                textarea.selectionEnd = textarea.value.length ;
     94                                        }
     95                                        textarea.focus() ;
    8496                        }
    8597                },
    8698                canUndo : false
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy