Ticket #4612: 4612.patch
File 4612.patch, 2.8 KB (added by , 13 years ago) |
---|
-
_source/lang/en.js
128 128 targetParent : 'Parent Window (_parent)', 129 129 targetFrameName : 'Target Frame Name', 130 130 targetPopupName : 'Popup Window Name', 131 textView : 'Text View', 131 132 popupFeatures : 'Popup Window Features', 132 133 popupResizable : 'Resizable', 133 134 popupStatusBar : 'Status Bar', -
_source/plugins/link/dialogs/link.js
88 88 emailMatch, 89 89 anchorMatch, 90 90 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 93 114 if ( ( anchorMatch = href.match( anchorRegex ) ) ) 94 115 { 95 116 retval.type = 'anchor'; … … 390 411 children : 391 412 [ 392 413 { 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 { 393 429 type : 'hbox', 394 430 widths : [ '25%', '75%' ], 395 431 children : … … 1288 1324 ranges = selection.getRanges(); 1289 1325 if ( ranges.length == 1 && ranges[0].collapsed ) 1290 1326 { 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 ); 1292 1328 ranges[0].insertNode( text ); 1293 1329 ranges[0].selectNodeContents( text ); 1294 1330 selection.selectRanges( ranges ); … … 1346 1382 1347 1383 if ( this.fakeObj ) 1348 1384 editor.createFakeElement( element, 'cke_anchor', 'anchor' ).replace( this.fakeObj ); 1349 1385 1386 // Set selected text. 1387 element.setHtml( data.text ); 1388 1350 1389 delete this._.selectedElement; 1351 1390 } 1352 1391 },