Ticket #7154: 7154.patch
File 7154.patch, 3.6 KB (added by , 13 years ago) |
---|
-
_source/plugins/dialog/plugin.js
2751 2751 */ 2752 2752 isEnabled : function() 2753 2753 { 2754 return !this.get InputElement().getAttribute( 'disabled' );2754 return !this.getElement().getAttribute( 'disabled' ); 2755 2755 }, 2756 2756 2757 2757 /** -
_source/lang/en.js
66 66 { 67 67 browseServer : 'Browse Server', 68 68 url : 'URL', 69 displayTxt : 'Display Text', 69 70 protocol : 'Protocol', 70 71 upload : 'Upload', 71 72 uploadSubmit : 'Send it to the Server', … … 191 192 emailBody : 'Message Body', 192 193 noAnchors : '(No anchors available in the document)', 193 194 noUrl : 'Please type the link URL', 194 noEmail : 'Please type the e-mail address' 195 noEmail : 'Please type the e-mail address', 196 linkTextFromSelection : '<< Selection in Document>>' 195 197 }, 196 198 197 199 // Anchor dialog -
_source/plugins/link/dialogs/link.js
379 379 title : linkLang.info, 380 380 elements : 381 381 [ 382 // Text to display, only available when link is text-only. 382 383 { 384 type : 'text', 385 id : 'linkTxt', 386 label : commonLang.displayTxt, 387 setup : function() 388 { 389 this.enable(); 390 391 // Load existed link if it's text-only. 392 var editLink = this._.dialog._.selectedElement; 393 if ( editLink ) 394 { 395 var innerHtml = editLink.getHtml(), 396 innerText = editLink.getText(); 397 398 if ( innerHtml == innerText ) 399 { 400 this.setValue( innerText ); 401 return; 402 } 403 } 404 405 // Collapsed selection indicate we're creating a new link. 406 if ( editor.getSelection().getRanges()[ 0 ].collapsed ) 407 return; 408 409 this.setValue( linkLang.linkTextFromSelection ); 410 this.disable(); 411 }, 412 commit : function( data ) 413 { 414 data.linkText = this.isEnabled() ? this.getValue() : ''; 415 } 416 }, 417 { 383 418 id : 'linkType', 384 419 type : 'select', 385 420 label : linkLang.type, … … 1314 1349 if ( ranges.length == 1 && ranges[0].collapsed ) 1315 1350 { 1316 1351 // Short mailto link text view (#5736). 1317 var text = new CKEDITOR.dom.text( data. type == 'email' ?1318 data.email.address : attributes[ 'data-cke-saved-href' ] , editor.document );1352 var text = new CKEDITOR.dom.text( data.linkText || ( data.type == 'email' ? 1353 data.email.address : attributes[ 'data-cke-saved-href' ] ), editor.document ); 1319 1354 ranges[0].insertNode( text ); 1320 1355 ranges[0].selectNodeContents( text ); 1321 1356 selection.selectRanges( ranges ); … … 1339 1374 if ( data.adv && data.adv.advName && CKEDITOR.plugins.link.synAnchorSelector ) 1340 1375 element.addClass( element.getChildCount() ? 'cke_anchor' : 'cke_anchor_empty' ); 1341 1376 1342 // Update text view when user changes protocol (#4612). 1343 if ( href == textView || data.type == 'email' && textView.indexOf( '@' ) != -1 ) 1344 { 1345 // Short mailto link text view (#5736). 1346 element.setHtml( data.type == 'email' ? 1347 data.email.address : attributes[ 'data-cke-saved-href' ] ); 1348 } 1377 data.linkText && element.setHtml( data.linkText ); 1349 1378 1350 1379 delete this._.selectedElement; 1351 1380 }