JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.3.2
[ckeditor.git] / _source / plugins / link / dialogs / link.js
index 4ac6766..3b05df2 100644 (file)
@@ -411,13 +411,13 @@ CKEDITOR.dialog.add( 'link', function( editor )
                                                                                type : 'select',\r
                                                                                label : editor.lang.common.protocol,\r
                                                                                'default' : 'http://',\r
-                                                                               style : 'width : 100%;',\r
                                                                                items :\r
                                                                                [\r
-                                                                                       [ 'http://' ],\r
-                                                                                       [ 'https://' ],\r
-                                                                                       [ 'ftp://' ],\r
-                                                                                       [ 'news://' ],\r
+                                                                                       // Force 'ltr' for protocol names in BIDI. (#5433)\r
+                                                                                       [ 'http://\u200E', 'http://' ],\r
+                                                                                       [ 'https://\u200E', 'https://' ],\r
+                                                                                       [ 'ftp://\u200E', 'ftp://' ],\r
+                                                                                       [ 'news://\u200E', 'news://' ],\r
                                                                                        [ editor.lang.link.other , '' ]\r
                                                                                ],\r
                                                                                setup : function( data )\r
@@ -1297,7 +1297,9 @@ CKEDITOR.dialog.add( 'link', function( editor )
                                        ranges = selection.getRanges();\r
                                if ( ranges.length == 1 && ranges[0].collapsed )\r
                                {\r
-                                       var text = new CKEDITOR.dom.text( attributes._cke_saved_href, editor.document );\r
+                                       // Short mailto link text view (#5736).\r
+                                       var text = new CKEDITOR.dom.text( data.type == 'email' ?\r
+                                                       data.email.address : attributes._cke_saved_href, editor.document );\r
                                        ranges[0].insertNode( text );\r
                                        ranges[0].selectNodeContents( text );\r
                                        selection.selectRanges( ranges );\r
@@ -1348,9 +1350,13 @@ CKEDITOR.dialog.add( 'link', function( editor )
 \r
                                element.setAttributes( attributes );\r
                                element.removeAttributes( removeAttributes );\r
-                               // Update text view when user changes protocol #4612.\r
-                               if (href == textView)\r
-                                       element.setHtml( attributes._cke_saved_href );\r
+                               // Update text view when user changes protocol (#4612).\r
+                               if ( href == textView || data.type == 'email' && textView.indexOf( '@' ) != -1 )\r
+                               {\r
+                                       // Short mailto link text view (#5736).\r
+                                       element.setHtml( data.type == 'email' ?\r
+                                               data.email.address : attributes._cke_saved_href );\r
+                               }\r
                                // Make the element display as an anchor if a name has been set.\r
                                if ( element.getAttribute( 'name' ) )\r
                                        element.addClass( 'cke_anchor' );\r