Make WordPress Core

Ticket #26952: 26952.3.patch

File 26952.3.patch, 7.6 KB (added by iseulde, 11 years ago)
  • src/wp-admin/css/media.css

     
    233233------------------------------------------------------------------------------*/
    234234
    235235.find-box {
     236        background-color: #fff;
    236237        width: 600px;
    237         height: 300px;
    238238        overflow: hidden;
    239         padding: 33px 0 51px;
    240         position: absolute;
    241         z-index: 1000;
    242         background-color: #444;
     239        margin-left: -300px;
     240        position: fixed;
     241        top: 30px;
     242        left: 50%;
     243        z-index: 160000;
    243244}
    244245
    245246.find-box-head {
    246247        cursor: move;
    247         color: #eee;
     248        background: #fcfcfc;
     249        border-bottom: 1px solid #dfdfdf;
     250        height: 40px;
     251        font-size: 22px;
    248252        font-weight: 600;
    249         height: 2em;
    250         line-height: 2em;
    251         padding: 1px 12px;
    252         position: absolute;
    253         top: 5px;
    254         width: 100%;
     253        line-height: 40px;
     254        padding: 0 40px 0 16px;
    255255}
    256256
    257257.find-box-inside {
    258258        overflow: auto;
    259         padding: 6px;
    260         height: 100%;
     259        padding: 16px;
    261260        background-color: #fff;
     261        max-height: 300px;
     262        overflow-y: scroll;
    262263}
    263264
    264 .find-box-search,
    265 .find-box-buttons {
    266         overflow: hidden;
    267         padding: 8px;
    268         position: relative;
    269         background-color: #f7f7f7;
    270         border-top: 1px solid #dfdfdf;
     265.find-box-search {
     266        padding-bottom: 16px;
    271267}
    272268
    273269.find-box-search .spinner {
     
    277273        top: 9px;
    278274}
    279275
    280 #find-posts-input {
     276#find-posts-input,
     277#find-posts-search {
    281278        float: left;
     279}
     280
     281#find-posts-input {
    282282        width: 140px;
    283         height: 24px;
     283        height: 28px;
     284        margin: 0 4px 0 0;
    284285}
    285286
    286 #find-posts-search {
    287         float: left;
    288         margin: 1px 4px 0 3px;
     287.found-radio {
     288        width: 16px;
    289289}
    290290
    291 #find-posts-response {
    292         margin: 8px 0;
    293         padding: 0 1px 6px;
     291#find-posts-close {
     292        width: 40px;
     293        height: 40px;
     294        position: absolute;
     295        top: 0;
     296        right: 0;
     297        cursor: pointer;
     298        text-align: center;
     299        color: #666;
    294300}
    295301
    296 #find-posts-response table {
    297         width: 100%;
     302#find-posts-close:hover {
     303        color: #2ea2cc;
    298304}
    299305
    300 #find-posts-response .found-radio {
    301         padding: 3px 0 0 8px;
    302         width: 15px;
     306#find-posts-close:before {
     307        font: normal 20px/40px 'dashicons';
     308        vertical-align: top;
     309        speak: none;
     310        -webkit-font-smoothing: antialiased;
     311        -moz-osx-font-smoothing: grayscale;
     312        content: '\f158';
     313}
     314
     315.find-box-buttons {
     316        padding: 6px 16px;
     317        background: #fcfcfc;
     318        border-top: 1px solid #dfdfdf;
    303319}
    304320
    305321.find-box #resize-se {
     
    309325}
    310326
    311327.ui-find-overlay {
    312         position: absolute;
     328        position: fixed;
    313329        top: 0;
    314330        left: 0;
    315         background-color: #000;
    316         opacity: 0.6;
    317         filter: alpha(opacity=60);
     331        right: 0;
     332        bottom: 0;
     333        background: #000;
     334        opacity: 0.7;
     335        z-index: 159900;
    318336}
    319337
    320338ul#dismissed-updates {
  • src/wp-admin/includes/ajax-actions.php

     
    14311431                wp_die( __('No items found.') );
    14321432
    14331433        $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>';
     1434        $alt = '';
    14341435        foreach ( $posts as $post ) {
    14351436                $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
     1437                $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
    14361438
    14371439                switch ( $post->post_status ) {
    14381440                        case 'publish' :
     
    14571459                        $time = mysql2date(__('Y/m/d'), $post->post_date);
    14581460                }
    14591461
    1460                 $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>';
     1462                $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>';
    14611463                $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";
    14621464        }
    14631465
  • src/wp-admin/includes/template.php

     
    13761376 */
    13771377function find_posts_div($found_action = '') {
    13781378?>
    1379         <div id="find-posts" class="find-box" style="display:none;">
    1380                 <div id="find-posts-head" class="find-box-head"><?php _e('Find Posts or Pages'); ?></div>
     1379        <div id="find-posts" class="find-box" style="display: none;">
     1380                <div id="find-posts-head" class="find-box-head">
     1381                        <?php _e( 'Find Posts or Pages' ); ?>
     1382                        <div id="find-posts-close"></div>
     1383                </div>
    13811384                <div class="find-box-inside">
    13821385                        <div class="find-box-search">
    13831386                                <?php if ( $found_action ) { ?>
    13841387                                        <input type="hidden" name="found_action" value="<?php echo esc_attr($found_action); ?>" />
    13851388                                <?php } ?>
    1386 
    13871389                                <input type="hidden" name="affected" id="affected" value="" />
    13881390                                <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
    13891391                                <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
    13901392                                <input type="text" id="find-posts-input" name="ps" value="" />
    13911393                                <span class="spinner"></span>
    13921394                                <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
     1395                                <div class="clear"></div>
    13931396                        </div>
    13941397                        <div id="find-posts-response"></div>
    13951398                </div>
    13961399                <div class="find-box-buttons">
    1397                         <input id="find-posts-close" type="button" class="button alignleft" value="<?php esc_attr_e('Close'); ?>" />
    13981400                        <?php submit_button( __( 'Select' ), 'button-primary alignright', 'find-posts-submit', false ); ?>
     1401                        <div class="clear"></div>
    13991402                </div>
    14001403        </div>
    14011404<?php
  • src/wp-admin/js/media.js

     
    1919                        }
    2020                        $('#find-posts').show().draggable({
    2121                                handle: '#find-posts-head'
    22                         }).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-328px'});
     22                        });
     23                       
     24                        $('.find-box-inside').css({
     25                                'max-height': $( window ).height() - ( ( 30 + 40 + 1 + 16 ) * 2 ) + 'px'
     26                        });
    2327
    2428                        $('#find-posts-input').focus().keyup(function(e){
    2529                                if (e.which == 27) { findPosts.close(); } // close on Escape
     
    3842                },
    3943
    4044                overlay : function() {
    41                         $( '.ui-find-overlay' ).css(
    42                                 { 'z-index': '999', 'width': $( document ).width() + 'px', 'height': $( document ).height() + 'px' }
    43                         ).on('click', function () {
     45                        $( '.ui-find-overlay' ).on( 'click', function () {
    4446                                findPosts.close();
    4547                        });
    4648                },
     
    120122                });
    121123        });
    122124        $(window).resize(function() {
    123                 findPosts.overlay();
     125                $('.find-box-inside').css({
     126                        'max-height': $( window ).height() - ( ( 30 + 40 + 1 + 16 ) * 2 ) + 'px'
     127                });
    124128        });
    125129})(jQuery);
  • src/wp-admin/upload.php

     
    145145wp_enqueue_script( 'jquery-ui-draggable' );
    146146wp_enqueue_script( 'media' );
    147147
     148add_action( 'admin_print_footer_scripts', 'find_posts_div' );
     149
    148150add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
    149151
    150152get_current_screen()->add_help_tab( array(
     
    238240
    239241<?php $wp_list_table->display(); ?>
    240242
    241 <div id="ajax-response"></div>
    242 <?php find_posts_div(); ?>
    243 <br class="clear" />
    244 
    245243</form>
    246244</div>
    247245
     246<div id="ajax-response"></div>
     247
    248248<?php
    249249include( ABSPATH . 'wp-admin/admin-footer.php' );