WordPress.org

Make WordPress Core

Changeset 7466


Ignore:
Timestamp:
03/21/2008 11:21:27 PM (10 years ago)
Author:
ryan
Message:

pretty delete animation, fix squashed icons and use 80x60 thumbs, add rel attrs to attachment links inserted from uploader. Props andy. see #5911

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-attachment-rows.php

    r7427 r7466  
    4444    case 'icon':
    4545        ?>
    46         <td class="media-icon"><?php echo wp_get_attachment_link($post->ID, array(60, 40), false, true); ?></td>
     46        <td class="media-icon"><?php echo wp_get_attachment_link($post->ID, array(80, 60), false, true); ?></td>
    4747        <?php
    4848        // TODO
  • trunk/wp-admin/includes/media.php

    r7446 r7466  
    5151function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {
    5252
    53     $html = get_image_tag($id, $alt, $title, $align, $rel, $size);
     53    $html = get_image_tag($id, $alt, $title, $align, $size);
    5454
    5555    $rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : '';
     
    247247        $attachment = $_POST['attachments'][$send_id];
    248248        $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        }
    251254        $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment);
    252255        return media_send_to_editor($html);
     
    528531            $size = 'medium';
    529532
    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);
    531534    }
    532535
  • trunk/wp-admin/wp-admin.css

    r7428 r7466  
    503503
    504504td.media-icon img {
    505     max-width: 60px;
    506     max-height: 40px;
     505    max-width: 80px;
     506    max-height: 60px;
    507507}
    508508
  • trunk/wp-includes/js/swfupload/handlers.js

    r7406 r7466  
    9292    }
    9393
     94    // Vanish it.
    9495    jQuery('#media-item-' + this.id + ' .filename:empty').remove();
    9596    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();});
    97102
    98103    return;
    99     // Vanish it.
    100     item.slideToggle(300,function(){jQuery(this).remove();if(jQuery('.media-item').length==0)jQuery('.insert-gallery').hide();updateMediaForm();});
    101104}
    102105
  • trunk/wp-includes/media.php

    r7444 r7466  
    9292
    9393// 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') {
     94function get_image_tag($id, $alt, $title, $align, $size='medium') {
    9595
    9696    list( $img_src, $width, $height ) = image_downsize($id, $size);
    9797    $hwstring = image_hwstring($width, $height);
    9898
    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.'" />';
    100100
    101101    $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url );
Note: See TracChangeset for help on using the changeset viewer.