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

git-svn-id: http://svn.automattic.com/wordpress/trunk@7160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-03-05 06:46:42 +00:00
parent 71d63f9b3e
commit 0e9ffe90bb
4 changed files with 40 additions and 46 deletions

View File

@@ -1,17 +1,18 @@
div#media-upload-header {
background-color: #e4f2fd;
margin: 0;
padding: 1em 0.5em 0 0.5em;
padding: 0 5px;
font-weight: bold;
position: relative;
border-bottom: 1px solid #c6d9e9;
height: 2.5em;
}
ul#sidemenu {
font-weight: normal;
margin: 0 15px;
margin: 0 5px;
position: absolute;
right: 1em;
left: 0px;
bottom: -1px;
}
@@ -21,12 +22,6 @@ div#media-upload-error {
color: #f00;
}
.file-error {
font-weight: bold;
color: #f00;
margin: 0 15px;
}
form {
margin: 1em;
}
@@ -59,24 +54,7 @@ form {
margin: 0 0 1em 0;
padding: 0;
}
/*
.media-upload-form button.button-ok {
float: right;
background-color: #ebebeb;
color: #1f4569;
border: none;
padding: 0.5em;
}
.media-upload-form a.button-cancel {
float: right;
background-color: #fff;
color: #9a9a9a;
font-size: 0.8em;
text-decoration: underline;
margin: 0.5em 1em;
}
*/
/* specific to the image upload form */
.align .field label {
display: inline;
@@ -128,21 +106,35 @@ tr.image-size td.field {
border-bottom: 1px solid #d0d0d0;
width: 623px;
position: relative;
min-height: 36px;
}
span.filename {
position: absolute;
left: 46px;
top: 0px;
.filename {
line-height: 36px;
margin-left: 50px;
z-index: 2;
}
button.dismiss {
position: absolute;
top: 5px;
right: 5px;
z-index: 4;
}
.file-error {
margin: 0 0 5px 50px;
font-weight: bold;
color: #f00;
}
.progress {
position: absolute;
top: 0px;
left: 0px;
width: 623px;
height: 36px;
}
.bar {
width: 0px;
height: 36px;
height: 100%;
background-color: #e8e8e8;
border-right: 3px solid #99d;
}
@@ -161,6 +153,7 @@ span.filename {
border-top: 1px solid #d0d0d0;
padding: 5px;
width: 100%;
clear: both;
}
.describe.startopen, .describe.startclosed {
display: none;
@@ -201,7 +194,8 @@ span.filename {
left: 0px;
cursor: pointer;
border: none;
z-index: 10;
z-index: 3;
height: 36px;
}
tr.align td.field {
text-align: center;

View File

@@ -270,7 +270,7 @@ function media_upload_image() {
$alt = attribute_escape($_POST['insertonly']['alt']);
if ( isset($_POST['insertonly']['align']) ) {
$align = attribute_escape($_POST['insertonly']['align']);
$class = " class='align-$align'";
$class = " class='align$align'";
}
$html = "<img src='$src' alt='$alt'$class />";
return media_send_to_editor($html);
@@ -602,7 +602,7 @@ function get_media_items( $post_id, $errors ) {
foreach ( $attachments as $id => $attachment )
if ( $item = get_media_item($id, isset($errors[$id]) ? $errors[$id] : null) )
$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>";
$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>";
return $output;
}
@@ -645,7 +645,7 @@ function get_media_item( $attachment_id, $errors = null, $send = true, $delete =
$type
<a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
<a class='toggle describe-toggle-off' href='#'>$toggle_off</a>
<span class='filename new'>$filename</span>
<div class='filename new'>$filename</div>
<table class='slidetoggle describe $class'><tbody>
<tr>
<td class='A1B1' rowspan='4' colspan='2'><img class='thumbnail' src='$thumb_url' alt='' /></td>
@@ -730,13 +730,10 @@ function get_media_item( $attachment_id, $errors = null, $send = true, $delete =
return $item;
}
function media_upload_header($title = false) {
if ( empty($title) )
$title = __('Choose a File');
function media_upload_header() {
?>
<script type="text/javascript">post_id = <?php echo intval($_REQUEST['post_id']); ?>;</script>
<div id="media-upload-header">
<h3><?php echo $title ?></h3>
<?php the_media_upload_tabs(); ?>
</div>
<?php
@@ -856,7 +853,7 @@ jQuery(function($){
}
function media_upload_gallery_form($errors) {
media_upload_header(__('Browse attached files'));
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
@@ -894,7 +891,7 @@ jQuery(function($){
function media_upload_library_form($errors) {
global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
media_upload_header(__('Browse Media Library'));
media_upload_header();
$post_id = intval($_REQUEST['post_id']);