Index: src/wp-admin/includes/ajax-actions.php
===================================================================
--- src/wp-admin/includes/ajax-actions.php	(revision 36371)
+++ src/wp-admin/includes/ajax-actions.php	(working copy)
@@ -1477,8 +1477,14 @@
 
 	$args = array();
 
-	if ( isset( $_POST['search'] ) )
+	if ( isset( $_POST['search'] ) ) {
 		$args['s'] = wp_unslash( $_POST['search'] );
+	}
+
+	if ( isset( $_POST['term'] ) ) {
+		$args['s'] = wp_unslash( $_POST['term'] );
+	}
+
 	$args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
 
 	require(ABSPATH . WPINC . '/class-wp-editor.php');
Index: src/wp-includes/class-wp-editor.php
===================================================================
--- src/wp-includes/class-wp-editor.php	(revision 36371)
+++ src/wp-includes/class-wp-editor.php	(working copy)
@@ -779,6 +779,7 @@
 
 		if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) {
 			wp_enqueue_script('wplink');
+			wp_enqueue_script( 'jquery-ui-autocomplete' );
 		}
 
 		if ( self::$old_dfw_compat ) {
Index: src/wp-includes/css/editor.css
===================================================================
--- src/wp-includes/css/editor.css	(revision 36371)
+++ src/wp-includes/css/editor.css	(working copy)
@@ -1709,6 +1709,10 @@
 	}
 }
 
+div.wp-link-preview input {
+	width: 300px;
+}
+
 /* =Overlay Body
 -------------------------------------------------------------- */
 
Index: src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
===================================================================
--- src/wp-includes/js/tinymce/plugins/wordpress/plugin.js	(revision 36371)
+++ src/wp-includes/js/tinymce/plugins/wordpress/plugin.js	(working copy)
@@ -744,7 +744,10 @@
 					top, left;
 
 				if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) {
-					return this.hide();
+					this.scrolling = true;
+					this.hide();
+					this.scrolling = false;
+					return this;
 				}
 
 				// Add offset in iOS to move the menu over the image, out of the way of the default iOS menu.
@@ -850,13 +853,17 @@
 
 			currentSelection = args.selection || args.element;
 
-			if ( activeToolbar ) {
+			if ( activeToolbar && activeToolbar !== args.toolbar ) {
 				activeToolbar.hide();
 			}
 
 			if ( args.toolbar ) {
-				activeToolbar = args.toolbar;
-				activeToolbar.show();
+				if ( activeToolbar !== args.toolbar ) {
+					activeToolbar = args.toolbar;
+					activeToolbar.show();
+				} else {
+					activeToolbar.reposition();
+				}
 			} else {
 				activeToolbar = false;
 			}
@@ -870,18 +877,21 @@
 
 		function hide( event ) {
 			if ( activeToolbar ) {
-				activeToolbar.hide();
-
 				if ( event.type === 'hide' ) {
+					activeToolbar.hide();
 					activeToolbar = false;
 				} else if ( event.type === 'resize' || event.type === 'scroll' ) {
 					clearTimeout( timeout );
 
 					timeout = setTimeout( function() {
 						if ( activeToolbar && typeof activeToolbar.show === 'function' ) {
+							activeToolbar.scrolling = false;
 							activeToolbar.show();
 						}
 					}, 250 );
+
+					activeToolbar.scrolling = true;
+					activeToolbar.hide();
 				}
 			}
 		}
Index: src/wp-includes/js/tinymce/plugins/wplink/plugin.js
===================================================================
--- src/wp-includes/js/tinymce/plugins/wplink/plugin.js	(revision 36371)
+++ src/wp-includes/js/tinymce/plugins/wplink/plugin.js	(working copy)
@@ -47,11 +47,46 @@
 		}
 	} );
 
+	tinymce.ui.WPLinkInput = tinymce.ui.Control.extend( {
+		renderHtml: function() {
+			return (
+				'<div id="' + this._id + '" class="wp-link-preview">' +
+					'<input type="text" value="" tabindex="-1" />' +
+				'</div>'
+			);
+		},
+		setURL: function( url ) {
+			this.getEl().firstChild.value = url;
+		}
+	} );
+
 	tinymce.PluginManager.add( 'wplink', function( editor ) {
-		var toolbar;
+		var toolbar, editToolbar;
+
+		editor.on( 'preinit', function() {
+			if ( editor.wp && editor.wp._createToolbar ) {
+				toolbar = editor.wp._createToolbar( [
+					'wp_link_preview',
+					'wp_link_edit',
+					'wp_link_remove'
+				], true );
+
+				editToolbar = editor.wp._createToolbar( [
+					'wp_link_input'
+				], true );
+			}
+		} );
 
 		editor.addCommand( 'WP_Link', function() {
-			window.wpLink && window.wpLink.open( editor.id );
+			var a = editor.dom.getParent( editor.selection.getNode(), 'a' );
+
+			if ( a ) {
+				editor.dom.setAttribs( a, { 'data-wp-edit': true } );
+			} else {
+				editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder' } );
+			}
+
+			editor.nodeChanged();
 		});
 
 		// WP default shortcut
@@ -99,30 +134,126 @@
 			}
 		} );
 
+		var previewInstance, inputInstance;
+
 		editor.addButton( 'wp_link_preview', {
 			type: 'WPLinkPreview',
 			onPostRender: function() {
-				var self = this;
+				previewInstance = this;
+			}
+		} );
+
+		editor.addButton( 'wp_link_input', {
+			type: 'WPLinkInput',
+			onPostRender: function() {
+				var input = this.getEl().firstChild;
+				var cache;
+				var last;
+
+				inputInstance = this;
+
+				jQuery( input ).autocomplete( {
+					source: function( request, response ) {
+						if ( last === request.term ) {
+							response( cache );
+							return;
+						}
+
+						if ( /^https?:/.test( request.term ) || request.term.indexOf( '.' ) !== -1 ) {
+							return response();
+						}
+
+						jQuery.post( ajaxurl, {
+							action: 'wp-link-ajax',
+							page: 1,
+							search: request.term,
+							_ajax_linking_nonce: jQuery( '#_ajax_linking_nonce' ).val()
+						}, function( data ) {
+							cache = data;
+							response( data );
+						}, 'json' );
+
+						last = request.term;
+					},
+					select: function( event, ui ) {
+						jQuery( input ).val( ui.item.permalink );
+						return false;
+					},
+					minLength: 2
+				} ).autocomplete( 'instance' )._renderItem = function( ul, item ) {
+					return jQuery( '<li>' )
+						.append( '<span>' + item.title + '</span><span>' + item.info + '</span>' )
+						.appendTo( ul );
+				};
+
+				jQuery( input ).on( 'focus', function() {
+					jQuery( input ).autocomplete( 'search' );
+				} );
 
-				editor.on( 'wptoolbar', function( event ) {
-					var anchor = editor.dom.getParent( event.element, 'a' ),
-						$anchor,
-						href;
-
-					if ( anchor ) {
-						$anchor = editor.$( anchor );
-						href = $anchor.attr( 'href' );
-
-						if ( href && ! $anchor.find( 'img' ).length ) {
-							self.setURL( href );
-							event.element = anchor;
-							event.toolbar = toolbar;
+				editor.on( 'init', function() {
+					var a;
+
+					tinymce.$( input ).on( 'keydown', function( event ) {
+						event.keyCode === 13 && editToolbar.hide();
+					} );
+
+					editToolbar.on( 'show', function() {
+						a = editor.dom.getParent( editor.selection.getNode(), 'a' );
+						node = editToolbar.find( 'toolbar' )[0];
+						node && node.focus( true );
+					} );
+
+					editToolbar.on( 'hide', function(event) {
+						if ( editToolbar.scrolling ) {
+							return;
+						}
+
+						href = tinymce.trim( input.value );
+
+						if ( href && ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( href ) ) {
+							href = 'http://' + href;
 						}
-					}
+
+						if ( ! href ) {
+							editor.dom.remove( a, true );
+							return;
+						}
+
+						if ( a ) {
+							editor.dom.setAttribs( a, { href: href, 'data-wp-edit': null } );
+						}
+
+						a = false;
+
+						editor.nodeChanged();
+						editor.focus();
+					} );
 				} );
 			}
 		} );
 
+		editor.on( 'wptoolbar', function( event ) {
+			var anchor = editor.dom.getParent( event.element, 'a' ),
+				$anchor,
+				href, edit, node;
+
+			if ( anchor ) {
+				$anchor = editor.$( anchor );
+				href = $anchor.attr( 'href' );
+				edit = $anchor.attr( 'data-wp-edit' );
+
+				if ( href === '_wp_link_placeholder' || edit ) {
+					inputInstance.setURL( edit ? href : '' );
+					event.element = anchor;
+					event.toolbar = editToolbar;
+				} else if ( href && ! $anchor.find( 'img' ).length ) {
+					previewInstance.setURL( href );
+					event.element = anchor;
+					event.toolbar = toolbar;
+				}
+			}
+		} );
+
 		editor.addButton( 'wp_link_edit', {
 			tooltip: 'Edit ', // trailing space is needed, used for context
 			icon: 'dashicon dashicons-edit',
@@ -134,15 +265,5 @@
 			icon: 'dashicon dashicons-no',
 			cmd: 'unlink'
 		} );
-
-		editor.on( 'preinit', function() {
-			if ( editor.wp && editor.wp._createToolbar ) {
-				toolbar = editor.wp._createToolbar( [
-					'wp_link_preview',
-					'wp_link_edit',
-					'wp_link_remove'
-				], true );
-			}
-		} );
 	} );
 } )( window.tinymce );
