Index: src/wp-includes/class-wp-editor.php
===================================================================
--- src/wp-includes/class-wp-editor.php	(revision 27490)
+++ src/wp-includes/class-wp-editor.php	(working copy)
@@ -241,7 +241,6 @@
 						'wpeditimage',
 						'wpgallery',
 						'wplink',
-						'wpdialogs',
 						'wpview',
 					) ) );
 
@@ -492,8 +491,6 @@
 
 		if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) {
 			wp_enqueue_script('wplink');
-			wp_enqueue_script('wpdialogs');
-			wp_enqueue_style('wp-jquery-ui-dialog');
 		}
 
 		if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) )
@@ -1041,58 +1038,64 @@
 	 * @since 3.1.0
 	 */
 	public static function wp_link_dialog() {
-	?>
-	<div style="display:none;">
-	<form id="wp-link" tabindex="-1">
-	<?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
-	<div id="link-selector">
-		<div id="link-options">
-			<p class="howto"><?php _e( 'Enter the destination URL' ); ?></p>
-			<div>
-				<label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" name="href" /></label>
-			</div>
-			<div>
-				<label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" name="linktitle" /></label>
-			</div>
-			<div class="link-target">
-				<label><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
-			</div>
-		</div>
-		<?php $show_internal = '1' == get_user_setting( 'wplink', '0' ); ?>
-		<p class="howto toggle-arrow <?php if ( $show_internal ) echo 'toggle-arrow-active'; ?>" id="internal-toggle"><?php _e( 'Or link to existing content' ); ?></p>
-		<div id="search-panel"<?php if ( ! $show_internal ) echo ' style="display:none"'; ?>>
-			<div class="link-search-wrapper">
-				<label>
-					<span class="search-label"><?php _e( 'Search' ); ?></span>
-					<input type="search" id="search-field" class="link-search-field" autocomplete="off" />
-					<span class="spinner"></span>
-				</label>
-			</div>
-			<div id="search-results" class="query-results">
-				<ul></ul>
-				<div class="river-waiting">
-					<span class="spinner"></span>
+		$search_panel_visible = '1' == get_user_setting( 'wplink', '0' ) ? ' class="search-panel-visible"' : '';
+
+		?>
+		<div id="wp-link-backdrop"></div>
+		<div id="wp-link-wrap"<?php echo $search_panel_visible; ?>>
+		<form id="wp-link" tabindex="-1">
+		<?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
+		<div id="link-modal-title">
+			<?php _e( 'Insert/edit link' ) ?>
+			<div id="wp-link-close" tabindex="0"></div>
+	 	</div>
+		<div id="link-selector">
+			<div id="link-options">
+				<p class="howto"><?php _e( 'Enter the destination URL' ); ?></p>
+				<div>
+					<label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" name="href" /></label>
+				</div>
+				<div>
+					<label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" name="linktitle" /></label>
+				</div>
+				<div class="link-target">
+					<label><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
 				</div>
 			</div>
-			<div id="most-recent-results" class="query-results">
-				<div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div>
-				<ul></ul>
-				<div class="river-waiting">
-					<span class="spinner"></span>
+			<p class="howto" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></p>
+			<div id="search-panel">
+				<div class="link-search-wrapper">
+					<label>
+						<span class="search-label"><?php _e( 'Search' ); ?></span>
+						<input type="search" id="search-field" class="link-search-field" autocomplete="off" />
+						<span class="spinner"></span>
+					</label>
+				</div>
+				<div id="search-results" class="query-results">
+					<ul></ul>
+					<div class="river-waiting">
+						<span class="spinner"></span>
+					</div>
+				</div>
+				<div id="most-recent-results" class="query-results">
+					<div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div>
+					<ul></ul>
+					<div class="river-waiting">
+						<span class="spinner"></span>
+					</div>
 				</div>
 			</div>
 		</div>
-	</div>
-	<div class="submitbox">
-		<div id="wp-link-update">
-			<input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button-primary" id="wp-link-submit" name="wp-link-submit">
+		<div class="submitbox">
+			<div id="wp-link-update">
+				<input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button-primary" id="wp-link-submit" name="wp-link-submit">
+			</div>
+			<div id="wp-link-cancel">
+				<a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>
+			</div>
 		</div>
-		<div id="wp-link-cancel">
-			<a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>
+		</form>
 		</div>
-	</div>
-	</form>
-	</div>
-	<?php
+		<?php
 	}
 }
Index: src/wp-includes/css/buttons.css
===================================================================
--- src/wp-includes/css/buttons.css	(revision 27490)
+++ src/wp-includes/css/buttons.css	(working copy)
@@ -1,5 +1,10 @@
 /* ----------------------------------------------------------------------------
 
+NOTE: If you edit this file, you should make sure that the CSS rules for
+buttons in the following files are updated.
+
+* jquery-ui-dialog.css
+* editor.css
 
 WordPress-style Buttons
 =======================
Index: src/wp-includes/css/editor.css
===================================================================
--- src/wp-includes/css/editor.css	(revision 27490)
+++ src/wp-includes/css/editor.css	(working copy)
@@ -313,6 +313,8 @@
 	text-align: center;
 	color: #fff;
 	text-shadow: none;
+	padding: 0;
+	line-height: 26px;
 }
 
 .mce-window .mce-btn {
@@ -335,6 +337,14 @@
 	background-image: none;
 }
 
+/* Remove the dotted border on :focus and the extra padding in Firefox */
+.mce-window .mce-btn::-moz-focus-inner {
+	border-width: 1px 0;
+	border-style: solid none;
+	border-color: transparent;
+	padding: 0;
+}
+
 .mce-window .mce-btn:hover {
 	background: #fafafa;
 	border-color: #999;
@@ -366,16 +376,17 @@
 .mce-window .mce-btn.mce-primary {
 	background: #2ea2cc;
 	border-color: #0074a2;
- 	-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15);
- 	box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15);
- 	color: #fff;
+	-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15);
+	box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15);
+	color: #fff;
+	text-decoration: none;
 }
 
 .mce-window .mce-btn.mce-primary:hover {
 	background: #1e8cbe;
 	border-color: #0074a2;
- 	-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
- 	box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
+	-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
+	box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
 	color: #fff;
 }
 
@@ -389,8 +400,8 @@
 	background: #1b7aa6;
 	border-color: #005684;
 	color: rgba(255,255,255,0.95);
- 	-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
- 	box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
+	-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
+	box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
 }
 
 .mce-window .mce-btn.mce-primary.mce-disabled {
@@ -400,6 +411,17 @@
 	text-shadow: 0 -1px 0 rgba(0,0,0,0.1);
 }
 
+@media screen and ( max-width: 782px ) {
+	.mce-window .mce-btn {
+		padding: 10px 14px;
+		line-height: 1;
+		font-size: 14px;
+		vertical-align: middle;
+		height: auto;
+		margin-bottom: 4px;
+	}
+}
+
 /* Charmap modal */
 .mce-charmap {
 	margin: 3px;
@@ -864,10 +886,91 @@
  wp-link
 ------------------------------------------------------------------------------*/
 
+#wp-link-wrap {
+	display: none;
+	background-color: #fff;
+	width: 600px;
+	overflow: hidden;
+	margin-left: -300px;
+	position: fixed;
+	top: 30px;
+	left: 50%;
+	z-index: 100105;
+}
+
+#wp-link-backdrop {
+	display: none;
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	min-height: 360px;
+	background: #000;
+	opacity: 0.7;
+	z-index: 100100;
+}
+
 #wp-link {
-	background-color: #F5F5F5;
-	line-height: 1.4em;
-	font-size: 12px;
+	position: relative;
+	height: 100%;
+}
+
+#wp-link-wrap.search-panel-visible {
+	bottom: 30px;
+}
+
+#link-modal-title {
+	background: #fcfcfc;
+	border-bottom: 1px solid #dfdfdf;
+	height: 42px;
+	font-size: 22px;
+	font-weight: 600;
+	line-height: 41px;
+	padding: 0 42px 0 16px;
+	top: 0;
+	right: 0;
+	left: 0;
+}
+
+#wp-link-close {
+	color: #666;
+	cursor: pointer;
+	padding: 0;
+	position: absolute;
+	top: 0;
+	right: 0;
+	width: 42px;
+	height: 42px;
+	text-align: center;
+}
+
+#wp-link-close:before {
+	font: normal 20px/42px 'dashicons';
+	vertical-align: top;
+	speak: none;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+	width: 42px;
+	height: 42px;
+	content: '\f158';
+}
+
+#wp-link-close:hover {
+	color: #2ea2cc;
+}
+
+#link-selector {
+	padding: 0 16px 52px;
+}
+
+#wp-link-wrap.search-panel-visible #link-selector {
+	padding: 0 16px;
+	position: absolute;
+	top: 42px;
+	left: 0;
+	right: 0;
+	bottom: 44px;
 }
 
 #wp-link ol,
@@ -877,52 +980,41 @@
 	padding: 0;
 }
 
+#wp-link-search-toggle::after {
+	font: normal 20px/1 'dashicons';
+	vertical-align: top;
+	speak: none;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+	content: '\f140';
+}
+
+.search-panel-visible #wp-link-search-toggle::after {
+	content: '\f142';
+}
+
 #wp-link input[type="text"] {
 	-webkit-box-sizing: border-box;
 	-moz-box-sizing: border-box;
 	box-sizing: border-box;
 }
 
-#wp-link input[type="text"],
-#wp-link textarea {
-	border-width: 1px;
-	border-style: solid;
-	-webkit-border-radius: 4px;
-	border-radius: 4px;
-	font-size: 12px;
-	margin: 1px;
-	padding: 3px;
-}
-
 #wp-link #link-options {
 	padding: 10px 0 14px;
-	border-bottom: 1px solid #dfdfdf;
-	margin: 0 6px 14px;
 }
 
 #wp-link p.howto {
-	margin: 3px;
+	margin: 3px 0;
 }
 
-#wp-link #internal-toggle {
-	display: inline-block;
+#wp-link-search-toggle {
 	cursor: pointer;
-	padding-left: 18px;
-}
-
-#wp-link .toggle-arrow {
-	background: transparent url(../images/toggle-arrow.png) top left no-repeat;
-	height: 23px;
-	line-height: 23px;
-}
-
-#wp-link .toggle-arrow-active {
-	background-position: center left;
 }
 
 #wp-link label input[type="text"] {
-	width: 360px;
+	width: 400px;
 	margin-top: 5px;
+	max-width: 70%;
 }
 
 #wp-link #link-options label span,
@@ -931,15 +1023,17 @@
 	width: 80px;
 	text-align: right;
 	padding-right: 5px;
+	max-width: 24%;
 }
 
 #wp-link .link-search-field {
 	float: left;
-	width: 220px;
+	width: 250px;
+	max-width: 70%;
 }
 
 #wp-link .link-search-wrapper {
-	margin: 5px 6px 9px;
+	margin: 5px 0 9px;
 	display: block;
 	overflow: hidden;
 }
@@ -958,16 +1052,18 @@
 	width: auto;
 	padding: 3px 0 0;
 	margin: 0 0 0 87px;
-	font-size: 11px;
 }
 
 #wp-link .query-results {
 	border: 1px #dfdfdf solid;
-	margin: 0 5px 5px;
+	margin: 0;
 	background: #fff;
-	height: 185px;
 	overflow: auto;
-	position: relative;
+	position: absolute;
+	left: 16px;
+	right: 16px;
+	bottom: 16px;
+	top: 205px;
 }
 
 #wp-link li,
@@ -1005,6 +1101,10 @@
 	font-weight: bold;
 }
 
+#wp-link li:last-child {
+	border: none;
+}
+
 #wp-link .item-title {
 	display: inline-block;
 	width: 80%;
@@ -1020,13 +1120,13 @@
 	bottom: 0;
 }
 
-#wp-link #search-results {
+#wp-link #search-results,
+#wp-link #search-panel {
 	display: none;
 }
 
-#wp-link #search-panel {
-	float: left;
-	width: 100%;
+#wp-link-wrap.search-panel-visible #search-panel {
+	display: block;
 }
 
 #wp-link .river-waiting {
@@ -1040,10 +1140,13 @@
 }
 
 #wp-link .submitbox {
-	padding: 5px 10px;
-	font-size: 11px;
-	overflow: auto;
-	height: 29px;
+	padding: 8px 16px;
+	background: #fcfcfc;
+	border-top: 1px solid #dfdfdf;
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	right: 0;
 }
 
 #wp-link-cancel {
@@ -1056,322 +1159,47 @@
 	float: right;
 }
 
-/*!
- * jQuery UI CSS Framework 1.10.1
- * http://jqueryui.com
- *
- * Copyright 2013 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden {
-	display: none;
-}
-.ui-helper-hidden-accessible {
-	border: 0;
-	clip: rect(0 0 0 0);
-	height: 1px;
-	margin: -1px;
-	overflow: hidden;
-	padding: 0;
-	position: absolute;
-	width: 1px;
-}
-.ui-helper-reset {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	outline: 0;
-	line-height: 1.3;
-	text-decoration: none;
-	font-size: 100%;
-	list-style: none;
-}
-.ui-helper-clearfix:before,
-.ui-helper-clearfix:after {
-	content: "";
-	display: table;
-	border-collapse: collapse;
-}
-.ui-helper-clearfix:after {
-	clear: both;
-}
-.ui-helper-clearfix {
-	min-height: 0; /* support: IE7 */
-}
-.ui-helper-zfix {
-	width: 100%;
-	height: 100%;
-	top: 0;
-	left: 0;
-	position: absolute;
-	opacity: 0;
-	filter:Alpha(Opacity=0);
-}
-
-.ui-front {
-	z-index: 100;
-}
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled {
-	cursor: default !important;
-}
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
-	display: block;
-	text-indent: -99999px;
-	overflow: hidden;
-	background-repeat: no-repeat;
-}
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
-	position: fixed;
-	top: 0;
-	left: 0;
-	width: 100%;
-	height: 100%;
-}
-
-
-/*!
- * jQuery UI Resizable 1.10.1
- * http://jqueryui.com
- *
- * Copyright 2013 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizable#theming
- */
-.ui-resizable {
-	position: relative;
-}
-.ui-resizable-handle {
-	position: absolute;
-	font-size: 0.1px;
-	display: block;
-}
-.ui-resizable-disabled .ui-resizable-handle,
-.ui-resizable-autohide .ui-resizable-handle {
-	display: none;
-}
-.ui-resizable-n {
-	cursor: n-resize;
-	height: 7px;
-	width: 100%;
-	top: -5px;
-	left: 0;
-}
-.ui-resizable-s {
-	cursor: s-resize;
-	height: 7px;
-	width: 100%;
-	bottom: -5px;
-	left: 0;
-}
-.ui-resizable-e {
-	cursor: e-resize;
-	width: 7px;
-	right: -5px;
-	top: 0;
-	height: 100%;
-}
-.ui-resizable-w {
-	cursor: w-resize;
-	width: 7px;
-	left: -5px;
-	top: 0;
-	height: 100%;
-}
-.ui-resizable-se {
-	cursor: se-resize;
-	width: 12px;
-	height: 12px;
-	right: 1px;
-	bottom: 1px;
-}
-.ui-resizable-sw {
-	cursor: sw-resize;
-	width: 9px;
-	height: 9px;
-	left: -5px;
-	bottom: -5px;
-}
-.ui-resizable-nw {
-	cursor: nw-resize;
-	width: 9px;
-	height: 9px;
-	left: -5px;
-	top: -5px;
-}
-.ui-resizable-ne {
-	cursor: ne-resize;
-	width: 9px;
-	height: 9px;
-	right: -5px;
-	top: -5px;
-}
-
-/*!
- * jQuery UI Dialog 1.10.1
- * http://jqueryui.com
- *
- * Copyright 2013 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog#theming
- */
-.ui-dialog {
-	position: absolute;
-	top: 0;
-	/* @noflip */
-	left: 0;
-	padding: .2em;
-	outline: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
-	padding: .4em 1em;
-	position: relative;
-}
-.ui-dialog .ui-dialog-title {
-	float: left;
-	margin: .1em 0;
-	white-space: nowrap;
-	width: 90%;
-	overflow: hidden;
-	text-overflow: ellipsis;
-}
-.ui-dialog .ui-dialog-titlebar-close {
-	position: absolute;
-	right: .3em;
-	top: 50%;
-	width: 21px;
-	margin: -10px 0 0 0;
-	padding: 1px;
-	height: 20px;
-}
-.ui-dialog .ui-dialog-content {
-	position: relative;
-	border: 0;
-	padding: .5em 1em;
-	background: none;
-	overflow: auto;
-}
-.ui-dialog .ui-dialog-buttonpane {
-	text-align: left;
-	border-width: 1px 0 0 0;
-	background-image: none;
-	margin-top: .5em;
-	padding: .3em 1em .5em .4em;
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+#wp-link-submit {
 	float: right;
-}
-.ui-dialog .ui-dialog-buttonpane button {
-	margin: .5em .4em .5em 0;
-	cursor: pointer;
-}
-.ui-dialog .ui-resizable-se {
-	width: 12px;
-	height: 12px;
-	right: -5px;
-	bottom: -5px;
-	background-position: 16px 16px;
-}
-.ui-draggable .ui-dialog-titlebar {
-	cursor: move;
-}
-
-/* WP jQuery Dialog Theme */
-.wp-dialog {
-	padding: 0;
-	z-index: 300002;
-	border: 0;
-	-webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.7);
-	box-shadow: 0 5px 15px rgba(0,0,0,0.7);
-	background-color: #f5f5f5;
-}
-
-.wp-dialog .ui-dialog-title {
-	display: block;
-	text-align: center;
-	padding: 0;
-}
-
-.wp-dialog .ui-dialog-titlebar {
-	padding: 0 1em;
-	background-color: #444;
-	font-size: 13px;
-	line-height: 24px;
-	color: #fff;
+	margin-bottom: 0;
 }
 
-.wp-dialog .ui-dialog-content {
-	padding: 0;
-}
+@media screen and ( max-width: 782px ), ( max-height: 440px ) {
 
-.wp-dialog .ui-dialog-titlebar-close {
-	cursor: pointer;
-	-webkit-appearance: none;
-	border: 0;
-	width: 30px;
-	height: 20px;
-	top: 13px;
-	right: 6px;
-	background: none;
-}
+	#wp-link-wrap,
+	#wp-link-wrap.search-panel-visible {
+		width: auto;
+		margin: 0;
+		top: 10px;
+		left: 10px;
+		right: 10px;
+		bottom: 10px;
+		max-width: 600px;
+		margin: auto;
+	}
 
-.wp-dialog .ui-dialog-titlebar-close:before {
-	content: '\f158';
-	font: normal 20px/1 'dashicons';
-	speak: none;
-	-webkit-font-smoothing: antialiased;
-	-moz-osx-font-smoothing: grayscale;
-	color: #999;
-	padding-left: 12px;
-}
+	#link-selector {
+		overflow: auto;
+		height: calc(100% - 88px);
+		padding-bottom: 0;
+	}
 
-.wp-dialog .ui-dialog-titlebar-close:hover:before {
-	color: #2ea2cc;
-}
+	#wp-link #search-panel {
+		display: block;
+	}
 
-.wp-dialog .ui-dialog-titlebar-close .ui-button-text {
-	display: none;
-}
+	#wp-link-search-toggle {
+		display: none;
+	}
 
-.wp-dialog .ui-dialog-titlebar-close:hover,
-.wp-dialog .ui-dialog-titlebar-close:focus {
-	background-position: -87px -32px;
-}
+	#search-panel .query-results {
+		position: static;
+	}
 
-.ui-widget-overlay {
-	z-index: 300001;
-	background-color: #000;
-	opacity: 0.6;
-	filter: alpha(opacity=60);
 }
 
-/* TinyMCE modal */
-/* TODO: restyle the TinyMCE 4.0 modals
+/* Old TinyMCE 3.x modal */
+/*
 .clearlooks2 .mceTop {
 	border-bottom: 1px solid #ccc;
 }
@@ -1807,7 +1635,6 @@
  	font-family: Arial, sans-serif;
 }
 
-
 /* HiDPI */
 @media print,
   (-o-min-device-pixel-ratio: 5/4),
@@ -1817,14 +1644,6 @@
 	#wp-fullscreen-buttons #wp_fs_image span.mce_image {
 		background: none;
 	}
-
-	#wp-link .toggle-arrow {
-		background: transparent url(../images/toggle-arrow-2x.png) top left no-repeat;
-		-webkit-background-size: 19px 69px;
-		background-size: 19px 69px;
-	}
 }
 
 /* TODO: DFW responsive */
-
-
Index: src/wp-includes/css/jquery-ui-dialog.css
===================================================================
--- src/wp-includes/css/jquery-ui-dialog.css	(revision 27490)
+++ src/wp-includes/css/jquery-ui-dialog.css	(working copy)
@@ -56,18 +56,12 @@
 	filter:Alpha(Opacity=0);
 }
 
-.ui-front {
-	z-index: 100;
-}
-
-
 /* Interaction Cues
 ----------------------------------*/
 .ui-state-disabled {
 	cursor: default !important;
 }
 
-
 /* Icons
 ----------------------------------*/
 
@@ -79,20 +73,6 @@
 	background-repeat: no-repeat;
 }
 
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
-	position: fixed;
-	top: 0;
-	left: 0;
-	width: 100%;
-	height: 100%;
-}
-
-
 /*!
  * jQuery UI Resizable 1.10.1
  * http://jqueryui.com
@@ -148,10 +128,10 @@
 /* @noflip */
 .ui-resizable-se {
 	cursor: se-resize;
-	width: 12px;
-	height: 12px;
-	right: 1px;
-	bottom: 1px;
+	width: 9px;
+	height: 9px;
+	right: -5px;
+	bottom: -5px;
 }
 /* @noflip */
 .ui-resizable-sw {
@@ -178,142 +158,174 @@
 	top: -5px;
 }
 
-/*!
- * jQuery UI Dialog 1.10.1
- * http://jqueryui.com
- *
- * Copyright 2013 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog#theming
- */
-.ui-dialog {
-	position: absolute;
-	top: 0;
-	/* @noflip */
-	left: 0;
-	padding: .2em;
-	outline: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
-	padding: .4em 1em;
-	position: relative;
-}
-.ui-dialog .ui-dialog-title {
-	float: left;
-	margin: .1em 0;
+/* WP buttons: see buttons.css. */
+
+.ui-button {
+	display: inline-block;
+	text-decoration: none;
+	font-size: 13px;
+	line-height: 26px;
+	height: 28px;
+	margin: 0;
+	padding: 0 10px 1px;
+	cursor: pointer;
+	border-width: 1px;
+	border-style: solid;
+	-webkit-appearance: none;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
 	white-space: nowrap;
-	width: 90%;
-	overflow: hidden;
-	text-overflow: ellipsis;
-}
-.ui-dialog .ui-dialog-titlebar-close {
-	position: absolute;
-	right: .3em;
-	top: 50%;
-	width: 21px;
-	margin: -10px 0 0 0;
-	padding: 1px;
-	height: 20px;
-}
-.ui-dialog .ui-dialog-content {
-	position: relative;
-	border: 0;
-	padding: .5em 1em;
-	background: none;
-	overflow: auto;
-}
-.ui-dialog .ui-dialog-buttonpane {
-	text-align: left;
-	border-width: 1px 0 0 0;
-	background-image: none;
-	margin-top: .5em;
-	padding: .3em 1em .5em .4em;
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
-	float: right;
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	color: #555;
+	border-color: #cccccc;
+	background: #f7f7f7;
+	-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08);
+	box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08);
+	vertical-align: top;
+}
+
+/* Remove the dotted border on :focus and the extra padding in Firefox */
+.ui-button::-moz-focus-inner {
+	border-width: 1px 0;
+	border-style: solid none;
+	border-color: transparent;
+	padding: 0;
 }
-.ui-dialog .ui-dialog-buttonpane button {
-	margin: .5em .4em .5em 0;
-	cursor: pointer;
+
+.ui-button:hover {
+	background: #fafafa;
+	border-color: #999;
+	color: #222;
 }
-.ui-dialog .ui-resizable-se {
-	width: 12px;
-	height: 12px;
-	right: -5px;
-	bottom: -5px;
-	background-position: 16px 16px;
+
+.ui-button:focus {
+	-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.2);
+	box-shadow: 1px 1px 1px rgba(0,0,0,.2);
 }
-.ui-draggable .ui-dialog-titlebar {
-	cursor: move;
+
+.ui-button:active {
+	background: #eee;
+	border-color: #999;
+	color: #333;
+ 	-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
+ 	box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
+ 	outline: none;
 }
 
-/* WP jQuery Dialog Theme */
-.wp-dialog {
-	padding: 0;
-	z-index: 100102;
-	border: 0;
-	-webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.7);
-	box-shadow: 0 5px 15px rgba(0,0,0,0.7);
-	background-color: #f5f5f5;
+.ui-button[disabled],
+.ui-button:disabled {
+	color: #aaa !important;
+	border-color: #ddd !important;
+	background: #f7f7f7 !important;
+	-webkit-box-shadow: none !important;
+	box-shadow: none !important;
+	text-shadow: 0 1px 0 #fff !important;
+	cursor: default;
 }
 
-.wp-dialog .ui-dialog-title {
-	display: block;
-	text-align: center;
-	padding: 0;
+@media screen and ( max-width: 782px ) {
+
+	.ui-button {
+		padding: 10px 14px;
+		line-height: 1;
+		font-size: 14px;
+		vertical-align: middle;
+		height: auto;
+		margin-bottom: 4px;
+	}
+
 }
 
-.wp-dialog .ui-dialog-titlebar {
-	padding: 0 1em;
-	background-color: #444;
-	font-size: 13px;
-	line-height: 24px;
-	color: #fff;
+/* WP Theme */
+
+.ui-dialog {
+	position: absolute;
+	top: 0;
+	left: 0;
+	z-index: 100102;
+	background-color: #fff;
 }
 
-.wp-dialog .ui-dialog-content {
-	padding: 0;
+.ui-dialog-titlebar {
+	background: #fcfcfc;
+	border-bottom: 1px solid #dfdfdf;
+	height: 56px;
+	font-size: 22px;
+	font-weight: 600;
+	line-height: 56px;
+	padding: 0 40px 0 16px;
 }
 
-.wp-dialog .ui-dialog-titlebar-close {
-	cursor: pointer;
-	-webkit-appearance: none;
-	border: 0;
-	width: 30px;
-	height: 20px;
-	top: 13px;
-	right: 6px;
+.ui-button.ui-dialog-titlebar-close {
 	background: none;
+	border: none;
+	-webkit-box-shadow: none;
+	box-shadow: none;
+	color: #666;
+	cursor: pointer;
+	display: block;
+	padding: 0;
+	position: absolute;
+	top: 0;
+	right: 0;
+	width: 40px;
+	height: 40px;
+	text-align: center;
 }
 
-.wp-dialog .ui-dialog-titlebar-close:before {
-	content: '\f158';
+.ui-dialog-titlebar-close:before {
 	font: normal 20px/1 'dashicons';
+	vertical-align: top;
 	speak: none;
 	-webkit-font-smoothing: antialiased;
 	-moz-osx-font-smoothing: grayscale;
-	color: #999;
-	padding-left: 12px;
+	line-height: 40px;
+	width: 40px;
+	height: 40px;
+	content: '\f158';
 }
 
-.wp-dialog .ui-dialog-titlebar-close:hover:before {
+.ui-button.ui-dialog-titlebar-close:hover {
 	color: #2ea2cc;
 }
 
-.wp-dialog .ui-dialog-titlebar-close .ui-button-text {
+.ui-dialog-titlebar-close .ui-button-text {
 	display: none;
 }
 
-.wp-dialog .ui-dialog-titlebar-close:hover,
-.wp-dialog .ui-dialog-titlebar-close:focus {
-	background-position: -87px -32px;
+.ui-dialog-content {
+	padding: 16px;
+	overflow: auto;
+}
+
+.ui-dialog-buttonpane {
+	background: #fcfcfc;
+	border-top: 1px solid #dfdfdf;
+	padding: 16px;
+}
+
+.ui-dialog-buttonpane .ui-button {
+	margin-left: 16px;
+}
+
+.ui-dialog-buttonpane .ui-dialog-buttonset {
+	float: right;
+}
+
+.ui-draggable .ui-dialog-titlebar {
+	cursor: move;
 }
 
 .ui-widget-overlay {
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	min-height: 360px;
+	background: #000;
+	opacity: 0.7;
 	z-index: 100101;
-	background-color: #000;
-	opacity: 0.6;
-	filter: alpha(opacity=60);
 }
Index: src/wp-includes/js/wplink.js
===================================================================
--- src/wp-includes/js/wplink.js	(revision 27490)
+++ src/wp-includes/js/wplink.js	(working copy)
@@ -1,8 +1,8 @@
 /* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */
 var wpLink;
 
-(function($){
-	var inputs = {}, rivers = {}, ed, River, Query;
+( function( $ ) {
+	var inputs = {}, rivers = {}, editor, River, Query;
 
 	wpLink = {
 		timeToTriggerRiver: 150,
@@ -12,54 +12,47 @@
 		lastSearch: '',
 		textarea: '',
 
-		init : function() {
-			inputs.dialog = $('#wp-link');
-			inputs.submit = $('#wp-link-submit');
+		init: function() {
+			inputs.wrap = $('#wp-link-wrap');
+			inputs.dialog = $( '#wp-link' );
+			inputs.backdrop = $( '#wp-link-backdrop' );
+			inputs.submit = $( '#wp-link-submit' );
+			inputs.close = $( '#wp-link-close' );
 			// URL
-			inputs.url = $('#url-field');
-			inputs.nonce = $('#_ajax_linking_nonce');
+			inputs.url = $( '#url-field' );
+			inputs.nonce = $( '#_ajax_linking_nonce' );
 			// Secondary options
-			inputs.title = $('#link-title-field');
+			inputs.title = $( '#link-title-field' );
 			// Advanced Options
-			inputs.openInNewTab = $('#link-target-checkbox');
-			inputs.search = $('#search-field');
+			inputs.openInNewTab = $( '#link-target-checkbox' );
+			inputs.search = $( '#search-field' );
 			// Build Rivers
-			rivers.search = new River( $('#search-results') );
-			rivers.recent = new River( $('#most-recent-results') );
-			rivers.elements = $('.query-results', inputs.dialog);
+			rivers.search = new River( $( '#search-results' ) );
+			rivers.recent = new River( $( '#most-recent-results' ) );
+			rivers.elements = inputs.dialog.find( '.query-results' );
 
 			// Bind event handlers
 			inputs.dialog.keydown( wpLink.keydown );
 			inputs.dialog.keyup( wpLink.keyup );
-			inputs.submit.click( function(e){
-				e.preventDefault();
+			inputs.submit.click( function( event ) {
+				event.preventDefault();
 				wpLink.update();
 			});
-			$('#wp-link-cancel').click( function(e){
-				e.preventDefault();
+			inputs.close.add( inputs.backdrop ).click( function( event ) {
+				event.preventDefault();
 				wpLink.close();
 			});
-			$('#internal-toggle').click( wpLink.toggleInternalLinking );
 
-			rivers.elements.bind('river-select', wpLink.updateFields );
+			$( '#wp-link-search-toggle' ).click( wpLink.toggleInternalLinking );
 
-			inputs.search.keyup( wpLink.searchInternalLinks );
+			rivers.elements.on( 'river-select', wpLink.updateFields );
 
-			inputs.dialog.bind('wpdialogrefresh', wpLink.refresh);
-			inputs.dialog.bind('wpdialogbeforeopen', wpLink.beforeOpen);
-			inputs.dialog.bind('wpdialogclose', wpLink.onClose);
+			inputs.search.keyup( wpLink.searchInternalLinks );
 		},
 
-		beforeOpen : function() {
+		open: function( editorId ) {
 			wpLink.range = null;
 
-			if ( ! wpLink.isMCE() && document.selection ) {
-				wpLink.textarea.focus();
-				wpLink.range = document.selection.createRange();
-			}
-		},
-
-		open : function( editorId ) {
 			if ( editorId ) {
 				window.wpActiveEditor = editorId;
 			}
@@ -68,35 +61,32 @@
 				return;
 			}
 
-			this.textarea = $( '#' + wpActiveEditor ).get(0);
+			this.textarea = $( '#' + window.wpActiveEditor ).get( 0 );
 
 			if ( typeof tinymce !== 'undefined' ) {
-				ed = tinymce.get( wpActiveEditor );
+				editor = tinymce.get( wpActiveEditor );
 
-				if ( ed && tinymce.isIE ) {
-					ed.windowManager.bookmark = ed.selection.getBookmark();
+				if ( editor && tinymce.isIE ) {
+					editor.windowManager.bookmark = editor.selection.getBookmark();
 				}
 			}
 
-			// Initialize the dialog
-			if ( ! inputs.dialog.data('wpdialog') ) {
-				inputs.dialog.wpdialog({
-					title: wpLinkL10n.title,
-					width: 480,
-					height: 'auto',
-					modal: true,
-					dialogClass: 'wp-dialog'
-				});
+			if ( ! wpLink.isMCE() && document.selection ) {
+				this.textarea.focus();
+				this.range = document.selection.createRange();
 			}
 
-			inputs.dialog.wpdialog('open');
+			inputs.wrap.show();
+			inputs.backdrop.show();
+
+			wpLink.refresh();
 		},
 
-		isMCE : function() {
-			return ed && ! ed.isHidden();
+		isMCE: function() {
+			return editor && ! editor.isHidden();
 		},
 
-		refresh : function() {
+		refresh: function() {
 			// Refresh rivers (clear links, check visibility)
 			rivers.search.refresh();
 			rivers.recent.refresh();
@@ -119,12 +109,12 @@
 			var e;
 
 			// If link exists, select proper values.
-			if ( e = ed.dom.getParent( ed.selection.getNode(), 'A' ) ) {
+			if ( e = editor.dom.getParent( editor.selection.getNode(), 'A' ) ) {
 				// Set URL and description.
-				inputs.url.val( ed.dom.getAttrib( e, 'href' ) );
-				inputs.title.val( ed.dom.getAttrib( e, 'title' ) );
+				inputs.url.val( editor.dom.getAttrib( e, 'href' ) );
+				inputs.title.val( editor.dom.getAttrib( e, 'title' ) );
 				// Set open in new tab.
-				inputs.openInNewTab.prop( 'checked', ( '_blank' === ed.dom.getAttrib( e, 'target' ) ) );
+				inputs.openInNewTab.prop( 'checked', ( '_blank' === editor.dom.getAttrib( e, 'target' ) ) );
 				// Update save prompt.
 				inputs.submit.val( wpLinkL10n.update );
 
@@ -135,10 +125,6 @@
 		},
 
 		close: function() {
-			inputs.dialog.wpdialog('close');
-		},
-
-		onClose: function() {
 			if ( ! wpLink.isMCE() ) {
 				wpLink.textarea.focus();
 
@@ -147,13 +133,16 @@
 					wpLink.range.select();
 				}
 			}
+
+			inputs.backdrop.hide();
+			inputs.wrap.hide();
 		},
 
 		getAttrs: function() {
 			return {
-				href : inputs.url.val(),
-				title : inputs.title.val(),
-				target : inputs.openInNewTab.prop('checked') ? '_blank' : ''
+				href: inputs.url.val(),
+				title: inputs.title.val(),
+				target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : ''
 			};
 		},
 
@@ -230,33 +219,33 @@
 				attrs = wpLink.getAttrs();
 
 			wpLink.close();
-			ed.focus();
+			editor.focus();
 
 			if ( tinymce.isIE ) {
-				ed.selection.moveToBookmark( ed.windowManager.bookmark );
+				editor.selection.moveToBookmark( editor.windowManager.bookmark );
 			}
 
-			link = ed.dom.getParent( ed.selection.getNode(), 'a[href]' );
+			link = editor.dom.getParent( editor.selection.getNode(), 'a[href]' );
 
 			// If the values are empty, unlink and return
 			if ( ! attrs.href || attrs.href == 'http://' ) {
-				ed.execCommand('unlink');
+				editor.execCommand( 'unlink' );
 				return;
 			}
 
 			if ( link ) {
-				ed.dom.setAttribs( link, attrs );
+				editor.dom.setAttribs( link, attrs );
 			} else {
-				ed.execCommand( 'mceInsertLink', false, attrs );
+				editor.execCommand( 'mceInsertLink', false, attrs );
 			}
 
 			// Move the cursor to the end of the selection
-			ed.selection.collapse();
+			editor.selection.collapse();
 		},
 
 		updateFields: function( e, li, originalEvent ) {
-			inputs.url.val( li.children('.item-permalink').val() );
-			inputs.title.val( li.hasClass('no-title') ? '' : li.children('.item-title').text() );
+			inputs.url.val( li.children( '.item-permalink' ).val() );
+			inputs.title.val( li.hasClass( 'no-title' ) ? '' : li.children( '.item-title' ).text() );
 			if ( originalEvent && originalEvent.type == 'click' )
 				inputs.url.focus();
 		},
@@ -264,15 +253,15 @@
 		setDefaultValues: function() {
 			// Set URL and description to defaults.
 			// Leave the new tab setting as-is.
-			inputs.url.val('http://');
-			inputs.title.val('');
+			inputs.url.val( 'http://' );
+			inputs.title.val( '' );
 
 			// Update save prompt.
 			inputs.submit.val( wpLinkL10n.save );
 		},
 
 		searchInternalLinks: function() {
-			var t = $(this), waiting,
+			var t = $( this ), waiting,
 				search = t.val();
 
 			if ( search.length > 2 ) {
@@ -284,10 +273,12 @@
 					return;
 
 				wpLink.lastSearch = search;
-				waiting = t.parent().find('.spinner').show();
+				waiting = $( '#river-waiting' ).show();
 
 				rivers.search.change( search );
-				rivers.search.ajax( function(){ waiting.hide(); });
+				rivers.search.ajax( function() {
+					waiting.hide();
+				});
 			} else {
 				rivers.search.hide();
 				rivers.recent.show();
@@ -343,7 +334,7 @@
 					return func.apply( funcContext, funcArgs );
 				// Otherwise, wait.
 				timeoutTriggered = true;
-			}, delay);
+			}, delay );
 
 			return function() {
 				if ( timeoutTriggered )
@@ -355,53 +346,37 @@
 			};
 		},
 
-		toggleInternalLinking: function( event ) {
-			var panel = $('#search-panel'),
-				widget = inputs.dialog.wpdialog('widget'),
-				// We're about to toggle visibility; it's currently the opposite
-				visible = !panel.is(':visible'),
-				win = $(window);
-
-			$(this).toggleClass('toggle-arrow-active', visible);
-
-			inputs.dialog.height('auto');
-			panel.slideToggle( 300, function() {
-				setUserSetting('wplink', visible ? '1' : '0');
-				inputs[ visible ? 'search' : 'url' ].focus();
-
-				// Move the box if the box is now expanded, was opened in a collapsed state,
-				// and if it needs to be moved. (Judged by bottom not being positive or
-				// bottom being smaller than top.)
-				var scroll = win.scrollTop(),
-					top = widget.offset().top,
-					bottom = top + widget.outerHeight(),
-					diff = bottom - win.height();
+		toggleInternalLinking: function() {
+			var visible = inputs.wrap.hasClass( 'search-panel-visible' );
 
-				if ( diff > scroll ) {
-					widget.animate({'top': diff < top ?  top - diff : scroll }, 200);
-				}
-			});
-			event.preventDefault();
+			inputs.wrap.toggleClass( 'search-panel-visible', ! visible );
+			setUserSetting( 'wplink', visible ? '0' : '1' );
+			inputs[ ! visible ? 'search' : 'url' ].focus();
 		}
 	};
 
 	River = function( element, search ) {
 		var self = this;
 		this.element = element;
-		this.ul = element.children('ul');
-		this.waiting = element.find('.river-waiting');
+		this.ul = element.children( 'ul' );
+		this.contentHeight = element.children( '#link-selector-height' );
+		this.waiting = $( '#river-waiting' );
 
 		this.change( search );
 		this.refresh();
 
-		element.scroll( function(){ self.maybeLoad(); });
-		element.delegate('li', 'click', function(e){ self.select( $(this), e ); });
+		$( '#wp-link .query-results, #wp-link #link-selector' ).scroll( function() {
+			self.maybeLoad();
+		});
+		element.on( 'click', 'li', function( event ) {
+			self.select( $( this ), event );
+		});
 	};
 
 	$.extend( River.prototype, {
 		refresh: function() {
 			this.deselect();
-			this.visible = this.element.is(':visible');
+			this.visible = this.element.is( ':visible' );
 		},
 		show: function() {
 			if ( ! this.visible ) {
@@ -418,11 +393,11 @@
 		select: function( li, event ) {
 			var liHeight, elHeight, liTop, elTop;
 
-			if ( li.hasClass('unselectable') || li == this.selected )
+			if ( li.hasClass( 'unselectable' ) || li == this.selected )
 				return;
 
 			this.deselect();
-			this.selected = li.addClass('selected');
+			this.selected = li.addClass( 'selected' );
 			// Make sure the element is visible
 			liHeight = li.outerHeight();
 			elHeight = this.element.height();
@@ -435,11 +410,11 @@
 				this.element.scrollTop( elTop + liTop - elHeight + liHeight );
 
 			// Trigger the river-select event
-			this.element.trigger('river-select', [ li, event, this ]);
+			this.element.trigger( 'river-select', [ li, event, this ] );
 		},
 		deselect: function() {
 			if ( this.selected )
-				this.selected.removeClass('selected');
+				this.selected.removeClass( 'selected' );
 			this.selected = false;
 		},
 		prev: function() {
@@ -448,7 +423,7 @@
 
 			var to;
 			if ( this.selected ) {
-				to = this.selected.prev('li');
+				to = this.selected.prev( 'li' );
 				if ( to.length )
 					this.select( to );
 			}
@@ -457,7 +432,7 @@
 			if ( ! this.visible )
 				return;
 
-			var to = this.selected ? this.selected.next('li') : $('li:not(.unselectable):first', this.element);
+			var to = this.selected ? this.selected.next( 'li' ) : $( 'li:not(.unselectable):first', this.element );
 			if ( to.length )
 				this.select( to );
 		},
@@ -478,13 +453,13 @@
 
 			this._search = search;
 			this.query = new Query( search );
-			this.element.scrollTop(0);
+			this.element.scrollTop( 0 );
 		},
 		process: function( results, params ) {
 			var list = '', alt = true, classes = '',
 				firstPage = params.page == 1;
 
-			if ( !results ) {
+			if ( ! results ) {
 				if ( firstPage ) {
 					list += '<li class="unselectable"><span class="item-title"><em>' +
 						wpLinkL10n.noMatchesFound + '</em></span></li>';
@@ -509,20 +484,22 @@
 				el = this.element,
 				bottom = el.scrollTop() + el.height();
 
-			if ( ! this.query.ready() || bottom < this.ul.height() - wpLink.riverBottomThreshold )
+			if ( ! this.query.ready() || bottom < this.contentHeight.height() - wpLink.riverBottomThreshold )
 				return;
 
 			setTimeout(function() {
 				var newTop = el.scrollTop(),
 					newBottom = newTop + el.height();
 
-				if ( ! self.query.ready() || newBottom < self.ul.height() - wpLink.riverBottomThreshold )
+				if ( ! self.query.ready() || newBottom < self.contentHeight.height() - wpLink.riverBottomThreshold )
 					return;
 
 				self.waiting.show();
 				el.scrollTop( newTop + self.waiting.outerHeight() );
 
-				self.ajax( function() { self.waiting.hide(); });
+				self.ajax( function() {
+					self.waiting.hide();
+				});
 			}, wpLink.timeToTriggerRiver );
 		}
 	});
@@ -536,7 +513,7 @@
 
 	$.extend( Query.prototype, {
 		ready: function() {
-			return !( this.querying || this.allLoaded );
+			return ! ( this.querying || this.allLoaded );
 		},
 		ajax: function( callback ) {
 			var self = this,
@@ -551,14 +528,14 @@
 
 			this.querying = true;
 
-			$.post( ajaxurl, query, function(r) {
+			$.post( ajaxurl, query, function( r ) {
 				self.page++;
 				self.querying = false;
-				self.allLoaded = !r;
+				self.allLoaded = ! r;
 				callback( r, query );
 			}, 'json' );
 		}
 	});
 
-	$(document).ready( wpLink.init );
-})(jQuery);
+	$( document ).ready( wpLink.init );
+})( jQuery );
Index: src/wp-includes/script-loader.php
===================================================================
--- src/wp-includes/script-loader.php	(revision 27490)
+++ src/wp-includes/script-loader.php	(working copy)
@@ -338,7 +338,7 @@
 
 	$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
 
-	$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), false, 1 );
+	$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery' ), false, 1 );
 	did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array(
 		'title' => __('Insert/edit link'),
 		'update' => __('Update'),
