Ticket #5911: 5911-delpretty.diff
| File 5911-delpretty.diff, 4.0 KB (added by , 18 years ago) |
|---|
-
wp-includes/js/swfupload/handlers.js
91 91 jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden'); 92 92 } 93 93 94 // Vanish it. 94 95 jQuery('#media-item-' + this.id + ' .filename:empty').remove(); 95 96 jQuery('#media-item-' + this.id + ' .filename').append(' <span class="file-error">'+swfuploadL10n.deleted+'</span>').siblings('a.toggle').remove(); 96 jQuery('#media-item-' + this.id + ' .describe').slideUp(500, function(){jQuery(this).parents('.media-item').slideUp(1500,function(){jQuery(this).remove();updateMediaForm();})}).end.remove(); 97 jQuery('#media-item-' + this.id).children('.describe').css({backgroundColor:'#fff'}).end() 98 .animate({backgroundColor:'#ffc0c0'}, {queue:false,duration:50}) 99 .animate({minHeight:0,height:36,}, 400, null, function(){jQuery(this).children('.describe').remove()}) 100 .animate({backgroundColor:'#fff'}, 400) 101 .animate({height:0}, 800, null, function(){jQuery(this).remove();updateMediaForm();}); 97 102 98 103 return; 99 // Vanish it.100 item.slideToggle(300,function(){jQuery(this).remove();if(jQuery('.media-item').length==0)jQuery('.insert-gallery').hide();updateMediaForm();});101 104 } 102 105 103 106 function deleteError(X, textStatus, errorThrown) { -
wp-includes/media.php
91 91 } 92 92 93 93 // return an <img src /> tag for the given image attachment, scaling it down if requested 94 function get_image_tag($id, $alt, $title, $align, $ rel = false, $size='medium') {94 function get_image_tag($id, $alt, $title, $align, $size='medium') { 95 95 96 96 list( $img_src, $width, $height ) = image_downsize($id, $size); 97 97 $hwstring = image_hwstring($width, $height); 98 98 99 $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).'" />';99 $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.'" />'; 100 100 101 101 $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url ); 102 102 -
wp-admin/includes/media.php
50 50 51 51 function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') { 52 52 53 $html = get_image_tag($id, $alt, $title, $align, $ rel, $size);53 $html = get_image_tag($id, $alt, $title, $align, $size); 54 54 55 55 $rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : ''; 56 56 … … 246 246 $send_id = (int) array_shift($keys); 247 247 $attachment = $_POST['attachments'][$send_id]; 248 248 $html = $attachment['post_title']; 249 if ( !empty($attachment['url']) ) 250 $html = "<a href='{$attachment['url']}'>$html</a>"; 249 if ( !empty($attachment['url']) ) { 250 if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) ) 251 $rel = " rel='attachment wp-att-".attribute_escape($send_id)."'"; 252 $html = "<a href='{$attachment['url']}'$rel>$html</a>"; 253 } 251 254 $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment); 252 255 return media_send_to_editor($html); 253 256 } … … 527 530 else 528 531 $size = 'medium'; 529 532 530 return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size);533 return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, true, $size); 531 534 } 532 535 533 536 return $html;