WordPress.org

Make WordPress Core

Changeset 12355


Ignore:
Timestamp:
12/10/09 08:03:26 (4 years ago)
Author:
markjaquith
Message:

Provide visual feedback for "Use as thumbnail" when clicked immediately after uploading the image. fixes #11140

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r12352 r12355  
    12461246        $calling_post_id = $post->post_parent; 
    12471247    if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) 
    1248         $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>"; 
     1248        $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>"; 
    12491249 
    12501250    if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) 
  • trunk/wp-admin/js/set-post-thumbnail.dev.js

    r12353 r12355  
    11function WPSetAsThumbnail(id){ 
    2     var $link = jQuery('#media-item-' + id + ' a.wp-post-thumbnail'); 
     2    var $link = jQuery('a#wp-post-thumbnail-' + id); 
    33 
    44    $link.text( setPostThumbnailL10n.saving ); 
  • trunk/wp-admin/js/set-post-thumbnail.js

    r12353 r12355  
    1 function WPSetAsThumbnail(id){var $link=jQuery("#media-item-"+id+" a.wp-post-thumbnail");$link.text(setPostThumbnailL10n.saving);jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:id,cookie:encodeURIComponent(document.cookie)},function(str){var win=window.dialogArguments||opener||parent||top;$link.text(setPostThumbnailL10n.setThumbnail);if(str=="0"){alert(setPostThumbnailL10n.error)}else{jQuery("a.wp-post-thumbnail").show();$link.text(setPostThumbnailL10n.done);$link.fadeOut(2000);win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str)}})}; 
     1function WPSetAsThumbnail(id){var $link=jQuery("a#wp-post-thumbnail-"+id);$link.text(setPostThumbnailL10n.saving);jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:id,cookie:encodeURIComponent(document.cookie)},function(str){var win=window.dialogArguments||opener||parent||top;$link.text(setPostThumbnailL10n.setThumbnail);if(str=="0"){alert(setPostThumbnailL10n.error)}else{jQuery("a.wp-post-thumbnail").show();$link.text(setPostThumbnailL10n.done);$link.fadeOut(2000);win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str)}})}; 
  • trunk/wp-includes/script-loader.php

    r12354 r12355  
    383383        $scripts->add_data( 'image-edit', 'group', 1 ); 
    384384 
    385         $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091210' ); 
     385        $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091210b' ); 
    386386        $scripts->add_data( 'set-post-thumbnail', 'group', 1 ); 
    387387        $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( 
Note: See TracChangeset for help on using the changeset viewer.