Ticket #4612: 4612.patch

File 4612.patch, 2.8 KB (added by Minh Nguyen, 14 years ago)
  • _source/lang/en.js

     
    128128                targetParent    : 'Parent Window (_parent)',
    129129                targetFrameName : 'Target Frame Name',
    130130                targetPopupName : 'Popup Window Name',
     131                textView                : 'Text View',
    131132                popupFeatures   : 'Popup Window Features',
    132133                popupResizable  : 'Resizable',
    133134                popupStatusBar  : 'Status Bar',
  • _source/plugins/link/dialogs/link.js

     
    8888                        emailMatch,
    8989                        anchorMatch,
    9090                        urlMatch,
    91                         retval = {};
    92 
     91                        retval = {},
     92                        selectedText = '';
     93               
     94                var selection = editor.getSelection();
     95                // Get selection.
     96                if ( selection )
     97                {
     98                        var bookmarks = selection.createBookmarks(),
     99                        range = selection.getRanges()[ 0 ],
     100                        fragment = range.clone().cloneContents();
     101                        selection.selectBookmarks( bookmarks );
     102                        var  childList = fragment.getChildren(),
     103                                childCount = childList.count();
     104                        for ( var i = 0; i < childCount; i++ )
     105                        {
     106                                var child = childList.getItem( i );
     107                                selectedText += ( child.getOuterHtml?
     108                                child.getOuterHtml() : child.getText() );
     109                        }
     110                }
     111                // Store selected text.
     112                retval.text = element ? element.getText() : selectedText ? selectedText : '';
     113               
    93114                if ( ( anchorMatch = href.match( anchorRegex ) ) )
    94115                {
    95116                        retval.type = 'anchor';
     
    390411                                                children :
    391412                                                [
    392413                                                        {
     414                                                                id : 'textView',
     415                                                                type : 'text',
     416                                                                label : editor.lang.link.textView,
     417                                                                setup : function ( data )
     418                                                                {
     419                                                                        if ( data.text )
     420                                                                                this.setValue( data.text || '' );
     421                                                                       
     422                                                                },
     423                                                                commit : function ( data )
     424                                                                {
     425                                                                        data.text = this.getValue() || this.getDialog().getContentElement( 'info', 'url' ).getValue() || '';
     426                                                                }
     427                                                        },
     428                                                        {
    393429                                                                type : 'hbox',
    394430                                                                widths : [ '25%', '75%' ],
    395431                                                                children :
     
    12881324                                        ranges = selection.getRanges();
    12891325                                if ( ranges.length == 1 && ranges[0].collapsed )
    12901326                                {
    1291                                         var text = new CKEDITOR.dom.text( attributes._cke_saved_href, editor.document );
     1327                                        var text = new CKEDITOR.dom.text( data.text || attributes._cke_saved_href, editor.document );
    12921328                                        ranges[0].insertNode( text );
    12931329                                        ranges[0].selectNodeContents( text );
    12941330                                        selection.selectRanges( ranges );
     
    13461382
    13471383                                if ( this.fakeObj )
    13481384                                        editor.createFakeElement( element, 'cke_anchor', 'anchor' ).replace( this.fakeObj );
    1349 
     1385                               
     1386                                // Set selected text.
     1387                                element.setHtml( data.text );
     1388                               
    13501389                                delete this._.selectedElement;
    13511390                        }
    13521391                },
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy