WordPress.org

Make WordPress Core

Changeset 7160


Ignore:
Timestamp:
03/05/2008 06:46:42 AM (10 years ago)
Author:
ryan
Message:

Improve upload_max_filesize error. Improve error display for long messages. New uploads now added to bottom, not top. Fix align class. Remove redundant header text. Props andy. see #5911

Location:
trunk
Files:
4 edited

Legend:

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

    r7100 r7160  
    22    background-color: #e4f2fd;
    33    margin: 0;
    4     padding: 1em 0.5em 0 0.5em;
     4    padding: 0 5px;
    55    font-weight: bold;
    66    position: relative;
    77    border-bottom: 1px solid #c6d9e9;
     8    height: 2.5em;
    89}
    910
    1011ul#sidemenu {
    1112    font-weight: normal;
    12     margin: 0 15px;
    13     position: absolute;
    14     right: 1em;
     13    margin: 0 5px;
     14    position: absolute;
     15    left: 0px;
    1516    bottom: -1px;
    1617}
     
    2021    font-weight: bold;
    2122    color: #f00;
    22 }
    23 
    24 .file-error {
    25     font-weight: bold;
    26     color: #f00;
    27     margin: 0 15px;
    2823}
    2924
     
    6055    padding: 0;
    6156}
    62 /*
    63 .media-upload-form button.button-ok {
    64     float: right;
    65     background-color: #ebebeb;
    66     color: #1f4569;
    67     border: none;
    68     padding: 0.5em;
    69 }
    70 
    71 .media-upload-form a.button-cancel {
    72     float: right;
    73     background-color: #fff;
    74     color: #9a9a9a;
    75     font-size: 0.8em;
    76     text-decoration: underline;
    77     margin: 0.5em 1em;
    78 }
    79 */
     57
    8058/* specific to the image upload form */
    8159.align .field label {
     
    129107    width: 623px;
    130108    position: relative;
    131 }
    132 span.filename {
    133     position: absolute;
    134     left: 46px;
     109    min-height: 36px;
     110}
     111.filename {
     112    line-height: 36px;
     113    margin-left: 50px;
     114    z-index: 2;
     115}
     116button.dismiss {
     117    position: absolute;
     118    top: 5px;
     119    right: 5px;
     120    z-index: 4;
     121}
     122.file-error {
     123    margin: 0 0 5px 50px;
     124    font-weight: bold;
     125    color: #f00;
     126}
     127
     128.progress {
     129    position: absolute;
    135130    top: 0px;
    136     line-height: 36px;
    137     z-index: 2;
    138 }
    139 .progress {
     131    left: 0px;
    140132    width: 623px;
    141133    height: 36px;
     
    143135.bar {
    144136    width: 0px;
    145     height: 36px;
     137    height: 100%;
    146138    background-color: #e8e8e8;
    147139    border-right: 3px solid #99d;
     
    162154    padding: 5px;
    163155    width: 100%;
     156    clear: both;
    164157}
    165158.describe.startopen, .describe.startclosed {
     
    202195    cursor: pointer;
    203196    border: none;
    204     z-index: 10;
     197    z-index: 3;
     198    height: 36px;
    205199}
    206200tr.align td.field {
  • trunk/wp-admin/includes/media.php

    r7151 r7160  
    271271        if ( isset($_POST['insertonly']['align']) ) {
    272272            $align = attribute_escape($_POST['insertonly']['align']);
    273             $class = " class='align-$align'";
     273            $class = " class='align$align'";
    274274        }
    275275        $html = "<img src='$src' alt='$alt'$class />";
     
    603603    foreach ( $attachments as $id => $attachment )
    604604        if ( $item = get_media_item($id, isset($errors[$id]) ? $errors[$id] : null) )
    605             $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div id='media-upload-error-$id'></div><span class='filename'></span><div class='progress'><div class='bar'></div></div>$item<div class='progress clickmask'></div>\n</div>";
     605            $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div id='media-upload-error-$id'></div><div class='filename'></div><div class='progress'><div class='bar'></div></div>$item<div class='progress clickmask'></div>\n</div>";
    606606
    607607    return $output;
     
    646646    <a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
    647647    <a class='toggle describe-toggle-off' href='#'>$toggle_off</a>
    648     <span class='filename new'>$filename</span>
     648    <div class='filename new'>$filename</div>
    649649    <table class='slidetoggle describe $class'><tbody>
    650650        <tr>
     
    731731}
    732732
    733 function media_upload_header($title = false) {
    734     if ( empty($title) )
    735         $title = __('Choose a File');
     733function media_upload_header() {
    736734    ?>
    737735    <script type="text/javascript">post_id = <?php echo intval($_REQUEST['post_id']); ?>;</script>
    738736    <div id="media-upload-header">
    739     <h3><?php echo $title ?></h3>
    740737    <?php the_media_upload_tabs(); ?>
    741738    </div>
     
    857854
    858855function media_upload_gallery_form($errors) {
    859     media_upload_header(__('Browse attached files'));
     856    media_upload_header();
    860857
    861858    $post_id = intval($_REQUEST['post_id']);
     
    895892    global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
    896893
    897     media_upload_header(__('Browse Media Library'));
     894    media_upload_header();
    898895
    899896    $post_id = intval($_REQUEST['post_id']);
  • trunk/wp-includes/js/swfupload/handlers.js

    r7100 r7160  
    1212    // Get rid of unused form
    1313    jQuery('.media-blank').remove();
     14    // Collapse a single item
     15    if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {
     16        jQuery('.toggle').toggle();
     17        jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
     18    }
    1419    // Create a progress bar containing the filename
    15     jQuery('#media-items').prepend('<div id="media-item-' + fileObj.id + '" class="media-item child-of-' + post_id + '"><span class="filename original">' + fileObj.name + '</span><div class="progress"><div class="bar"></div></div></div>');
     20    jQuery('#media-items').append('<div id="media-item-' + fileObj.id + '" class="media-item child-of-' + post_id + '"><div class="filename original">' + fileObj.name + '</div><div class="progress"><div class="bar"></div></div></div>');
    1621
    1722    // Disable the submit button
     
    7782        jQuery('#media-items .slidetoggle').slideDown(500).parent().eq(0).children('.toggle').toggle();
    7883        jQuery('.type-form .slidetoggle').siblings().addClass('hidden');
    79     } else {
    80         jQuery('.type-form .slidetoggle').siblings().removeClass('hidden');
    8184    }
    8285
     
    118121// file-specific message
    119122function wpFileError(fileObj, message) {
    120     jQuery('#media-item-' + fileObj.id + ' .filename').append('<span class="file-error">'+message+'</span> <button type="button" class="button dismiss">'+swfuploadL10n.dismiss+'</button>');
     123    jQuery('#media-item-' + fileObj.id + ' .filename').after('<div class="file-error"><button type="button" class="button dismiss">'+swfuploadL10n.dismiss+'</button>'+message+'</div>').siblings('.progress').remove();
    121124    jQuery('.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})});
    122125}
  • trunk/wp-includes/script-loader.php

    r7153 r7160  
    9898        $this->localize( 'swfupload-handlers', 'swfuploadL10n', array(
    9999                'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
    100                 'file_exceeds_size_limit' => __('This file is too big. See php.ini.'),
     100                'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), ini_get('upload_max_filesize')),
    101101                'zero_byte_file' => __('The file you selected is empty. Please select another file.'),
    102102                'invalid_filetype' => __('The file you choose is not an allowed file type.'),
Note: See TracChangeset for help on using the changeset viewer.