Changeset 36483
- Timestamp:
- 02/06/2016 12:50:31 AM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r36384 r36483 1044 1044 'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar 1045 1045 'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar 1046 'Paste URL or type to search' => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog 1046 1047 1047 1048 // Shortcuts help modal -
trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js
r36384 r36483 33 33 } 34 34 35 // If nothing's left (maybe the URL was just a fragment), use the whole URL. 36 if ( url === '' ) { 37 url = this.url; 38 } 39 35 40 // If the URL is longer that 40 chars, concatenate the beginning (after the domain) and ending with ... 36 41 if ( url.length > 40 && ( index = url.indexOf( '/' ) ) !== -1 && ( lastIndex = url.lastIndexOf( '/' ) ) !== -1 && lastIndex !== index ) { … … 52 57 return ( 53 58 '<div id="' + this._id + '" class="wp-link-input">' + 54 '<input type="text" value="" tabindex="-1" />' +59 '<input type="text" value="" tabindex="-1" placeholder="' + tinymce.translate('Paste URL or type to search') + '" />' + 55 60 '</div>' 56 61 ); … … 69 74 var $ = window.jQuery; 70 75 76 function getSelectedLink() { 77 var href, 78 selectedNode = editor.selection.getNode(), 79 selectedText = editor.selection.getContent(), 80 link = editor.dom.getParent( selectedNode, 'a[href]' ); 81 82 if ( ! link && selectedText.indexOf( '</a>' ) !== -1 ) { 83 href = selectedText.match( /href="([^">]+)"/ ); 84 85 if ( href && href[1] ) { 86 link = editor.$( 'a[href="' + href[1] + '"]', selectedNode )[0]; 87 } 88 89 if ( link ) { 90 editor.selection.select( link ); 91 editor.nodeChanged(); 92 } 93 } 94 95 return link; 96 } 97 71 98 editor.on( 'preinit', function() { 72 99 if ( editor.wp && editor.wp._createToolbar ) { … … 84 111 85 112 editToolbar.on( 'show', function() { 86 var node = editToolbar.find( 'toolbar' )[0]; 87 node && node.focus( true ); 88 a = editor.dom.getParent( editor.selection.getNode(), 'a' ); 113 var inputNode = editToolbar.find( 'toolbar' )[0]; 114 115 inputNode && inputNode.focus( true ); 116 a = getSelectedLink(); 89 117 } ); 90 118 … … 96 124 97 125 editor.addCommand( 'WP_Link', function() { 98 var a = editor.dom.getParent( editor.selection.getNode(), 'a');99 100 if ( a) {101 editor.dom.setAttribs( a, { 'data-wp-edit': true } );126 var link = getSelectedLink(); 127 128 if ( link ) { 129 editor.dom.setAttribs( link, { 'data-wp-edit': true } ); 102 130 } else { 103 131 editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder' } ); 104 } 105 106 editor.nodeChanged(); 132 editor.nodeChanged(); 133 } 107 134 } ); 108 135 -
trunk/src/wp-includes/version.php
r36352 r36483 19 19 * @global string $tinymce_version 20 20 */ 21 $tinymce_version = '4303-20160 119';21 $tinymce_version = '4303-20160205'; 22 22 23 23 /**
Note: See TracChangeset
for help on using the changeset viewer.