X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Flink%2Fdialogs%2Flink.js;h=204d8639913794a98ea05cd6a5c1955a93179301;hb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7;hp=4ac6766aefebf192ffe005607e54c648a0db3ce1;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git diff --git a/_source/plugins/link/dialogs/link.js b/_source/plugins/link/dialogs/link.js index 4ac6766..204d863 100644 --- a/_source/plugins/link/dialogs/link.js +++ b/_source/plugins/link/dialogs/link.js @@ -411,13 +411,13 @@ CKEDITOR.dialog.add( 'link', function( editor ) type : 'select', label : editor.lang.common.protocol, 'default' : 'http://', - style : 'width : 100%;', items : [ - [ 'http://' ], - [ 'https://' ], - [ 'ftp://' ], - [ 'news://' ], + // Force 'ltr' for protocol names in BIDI. (#5433) + [ 'http://\u200E', 'http://' ], + [ 'https://\u200E', 'https://' ], + [ 'ftp://\u200E', 'ftp://' ], + [ 'news://\u200E', 'news://' ], [ editor.lang.link.other , '' ] ], setup : function( data ) @@ -758,6 +758,7 @@ CKEDITOR.dialog.add( 'link', function( editor ) { if ( data.target ) this.setValue( data.target.type ); + targetChanged.call( this ); }, commit : function( data ) { @@ -1294,10 +1295,12 @@ CKEDITOR.dialog.add( 'link', function( editor ) { // Create element if current selection is collapsed. var selection = editor.getSelection(), - ranges = selection.getRanges(); + ranges = selection.getRanges( true ); if ( ranges.length == 1 && ranges[0].collapsed ) { - var text = new CKEDITOR.dom.text( attributes._cke_saved_href, editor.document ); + // Short mailto link text view (#5736). + var text = new CKEDITOR.dom.text( data.type == 'email' ? + data.email.address : attributes._cke_saved_href, editor.document ); ranges[0].insertNode( text ); ranges[0].selectNodeContents( text ); selection.selectRanges( ranges ); @@ -1348,9 +1351,13 @@ CKEDITOR.dialog.add( 'link', function( editor ) element.setAttributes( attributes ); element.removeAttributes( removeAttributes ); - // Update text view when user changes protocol #4612. - if (href == textView) - element.setHtml( attributes._cke_saved_href ); + // Update text view when user changes protocol (#4612). + if ( href == textView || data.type == 'email' && textView.indexOf( '@' ) != -1 ) + { + // Short mailto link text view (#5736). + element.setHtml( data.type == 'email' ? + data.email.address : attributes._cke_saved_href ); + } // Make the element display as an anchor if a name has been set. if ( element.getAttribute( 'name' ) ) element.addClass( 'cke_anchor' );