pretty delete animation, fix squashed icons and use 80x60 thumbs, add rel attrs to attachment links inserted from uploader. Props andy. see #5911
git-svn-id: https://develop.svn.wordpress.org/trunk@7466 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
db66d57993
commit
e2145503bf
@ -43,7 +43,7 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
|
||||
case 'icon':
|
||||
?>
|
||||
<td class="media-icon"><?php echo wp_get_attachment_link($post->ID, array(60, 40), false, true); ?></td>
|
||||
<td class="media-icon"><?php echo wp_get_attachment_link($post->ID, array(80, 60), false, true); ?></td>
|
||||
<?php
|
||||
// TODO
|
||||
break;
|
||||
|
@ -50,7 +50,7 @@ function the_media_upload_tabs() {
|
||||
|
||||
function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {
|
||||
|
||||
$html = get_image_tag($id, $alt, $title, $align, $rel, $size);
|
||||
$html = get_image_tag($id, $alt, $title, $align, $size);
|
||||
|
||||
$rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : '';
|
||||
|
||||
@ -246,8 +246,11 @@ function media_upload_form_handler() {
|
||||
$send_id = (int) array_shift($keys);
|
||||
$attachment = $_POST['attachments'][$send_id];
|
||||
$html = $attachment['post_title'];
|
||||
if ( !empty($attachment['url']) )
|
||||
$html = "<a href='{$attachment['url']}'>$html</a>";
|
||||
if ( !empty($attachment['url']) ) {
|
||||
if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) )
|
||||
$rel = " rel='attachment wp-att-".attribute_escape($send_id)."'";
|
||||
$html = "<a href='{$attachment['url']}'$rel>$html</a>";
|
||||
}
|
||||
$html = apply_filters('media_send_to_editor', $html, $send_id, $attachment);
|
||||
return media_send_to_editor($html);
|
||||
}
|
||||
@ -527,7 +530,7 @@ function image_media_send_to_editor($html, $attachment_id, $attachment) {
|
||||
else
|
||||
$size = 'medium';
|
||||
|
||||
return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size);
|
||||
return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, true, $size);
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
@ -502,8 +502,8 @@ td.media-icon {
|
||||
}
|
||||
|
||||
td.media-icon img {
|
||||
max-width: 60px;
|
||||
max-height: 40px;
|
||||
max-width: 80px;
|
||||
max-height: 60px;
|
||||
}
|
||||
|
||||
#update-nag, .plugin-update {
|
||||
|
@ -91,13 +91,16 @@ function deleteSuccess(data, textStatus) {
|
||||
jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
|
||||
}
|
||||
|
||||
// Vanish it.
|
||||
jQuery('#media-item-' + this.id + ' .filename:empty').remove();
|
||||
jQuery('#media-item-' + this.id + ' .filename').append(' <span class="file-error">'+swfuploadL10n.deleted+'</span>').siblings('a.toggle').remove();
|
||||
jQuery('#media-item-' + this.id + ' .describe').slideUp(500, function(){jQuery(this).parents('.media-item').slideUp(1500,function(){jQuery(this).remove();updateMediaForm();})}).end.remove();
|
||||
jQuery('#media-item-' + this.id).children('.describe').css({backgroundColor:'#fff'}).end()
|
||||
.animate({backgroundColor:'#ffc0c0'}, {queue:false,duration:50})
|
||||
.animate({minHeight:0,height:36,}, 400, null, function(){jQuery(this).children('.describe').remove()})
|
||||
.animate({backgroundColor:'#fff'}, 400)
|
||||
.animate({height:0}, 800, null, function(){jQuery(this).remove();updateMediaForm();});
|
||||
|
||||
return;
|
||||
// Vanish it.
|
||||
item.slideToggle(300,function(){jQuery(this).remove();if(jQuery('.media-item').length==0)jQuery('.insert-gallery').hide();updateMediaForm();});
|
||||
}
|
||||
|
||||
function deleteError(X, textStatus, errorThrown) {
|
||||
|
@ -91,12 +91,12 @@ function image_downsize($id, $size = 'medium') {
|
||||
}
|
||||
|
||||
// return an <img src /> tag for the given image attachment, scaling it down if requested
|
||||
function get_image_tag($id, $alt, $title, $align, $rel = false, $size='medium') {
|
||||
function get_image_tag($id, $alt, $title, $align, $size='medium') {
|
||||
|
||||
list( $img_src, $width, $height ) = image_downsize($id, $size);
|
||||
$hwstring = image_hwstring($width, $height);
|
||||
|
||||
$html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="align'.attribute_escape($align).' size-'.attribute_escape($size).' attachment wp-att-'.attribute_escape($id).'" />';
|
||||
$html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id.'" />';
|
||||
|
||||
$html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user