<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[22723] trunk/wp-admin: Fix up the 'Attach' dialog on upload.php.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/22723">22723</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-11-20 18:50:15 +0000 (Tue, 20 Nov 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix up the 'Attach' dialog on upload.php.

We are de-emphasising attaching (see <a href="http://core.trac.wordpress.org/changeset/22630">[22630]</a>) but this is existing
core functionality and will remain for now. This commit just cleans
it up a bit so as to be less embarrassing.

props lessbloat, helenyhou.
fixes <a href="http://core.trac.wordpress.org/ticket/20164">#20164</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscolorsclassiccss">trunk/wp-admin/css/colors-classic.css</a></li>
<li><a href="#trunkwpadmincsscolorsfreshcss">trunk/wp-admin/css/colors-fresh.css</a></li>
<li><a href="#trunkwpadmincsswpadminrtlcss">trunk/wp-admin/css/wp-admin-rtl.css</a></li>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminjsmediajs">trunk/wp-admin/js/media.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscolorsclassiccss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-classic.css (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-classic.css        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/css/colors-classic.css        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -20,15 +20,20 @@
</span><span class="cx">   1.0 - Left to Right Styles
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span><span class="cx"> 
</span><del>-.find-box-search {
-        border-color: #dfdfdf;
-        background-color: #f1f1f1;
</del><ins>+.find-box-search,
+.find-box-buttons {
+        background-color: #eff8ff;
+        border-top: 1px solid #dce6f8;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box {
</span><del>-        background-color: #f1f1f1;
</del><ins>+        background-color: #5589aa;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.find-box-head {
+        color: #fff;
+}
+
</ins><span class="cx"> .find-box-inside {
</span><span class="cx">         background-color: #fff;
</span><span class="cx"> }
</span><span class="lines">@@ -167,7 +172,6 @@
</span><span class="cx"> h3.dashboard-widget-title,
</span><span class="cx"> h3.dashboard-widget-title span,
</span><span class="cx"> h3.dashboard-widget-title small,
</span><del>-.find-box-head,
</del><span class="cx"> .sidebar-name,
</span><span class="cx"> #nav-menu-header,
</span><span class="cx"> #nav-menu-footer,
</span><span class="lines">@@ -475,8 +479,7 @@
</span><span class="cx"> .widefat tfoot tr th,
</span><span class="cx"> h3.dashboard-widget-title,
</span><span class="cx"> h3.dashboard-widget-title span,
</span><del>-h3.dashboard-widget-title small,
-.find-box-head {
</del><ins>+h3.dashboard-widget-title small {
</ins><span class="cx">         color: #333;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmincsscolorsfreshcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-fresh.css (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-fresh.css        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/css/colors-fresh.css        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -20,15 +20,20 @@
</span><span class="cx">   1.0 - Left to Right Styles
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span><span class="cx"> 
</span><del>-.find-box-search {
-        border-color: #dfdfdf;
-        background-color: #f1f1f1;
</del><ins>+.find-box-search,
+.find-box-buttons {
+        background-color: #f7f7f7;
+        border-top: 1px solid #ddd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box {
</span><del>-        background-color: #f1f1f1;
</del><ins>+        background-color: #444;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.find-box-head {
+        color: #eee;
+}
+
</ins><span class="cx"> .find-box-inside {
</span><span class="cx">         background-color: #fff;
</span><span class="cx"> }
</span><span class="lines">@@ -170,7 +175,6 @@
</span><span class="cx"> h3.dashboard-widget-title,
</span><span class="cx"> h3.dashboard-widget-title span,
</span><span class="cx"> h3.dashboard-widget-title small,
</span><del>-.find-box-head,
</del><span class="cx"> .sidebar-name,
</span><span class="cx"> #nav-menu-header,
</span><span class="cx"> #nav-menu-footer,
</span><span class="lines">@@ -477,8 +481,7 @@
</span><span class="cx"> .widefat tfoot tr th,
</span><span class="cx"> h3.dashboard-widget-title,
</span><span class="cx"> h3.dashboard-widget-title span,
</span><del>-h3.dashboard-widget-title small,
-.find-box-head {
</del><ins>+h3.dashboard-widget-title small {
</ins><span class="cx">         color: #333;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmincsswpadminrtlcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin-rtl.css (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin-rtl.css        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/css/wp-admin-rtl.css        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -1083,6 +1083,21 @@
</span><span class="cx">   14.1 - Media Uploader
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span><span class="cx"> 
</span><ins>+#find-posts-input {
+        float: right;
+}
+
+#find-posts-search {
+        float: right;
+        margin-right: 3px;
+        margin-left: 4px;
+}
+
+.find-box-search .spinner {
+        left: auto;
+        right: 115px;
+}
+
</ins><span class="cx"> #find-posts-response .found-radio {
</span><span class="cx">         padding: 5px 8px 0 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/css/wp-admin.css        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -3963,10 +3963,10 @@
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span><span class="cx"> 
</span><span class="cx"> .find-box {
</span><del>-        width: 500px;
</del><ins>+        width: 600px;
</ins><span class="cx">         height: 300px;
</span><span class="cx">         overflow: hidden;
</span><del>-        padding: 33px 5px 40px;
</del><ins>+        padding: 33px 0 51px;
</ins><span class="cx">         position: absolute;
</span><span class="cx">         z-index: 1000;
</span><span class="cx"> }
</span><span class="lines">@@ -3984,19 +3984,37 @@
</span><span class="cx"> 
</span><span class="cx"> .find-box-inside {
</span><span class="cx">         overflow: auto;
</span><del>-        width: 100%;
</del><ins>+        padding: 6px;
</ins><span class="cx">         height: 100%;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box-search {
</span><del>-        padding: 12px;
-        border-width: 1px;
-        border-style: none none solid;
</del><ins>+        overflow: hidden;
+        padding: 9px;
+        position: relative;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.find-box-search .spinner {
+        float: none;
+        left: 125px;
+        position: absolute;
+        top: 9px;
+}
+
+#find-posts-input {
+        float: left;
+        width: 140px;
+        height: 24px;
+}
+
+#find-posts-search {
+        float: left;
+        margin: 1px 4px 0 3px;
+}
+
</ins><span class="cx"> #find-posts-response {
</span><span class="cx">         margin: 8px 0;
</span><del>-        padding: 0 1px;
</del><ins>+        padding: 0 1px 6px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #find-posts-response table {
</span><span class="lines">@@ -4004,25 +4022,30 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #find-posts-response .found-radio {
</span><del>-        padding: 5px 0 0 8px;
</del><ins>+        padding: 3px 0 0 8px;
</ins><span class="cx">         width: 15px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box-buttons {
</span><del>-        width: 480px;
-        margin: 8px;
</del><ins>+        padding: 8px;
+        overflow: hidden;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.find-box-search label {
-        padding-right: 6px;
-}
-
</del><span class="cx"> .find-box #resize-se {
</span><span class="cx">         position: absolute;
</span><span class="cx">         right: 1px;
</span><span class="cx">         bottom: 1px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.ui-find-overlay {
+        position: absolute;
+        top: 0;
+        left: 0;
+        background-color: #000;
+        opacity: 0.6;
+        filter: alpha(opacity=60);
+}
+
</ins><span class="cx"> ul#dismissed-updates {
</span><span class="cx">         display: none;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/includes/ajax-actions.php        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -1421,37 +1421,27 @@
</span><span class="cx"> 
</span><span class="cx">         check_ajax_referer( 'find-posts' );
</span><span class="cx"> 
</span><del>-        if ( empty($_POST['ps']) )
-                wp_die();
</del><ins>+        $post_types = get_post_types( array( 'public' =&gt; true ), 'objects' );
+        unset( $post_types['attachment'] );
</ins><span class="cx"> 
</span><del>-        if ( !empty($_POST['post_type']) &amp;&amp; in_array( $_POST['post_type'], get_post_types() ) )
-                $what = $_POST['post_type'];
-        else
-                $what = 'post';
-
-        $s = stripslashes($_POST['ps']);
-        preg_match_all('/&quot;.*?(&quot;|$)|((?&lt;=[\\s&quot;,+])|^)[^\\s&quot;,+]+/', $s, $matches);
-        $search_terms = array_map('_search_terms_tidy', $matches[0]);
-
</del><ins>+        $s = stripslashes( $_POST['ps'] );
</ins><span class="cx">         $searchand = $search = '';
</span><del>-        foreach ( (array) $search_terms as $term ) {
-                $term = esc_sql( like_escape( $term ) );
-                $search .= &quot;{$searchand}(($wpdb-&gt;posts.post_title LIKE '%{$term}%') OR ($wpdb-&gt;posts.post_content LIKE '%{$term}%'))&quot;;
-                $searchand = ' AND ';
-        }
-        $term = esc_sql( like_escape( $s ) );
-        if ( count($search_terms) &gt; 1 &amp;&amp; $search_terms[0] != $s )
-                $search .= &quot; OR ($wpdb-&gt;posts.post_title LIKE '%{$term}%') OR ($wpdb-&gt;posts.post_content LIKE '%{$term}%')&quot;;
</del><ins>+        $args = array(
+                'post_type' =&gt; array_keys( $post_types ),
+                'post_status' =&gt; 'any',
+                'posts_per_page' =&gt; 50,
+        );
+        if ( '' !== $s )
+                $args['s'] = $s;
</ins><span class="cx"> 
</span><del>-        $posts = $wpdb-&gt;get_results( &quot;SELECT ID, post_title, post_status, post_date FROM $wpdb-&gt;posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50&quot; );
</del><ins>+        $posts = get_posts( $args );
</ins><span class="cx"> 
</span><del>-        if ( ! $posts ) {
-                $posttype = get_post_type_object($what);
-                wp_die( $posttype-&gt;labels-&gt;not_found );
-        }
</del><ins>+        if ( ! $posts )
+                wp_die( __('No items found.') );
</ins><span class="cx"> 
</span><del>-        $html = '&lt;table class=&quot;widefat&quot; cellspacing=&quot;0&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th class=&quot;found-radio&quot;&gt;&lt;br /&gt;&lt;/th&gt;&lt;th&gt;'.__('Title').'&lt;/th&gt;&lt;th&gt;'.__('Date').'&lt;/th&gt;&lt;th&gt;'.__('Status').'&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;';
</del><ins>+        $html = '&lt;table class=&quot;widefat&quot; cellspacing=&quot;0&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th class=&quot;found-radio&quot;&gt;&lt;br /&gt;&lt;/th&gt;&lt;th&gt;'.__('Title').'&lt;/th&gt;&lt;th class=&quot;no-break&quot;&gt;'.__('Type').'&lt;/th&gt;&lt;th class=&quot;no-break&quot;&gt;'.__('Date').'&lt;/th&gt;&lt;th class=&quot;no-break&quot;&gt;'.__('Status').'&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;';
</ins><span class="cx">         foreach ( $posts as $post ) {
</span><ins>+                $title = trim( $post-&gt;post_title ) ? $post-&gt;post_title : __( '(no title)' );
</ins><span class="cx"> 
</span><span class="cx">                 switch ( $post-&gt;post_status ) {
</span><span class="cx">                         case 'publish' :
</span><span class="lines">@@ -1477,17 +1467,16 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $html .= '&lt;tr class=&quot;found-posts&quot;&gt;&lt;td class=&quot;found-radio&quot;&gt;&lt;input type=&quot;radio&quot; id=&quot;found-'.$post-&gt;ID.'&quot; name=&quot;found_post_id&quot; value=&quot;' . esc_attr($post-&gt;ID) . '&quot;&gt;&lt;/td&gt;';
</span><del>-                $html .= '&lt;td&gt;&lt;label for=&quot;found-'.$post-&gt;ID.'&quot;&gt;'.esc_html( $post-&gt;post_title ).'&lt;/label&gt;&lt;/td&gt;&lt;td&gt;'.esc_html( $time ).'&lt;/td&gt;&lt;td&gt;'.esc_html( $stat ).'&lt;/td&gt;&lt;/tr&gt;'.&quot;\n\n&quot;;
</del><ins>+                $html .= '&lt;td&gt;&lt;label for=&quot;found-'.$post-&gt;ID.'&quot;&gt;' . esc_html( $title ) . '&lt;/label&gt;&lt;/td&gt;&lt;td class=&quot;no-break&quot;&gt;' . esc_html( $post_types[$post-&gt;post_type]-&gt;labels-&gt;singular_name ) . '&lt;/td&gt;&lt;td class=&quot;no-break&quot;&gt;'.esc_html( $time ) . '&lt;/td&gt;&lt;td class=&quot;no-break&quot;&gt;' . esc_html( $stat ). ' &lt;/td&gt;&lt;/tr&gt;' . &quot;\n\n&quot;;
</ins><span class="cx">         }
</span><ins>+
</ins><span class="cx">         $html .= '&lt;/tbody&gt;&lt;/table&gt;';
</span><span class="cx"> 
</span><span class="cx">         $x = new WP_Ajax_Response();
</span><span class="cx">         $x-&gt;add( array(
</span><del>-                'what' =&gt; $what,
</del><span class="cx">                 'data' =&gt; $html
</span><span class="cx">         ));
</span><span class="cx">         $x-&gt;send();
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wp_ajax_widgets_order() {
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/includes/template.php        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -1278,18 +1278,8 @@
</span><span class="cx">                                 &lt;?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?&gt;
</span><span class="cx">                                 &lt;label class=&quot;screen-reader-text&quot; for=&quot;find-posts-input&quot;&gt;&lt;?php _e( 'Search' ); ?&gt;&lt;/label&gt;
</span><span class="cx">                                 &lt;input type=&quot;text&quot; id=&quot;find-posts-input&quot; name=&quot;ps&quot; value=&quot;&quot; /&gt;
</span><del>-                                &lt;input type=&quot;button&quot; id=&quot;find-posts-search&quot; value=&quot;&lt;?php esc_attr_e( 'Search' ); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;br /&gt;
-
-                                &lt;?php
-                                $post_types = get_post_types( array('public' =&gt; true), 'objects' );
-                                foreach ( $post_types as $post ) {
-                                        if ( 'attachment' == $post-&gt;name )
-                                                continue;
-                                ?&gt;
-                                &lt;input type=&quot;radio&quot; name=&quot;find-posts-what&quot; id=&quot;find-posts-&lt;?php echo esc_attr($post-&gt;name); ?&gt;&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;name); ?&gt;&quot; &lt;?php checked($post-&gt;name, 'post'); ?&gt; /&gt;
-                                &lt;label for=&quot;find-posts-&lt;?php echo esc_attr($post-&gt;name); ?&gt;&quot;&gt;&lt;?php echo $post-&gt;label; ?&gt;&lt;/label&gt;
-                                &lt;?php
-                                } ?&gt;
</del><ins>+                                &lt;span class=&quot;spinner&quot;&gt;&lt;/span&gt;
+                                &lt;input type=&quot;button&quot; id=&quot;find-posts-search&quot; value=&quot;&lt;?php esc_attr_e( 'Search' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
</ins><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;div id=&quot;find-posts-response&quot;&gt;&lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;
</span></span></pre></div>
<a id="trunkwpadminjsmediajs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/media.js (22722 => 22723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/media.js        2012-11-20 18:31:06 UTC (rev 22722)
+++ trunk/wp-admin/js/media.js        2012-11-20 18:50:15 UTC (rev 22723)
</span><span class="lines">@@ -3,41 +3,63 @@
</span><span class="cx"> (function($){
</span><span class="cx">         findPosts = {
</span><span class="cx">                 open : function(af_name, af_val) {
</span><del>-                        var st = document.documentElement.scrollTop || $(document).scrollTop();
</del><ins>+                        var st = document.documentElement.scrollTop || $(document).scrollTop(),
+                                overlay = $( '.ui-find-overlay' );
</ins><span class="cx"> 
</span><ins>+                        if ( overlay.length == 0 ) {
+                                $( 'body' ).append( '&lt;div class=&quot;ui-find-overlay&quot;&gt;&lt;/div&gt;' );
+                                findPosts.overlay();
+                        }
+
+                        overlay.show();
+
</ins><span class="cx">                         if ( af_name &amp;&amp; af_val ) {
</span><span class="cx">                                 $('#affected').attr('name', af_name).val(af_val);
</span><span class="cx">                         }
</span><span class="cx">                         $('#find-posts').show().draggable({
</span><span class="cx">                                 handle: '#find-posts-head'
</span><del>-                        }).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-250px'});
</del><ins>+                        }).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-328px'});
</ins><span class="cx"> 
</span><span class="cx">                         $('#find-posts-input').focus().keyup(function(e){
</span><span class="cx">                                 if (e.which == 27) { findPosts.close(); } // close on Escape
</span><span class="cx">                         });
</span><span class="cx"> 
</span><ins>+                        // Pull some results up by default
+                        findPosts.send();
+
</ins><span class="cx">                         return false;
</span><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 close : function() {
</span><span class="cx">                         $('#find-posts-response').html('');
</span><span class="cx">                         $('#find-posts').draggable('destroy').hide();
</span><ins>+                        $( '.ui-find-overlay' ).hide();
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                overlay : function() {
+                        $( '.ui-find-overlay' ).css(
+                                { 'z-index': '999', 'width': $( document ).width() + 'px', 'height': $( document ).height() + 'px' }
+                        ).on('click', function () {
+                                findPosts.close();
+                        });
+                },
+
</ins><span class="cx">                 send : function() {
</span><span class="cx">                         var post = {
</span><del>-                                ps: $('#find-posts-input').val(),
-                                action: 'find_posts',
-                                _ajax_nonce: $('#_ajax_nonce').val(),
-                                post_type: $('input[name=&quot;find-posts-what&quot;]:checked').val()
-                        };
</del><ins>+                                        ps: $('#find-posts-input').val(),
+                                        action: 'find_posts',
+                                        _ajax_nonce: $('#_ajax_nonce').val()
+                                },
+                                spinner = $( '.find-box-search .spinner' );
</ins><span class="cx"> 
</span><ins>+                        spinner.show();
+
</ins><span class="cx">                         $.ajax({
</span><span class="cx">                                 type : 'POST',
</span><span class="cx">                                 url : ajaxurl,
</span><span class="cx">                                 data : post,
</span><del>-                                success : function(x) { findPosts.show(x); },
-                                error : function(r) { findPosts.error(r); }
</del><ins>+                                success : function(x) { findPosts.show(x); spinner.hide(); },
+                                error : function(r) { findPosts.error(r); spinner.hide(); }
</ins><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx"> 
</span><span class="lines">@@ -55,6 +77,11 @@
</span><span class="cx">                         }
</span><span class="cx">                         r = r.responses[0];
</span><span class="cx">                         $('#find-posts-response').html(r.data);
</span><ins>+
+                        // Enable whole row to be clicked
+                        $( '.found-posts td' ).on( 'click', function () {
+                                $( this ).parent().find( '.found-radio input' ).prop( 'checked', true );
+                        });
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 error : function(r) {
</span><span class="lines">@@ -91,4 +118,7 @@
</span><span class="cx">                         });
</span><span class="cx">                 });
</span><span class="cx">         });
</span><ins>+        $(window).resize(function() {
+                findPosts.overlay();
+        });
</ins><span class="cx"> })(jQuery);
</span></span></pre>
</div>
</div>

</body>
</html>