<!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' => true ), 'objects' );
+        unset( $post_types['attachment'] );
</ins><span class="cx">
</span><del>-        if ( !empty($_POST['post_type']) && in_array( $_POST['post_type'], get_post_types() ) )
-                $what = $_POST['post_type'];
-        else
-                $what = 'post';
-
-        $s = stripslashes($_POST['ps']);
-        preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $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 .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
-                $searchand = ' AND ';
-        }
-        $term = esc_sql( like_escape( $s ) );
-        if ( count($search_terms) > 1 && $search_terms[0] != $s )
-                $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
</del><ins>+        $args = array(
+                'post_type' => array_keys( $post_types ),
+                'post_status' => 'any',
+                'posts_per_page' => 50,
+        );
+        if ( '' !== $s )
+                $args['s'] = $s;
</ins><span class="cx">
</span><del>-        $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" );
</del><ins>+        $posts = get_posts( $args );
</ins><span class="cx">
</span><del>-        if ( ! $posts ) {
-                $posttype = get_post_type_object($what);
-                wp_die( $posttype->labels->not_found );
-        }
</del><ins>+        if ( ! $posts )
+                wp_die( __('No items found.') );
</ins><span class="cx">
</span><del>-        $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
</del><ins>+        $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th class="no-break">'.__('Type').'</th><th class="no-break">'.__('Date').'</th><th class="no-break">'.__('Status').'</th></tr></thead><tbody>';
</ins><span class="cx">         foreach ( $posts as $post ) {
</span><ins>+                $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
</ins><span class="cx">
</span><span class="cx">                 switch ( $post->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 .= '<tr class="found-posts"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
</span><del>-                $html .= '<td><label for="found-'.$post->ID.'">'.esc_html( $post->post_title ).'</label></td><td>'.esc_html( $time ).'</td><td>'.esc_html( $stat ).'</td></tr>'."\n\n";
</del><ins>+                $html .= '<td><label for="found-'.$post->ID.'">' . esc_html( $title ) . '</label></td><td class="no-break">' . esc_html( $post_types[$post->post_type]->labels->singular_name ) . '</td><td class="no-break">'.esc_html( $time ) . '</td><td class="no-break">' . esc_html( $stat ). ' </td></tr>' . "\n\n";
</ins><span class="cx">         }
</span><ins>+
</ins><span class="cx">         $html .= '</tbody></table>';
</span><span class="cx">
</span><span class="cx">         $x = new WP_Ajax_Response();
</span><span class="cx">         $x->add( array(
</span><del>-                'what' => $what,
</del><span class="cx">                 'data' => $html
</span><span class="cx">         ));
</span><span class="cx">         $x->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">                                 <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
</span><span class="cx">                                 <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
</span><span class="cx">                                 <input type="text" id="find-posts-input" name="ps" value="" />
</span><del>-                                <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
-
-                                <?php
-                                $post_types = get_post_types( array('public' => true), 'objects' );
-                                foreach ( $post_types as $post ) {
-                                        if ( 'attachment' == $post->name )
-                                                continue;
-                                ?>
-                                <input type="radio" name="find-posts-what" id="find-posts-<?php echo esc_attr($post->name); ?>" value="<?php echo esc_attr($post->name); ?>" <?php checked($post->name, 'post'); ?> />
-                                <label for="find-posts-<?php echo esc_attr($post->name); ?>"><?php echo $post->label; ?></label>
-                                <?php
-                                } ?>
</del><ins>+                                <span class="spinner"></span>
+                                <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
</ins><span class="cx">                         </div>
</span><span class="cx">                         <div id="find-posts-response"></div>
</span><span class="cx">                 </div>
</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( '<div class="ui-find-overlay"></div>' );
+                                findPosts.overlay();
+                        }
+
+                        overlay.show();
+
</ins><span class="cx">                         if ( af_name && 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="find-posts-what"]: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>