<!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>[27401] trunk/src/wp-admin: Restyles the modal for attaching media to posts, props avryl, see #26952</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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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/27401">27401</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2014-03-04 23:10:35 +0000 (Tue, 04 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Restyles the modal for attaching media to posts, props avryl, see <a href="http://core.trac.wordpress.org/ticket/26952">#26952</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincssmediacss">trunk/src/wp-admin/css/media.css</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludestemplatephp">trunk/src/wp-admin/includes/template.php</a></li>
<li><a href="#trunksrcwpadminjsmediajs">trunk/src/wp-admin/js/media.js</a></li>
<li><a href="#trunksrcwpadminuploadphp">trunk/src/wp-admin/upload.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincssmediacss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/css/media.css (27400 => 27401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/css/media.css 2014-03-04 21:09:32 UTC (rev 27400)
+++ trunk/src/wp-admin/css/media.css    2014-03-04 23:10:35 UTC (rev 27401)
</span><span class="lines">@@ -233,41 +233,39 @@
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span><span class="cx"> 
</span><span class="cx"> .find-box {
</span><ins>+       background-color: #fff;
</ins><span class="cx">   width: 600px;
</span><del>-       height: 300px;
</del><ins>+        max-width: 100%;
</ins><span class="cx">   overflow: hidden;
</span><del>-       padding: 33px 0 51px;
-       position: absolute;
-       z-index: 1000;
-       background-color: #444;
</del><ins>+        margin-left: -300px;
+       position: fixed;
+       top: 30px;
+       left: 50%;
+       z-index: 160000;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box-head {
</span><span class="cx">  cursor: move;
</span><del>-       color: #eee;
</del><ins>+        background: #fcfcfc;
+       border-bottom: 1px solid #dfdfdf;
+       height: 40px;
+       font-size: 22px;
</ins><span class="cx">   font-weight: 600;
</span><del>-       height: 2em;
-       line-height: 2em;
-       padding: 1px 12px;
-       position: absolute;
-       top: 5px;
-       width: 100%;
</del><ins>+        line-height: 40px;
+       padding: 0 40px 0 16px;
+       overflow: hidden;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box-inside {
</span><span class="cx">  overflow: auto;
</span><del>-       padding: 6px;
-       height: 100%;
</del><ins>+        padding: 16px;
</ins><span class="cx">   background-color: #fff;
</span><ins>+       max-height: 300px;
+       overflow-y: scroll;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.find-box-search,
-.find-box-buttons {
-       overflow: hidden;
-       padding: 8px;
-       position: relative;
-       background-color: #f7f7f7;
-       border-top: 1px solid #dfdfdf;
</del><ins>+.find-box-search {
+       padding-bottom: 16px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .find-box-search .spinner {
</span><span class="lines">@@ -277,31 +275,51 @@
</span><span class="cx">  top: 9px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#find-posts-input,
+#find-posts-search {
+       float: left;
+}
+
</ins><span class="cx"> #find-posts-input {
</span><del>-       float: left;
</del><span class="cx">   width: 140px;
</span><del>-       height: 24px;
</del><ins>+        height: 28px;
+       margin: 0 4px 0 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#find-posts-search {
-       float: left;
-       margin: 1px 4px 0 3px;
</del><ins>+.found-radio {
+       width: 16px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#find-posts-response {
-       margin: 8px 0;
-       padding: 0 1px 6px;
</del><ins>+#find-posts-close {
+       width: 40px;
+       height: 40px;
+       position: absolute;
+       top: 0;
+       right: 0;
+       cursor: pointer;
+       text-align: center;
+       color: #666;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#find-posts-response table {
-       width: 100%;
</del><ins>+#find-posts-close:hover {
+       color: #2ea2cc;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#find-posts-response .found-radio {
-       padding: 3px 0 0 8px;
-       width: 15px;
</del><ins>+#find-posts-close:before {
+       font: normal 20px/40px 'dashicons';
+       vertical-align: top;
+       speak: none;
+       -webkit-font-smoothing: antialiased;
+       -moz-osx-font-smoothing: grayscale;
+       content: '\f158';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.find-box-buttons {
+       padding: 6px 16px;
+       background: #fcfcfc;
+       border-top: 1px solid #dfdfdf;
+}
+
</ins><span class="cx"> .find-box #resize-se {
</span><span class="cx">  position: absolute;
</span><span class="cx">  right: 1px;
</span><span class="lines">@@ -309,12 +327,14 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .ui-find-overlay {
</span><del>-       position: absolute;
</del><ins>+        position: fixed;
</ins><span class="cx">   top: 0;
</span><span class="cx">  left: 0;
</span><del>-       background-color: #000;
-       opacity: 0.6;
-       filter: alpha(opacity=60);
</del><ins>+        right: 0;
+       bottom: 0;
+       background: #000;
+       opacity: 0.7;
+       z-index: 159900;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ul#dismissed-updates {
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ajax-actions.php (27400 => 27401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ajax-actions.php     2014-03-04 21:09:32 UTC (rev 27400)
+++ trunk/src/wp-admin/includes/ajax-actions.php        2014-03-04 23:10:35 UTC (rev 27401)
</span><span class="lines">@@ -1431,8 +1431,10 @@
</span><span class="cx">          wp_die( __('No items found.') );
</span><span class="cx"> 
</span><span class="cx">  $html = '<table class="widefat"><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>';
</span><ins>+       $alt = '';
</ins><span class="cx">   foreach ( $posts as $post ) {
</span><span class="cx">          $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
</span><ins>+               $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
</ins><span class="cx"> 
</span><span class="cx">          switch ( $post->post_status ) {
</span><span class="cx">                  case 'publish' :
</span><span class="lines">@@ -1457,7 +1459,7 @@
</span><span class="cx">                  $time = mysql2date(__('Y/m/d'), $post->post_date);
</span><span class="cx">          }
</span><span class="cx"> 
</span><del>-               $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>';
</del><ins>+                $html .= '<tr class="' . trim( 'found-posts ' . $alt ) . '"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
</ins><span class="cx">           $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";
</span><span class="cx">  }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/template.php (27400 => 27401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/template.php 2014-03-04 21:09:32 UTC (rev 27400)
+++ trunk/src/wp-admin/includes/template.php    2014-03-04 23:10:35 UTC (rev 27401)
</span><span class="lines">@@ -1376,26 +1376,29 @@
</span><span class="cx">  */
</span><span class="cx"> function find_posts_div($found_action = '') {
</span><span class="cx"> ?>
</span><del>-       <div id="find-posts" class="find-box" style="display:none;">
-               <div id="find-posts-head" class="find-box-head"><?php _e('Find Posts or Pages'); ?></div>
</del><ins>+        <div id="find-posts" class="find-box" style="display: none;">
+               <div id="find-posts-head" class="find-box-head">
+                       <?php _e( 'Find Posts or Pages' ); ?>
+                       <div id="find-posts-close"></div>
+               </div>
</ins><span class="cx">           <div class="find-box-inside">
</span><span class="cx">                  <div class="find-box-search">
</span><span class="cx">                          <?php if ( $found_action ) { ?>
</span><span class="cx">                                  <input type="hidden" name="found_action" value="<?php echo esc_attr($found_action); ?>" />
</span><span class="cx">                          <?php } ?>
</span><del>-
</del><span class="cx">                           <input type="hidden" name="affected" id="affected" value="" />
</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><span class="cx">                          <span class="spinner"></span>
</span><span class="cx">                          <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
</span><ins>+                               <div class="clear"></div>
</ins><span class="cx">                   </div>
</span><span class="cx">                  <div id="find-posts-response"></div>
</span><span class="cx">          </div>
</span><span class="cx">          <div class="find-box-buttons">
</span><del>-                       <input id="find-posts-close" type="button" class="button alignleft" value="<?php esc_attr_e('Close'); ?>" />
</del><span class="cx">                   <?php submit_button( __( 'Select' ), 'button-primary alignright', 'find-posts-submit', false ); ?>
</span><ins>+                       <div class="clear"></div>
</ins><span class="cx">           </div>
</span><span class="cx">  </div>
</span><span class="cx"> <?php
</span></span></pre></div>
<a id="trunksrcwpadminjsmediajs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/media.js (27400 => 27401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/media.js   2014-03-04 21:09:32 UTC (rev 27400)
+++ trunk/src/wp-admin/js/media.js      2014-03-04 23:10:35 UTC (rev 27401)
</span><span class="lines">@@ -19,8 +19,12 @@
</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':'-328px'});
</del><ins>+                        });
</ins><span class="cx"> 
</span><ins>+                       $('.find-box-inside').css({
+                               'max-height': $( window ).height() - ( ( 30 + 40 + 1 + 16 ) * 2 ) + 'px'
+                       });
+
</ins><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="lines">@@ -38,9 +42,7 @@
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          overlay : function() {
</span><del>-                       $( '.ui-find-overlay' ).css(
-                               { 'z-index': '999', 'width': $( document ).width() + 'px', 'height': $( document ).height() + 'px' }
-                       ).on('click', function () {
</del><ins>+                        $( '.ui-find-overlay' ).on( 'click', function () {
</ins><span class="cx">                           findPosts.close();
</span><span class="cx">                  });
</span><span class="cx">          },
</span><span class="lines">@@ -120,6 +122,8 @@
</span><span class="cx">          });
</span><span class="cx">  });
</span><span class="cx">  $(window).resize(function() {
</span><del>-               findPosts.overlay();
</del><ins>+                $('.find-box-inside').css({
+                       'max-height': $( window ).height() - ( ( 30 + 40 + 1 + 16 ) * 2 ) + 'px'
+               });
</ins><span class="cx">   });
</span><span class="cx"> })(jQuery);
</span></span></pre></div>
<a id="trunksrcwpadminuploadphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/upload.php (27400 => 27401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/upload.php    2014-03-04 21:09:32 UTC (rev 27400)
+++ trunk/src/wp-admin/upload.php       2014-03-04 23:10:35 UTC (rev 27401)
</span><span class="lines">@@ -145,6 +145,8 @@
</span><span class="cx"> wp_enqueue_script( 'jquery-ui-draggable' );
</span><span class="cx"> wp_enqueue_script( 'media' );
</span><span class="cx"> 
</span><ins>+add_action( 'admin_print_footer_scripts', 'find_posts_div' );
+
</ins><span class="cx"> add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
</span><span class="cx"> 
</span><span class="cx"> get_current_screen()->add_help_tab( array(
</span><span class="lines">@@ -238,12 +240,10 @@
</span><span class="cx"> 
</span><span class="cx"> <?php $wp_list_table->display(); ?>
</span><span class="cx"> 
</span><del>-<div id="ajax-response"></div>
-<?php find_posts_div(); ?>
-<br class="clear" />
-
</del><span class="cx"> </form>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><ins>+<div id="ajax-response"></div>
+
</ins><span class="cx"> <?php
</span><span class="cx"> include( ABSPATH . 'wp-admin/admin-footer.php' );
</span></span></pre>
</div>
</div>

</body>
</html>