Ticket #5911: 5911-16.diff
| File 5911-16.diff, 7.6 kB (added by andy, 6 months ago) |
|---|
-
wp-includes/js/swfupload/handlers.js
old new 11 11 function fileQueued(fileObj) { 12 12 // Get rid of unused form 13 13 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 } 14 19 // 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>'); 16 21 17 22 // Disable the submit button 18 23 jQuery('#insert-media').attr('disabled', 'disabled'); … … 76 81 if ( jQuery('.type-form #media-items>*').length == 1 ) { 77 82 jQuery('#media-items .slidetoggle').slideDown(500).parent().eq(0).children('.toggle').toggle(); 78 83 jQuery('.type-form .slidetoggle').siblings().addClass('hidden'); 79 } else {80 jQuery('.type-form .slidetoggle').siblings().removeClass('hidden');81 84 } 82 85 83 86 // Only show Gallery button when there are at least two files. … … 117 120 118 121 // file-specific message 119 122 function wpFileError(fileObj, message) { 120 jQuery('#media-item-' + fileObj.id + ' .filename').a ppend('<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(); 121 124 jQuery('.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})}); 122 125 } 123 126 -
wp-includes/script-loader.php
old new 97 97 // these error messages came from the sample swfupload js, they might need changing. 98 98 $this->localize( 'swfupload-handlers', 'swfuploadL10n', array( 99 99 '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')), 101 101 'zero_byte_file' => __('The file you selected is empty. Please select another file.'), 102 102 'invalid_filetype' => __('The file you choose is not an allowed file type.'), 103 103 'default_error' => __('An error occurred in the upload. Please try again later.'), -
wp-admin/includes/media.php
old new 270 270 $alt = attribute_escape($_POST['insertonly']['alt']); 271 271 if ( isset($_POST['insertonly']['align']) ) { 272 272 $align = attribute_escape($_POST['insertonly']['align']); 273 $class = " class='align -$align'";273 $class = " class='align$align'"; 274 274 } 275 275 $html = "<img src='$src' alt='$alt'$class />"; 276 276 return media_send_to_editor($html); … … 602 602 603 603 foreach ( $attachments as $id => $attachment ) 604 604 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>"; 606 606 607 607 return $output; 608 608 } … … 645 645 $type 646 646 <a class='toggle describe-toggle-on' href='#'>$toggle_on</a> 647 647 <a class='toggle describe-toggle-off' href='#'>$toggle_off</a> 648 < span class='filename new'>$filename</span>648 <div class='filename new'>$filename</div> 649 649 <table class='slidetoggle describe $class'><tbody> 650 650 <tr> 651 651 <td class='A1B1' rowspan='4' colspan='2'><img class='thumbnail' src='$thumb_url' alt='' /></td> … … 730 730 return $item; 731 731 } 732 732 733 function media_upload_header($title = false) { 734 if ( empty($title) ) 735 $title = __('Choose a File'); 733 function media_upload_header() { 736 734 ?> 737 735 <script type="text/javascript">post_id = <?php echo intval($_REQUEST['post_id']); ?>;</script> 738 736 <div id="media-upload-header"> 739 <h3><?php echo $title ?></h3>740 737 <?php the_media_upload_tabs(); ?> 741 738 </div> 742 739 <?php … … 856 853 } 857 854 858 855 function media_upload_gallery_form($errors) { 859 media_upload_header( __('Browse attached files'));856 media_upload_header(); 860 857 861 858 $post_id = intval($_REQUEST['post_id']); 862 859 … … 894 891 function media_upload_library_form($errors) { 895 892 global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types; 896 893 897 media_upload_header( __('Browse Media Library'));894 media_upload_header(); 898 895 899 896 $post_id = intval($_REQUEST['post_id']); 900 897 -
wp-admin/css/media.css
old new 1 1 div#media-upload-header { 2 2 background-color: #e4f2fd; 3 3 margin: 0; 4 padding: 1em 0.5em 0 0.5em;4 padding: 0 5px; 5 5 font-weight: bold; 6 6 position: relative; 7 7 border-bottom: 1px solid #c6d9e9; 8 height: 2.5em; 8 9 } 9 10 10 11 ul#sidemenu { 11 12 font-weight: normal; 12 margin: 0 15px;13 margin: 0 5px; 13 14 position: absolute; 14 right: 1em;15 left: 0px; 15 16 bottom: -1px; 16 17 } 17 18 … … 21 22 color: #f00; 22 23 } 23 24 24 .file-error {25 font-weight: bold;26 color: #f00;27 margin: 0 15px;28 }29 30 25 form { 31 26 margin: 1em; 32 27 } … … 59 54 margin: 0 0 1em 0; 60 55 padding: 0; 61 56 } 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 57 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 */80 58 /* specific to the image upload form */ 81 59 .align .field label { 82 60 display: inline; … … 128 106 border-bottom: 1px solid #d0d0d0; 129 107 width: 623px; 130 108 position: relative; 109 min-height: 36px; 131 110 } 132 span.filename { 133 position: absolute; 134 left: 46px; 135 top: 0px; 111 .filename { 136 112 line-height: 36px; 113 margin-left: 50px; 137 114 z-index: 2; 138 115 } 116 button.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 139 128 .progress { 129 position: absolute; 130 top: 0px; 131 left: 0px; 140 132 width: 623px; 141 133 height: 36px; 142 134 } 143 135 .bar { 144 136 width: 0px; 145 height: 36px;137 height: 100%; 146 138 background-color: #e8e8e8; 147 139 border-right: 3px solid #99d; 148 140 } … … 161 153 border-top: 1px solid #d0d0d0; 162 154 padding: 5px; 163 155 width: 100%; 156 clear: both; 164 157 } 165 158 .describe.startopen, .describe.startclosed { 166 159 display: none; … … 201 194 left: 0px; 202 195 cursor: pointer; 203 196 border: none; 204 z-index: 10; 197 z-index: 3; 198 height: 36px; 205 199 } 206 200 tr.align td.field { 207 201 text-align: center;
