Make WordPress Core

Changeset 27401


Ignore:
Timestamp:
03/04/2014 11:10:35 PM (13 years ago)
Author:
azaozz
Message:

Restyles the modal for attaching media to posts, props avryl, see #26952

Location:
trunk/src/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/media.css

    r27328 r27401  
    234234
    235235.find-box {
     236        background-color: #fff;
    236237        width: 600px;
    237         height: 300px;
     238        max-width: 100%;
    238239        overflow: hidden;
    239         padding: 33px 0 51px;
    240         position: absolute;
    241         z-index: 1000;
    242         background-color: #444;
     240        margin-left: -300px;
     241        position: fixed;
     242        top: 30px;
     243        left: 50%;
     244        z-index: 160000;
    243245}
    244246
    245247.find-box-head {
    246248        cursor: move;
    247         color: #eee;
     249        background: #fcfcfc;
     250        border-bottom: 1px solid #dfdfdf;
     251        height: 40px;
     252        font-size: 22px;
    248253        font-weight: 600;
    249         height: 2em;
    250         line-height: 2em;
    251         padding: 1px 12px;
    252         position: absolute;
    253         top: 5px;
    254         width: 100%;
     254        line-height: 40px;
     255        padding: 0 40px 0 16px;
     256        overflow: hidden;
    255257}
    256258
    257259.find-box-inside {
    258260        overflow: auto;
    259         padding: 6px;
    260         height: 100%;
     261        padding: 16px;
    261262        background-color: #fff;
    262 }
    263 
    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;
     263        max-height: 300px;
     264        overflow-y: scroll;
     265}
     266
     267.find-box-search {
     268        padding-bottom: 16px;
    271269}
    272270
    … …  
    278276}
    279277
    280 #find-posts-input {
    281         float: left;
    282         width: 140px;
    283         height: 24px;
    284 }
    285 
     278#find-posts-input,
    286279#find-posts-search {
    287280        float: left;
    288         margin: 1px 4px 0 3px;
    289 }
    290 
    291 #find-posts-response {
    292         margin: 8px 0;
    293         padding: 0 1px 6px;
    294 }
    295 
    296 #find-posts-response table {
    297         width: 100%;
    298 }
    299 
    300 #find-posts-response .found-radio {
    301         padding: 3px 0 0 8px;
    302         width: 15px;
     281}
     282
     283#find-posts-input {
     284        width: 140px;
     285        height: 28px;
     286        margin: 0 4px 0 0;
     287}
     288
     289.found-radio {
     290        width: 16px;
     291}
     292
     293#find-posts-close {
     294        width: 40px;
     295        height: 40px;
     296        position: absolute;
     297        top: 0;
     298        right: 0;
     299        cursor: pointer;
     300        text-align: center;
     301        color: #666;
     302}
     303
     304#find-posts-close:hover {
     305        color: #2ea2cc;
     306}
     307
     308#find-posts-close:before {
     309        font: normal 20px/40px 'dashicons';
     310        vertical-align: top;
     311        speak: none;
     312        -webkit-font-smoothing: antialiased;
     313        -moz-osx-font-smoothing: grayscale;
     314        content: '\f158';
     315}
     316
     317.find-box-buttons {
     318        padding: 6px 16px;
     319        background: #fcfcfc;
     320        border-top: 1px solid #dfdfdf;
    303321}
    304322
    … …  
    310328
    311329.ui-find-overlay {
    312         position: absolute;
     330        position: fixed;
    313331        top: 0;
    314332        left: 0;
    315         background-color: #000;
    316         opacity: 0.6;
    317         filter: alpha(opacity=60);
     333        right: 0;
     334        bottom: 0;
     335        background: #000;
     336        opacity: 0.7;
     337        z-index: 159900;
    318338}
    319339
  • trunk/src/wp-admin/includes/ajax-actions.php

    r27305 r27401  
    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 ) {
    … …  
    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        }
  • trunk/src/wp-admin/includes/template.php

    r27237 r27401  
    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">
    … …  
    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 ); ?>
    … …  
    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>
  • trunk/src/wp-admin/js/media.js

    r26200 r27401  
    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){
    … …  
    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                        });
    … …  
    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);
  • trunk/src/wp-admin/upload.php

    r26518 r27401  
    145145wp_enqueue_script( 'jquery-ui-draggable' );
    146146wp_enqueue_script( 'media' );
     147
     148add_action( 'admin_print_footer_scripts', 'find_posts_div' );
    147149
    148150add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
    … …  
    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' );
Note: See TracChangeset for help on using the changeset viewer.