WordPress.org

Make WordPress Core

Changeset 12111


Ignore:
Timestamp:
10/26/2009 06:02:44 PM (9 years ago)
Author:
markjaquith
Message:

thumbnail JS fixes. props scribu. see #10928

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/set-post-thumbnail.dev.js

    r12037 r12111  
    11function WPSetAsThumbnail(id){
    2     jQuery('#media-item-' + id + ' > a.wp-post-thumbnail').text( setPostThumbnailL10n.saving ).attr('href', '#');
     2    var $link = jQuery('#media-item-' + id + ' a.wp-post-thumbnail');
     3
     4    $link.text( setPostThumbnailL10n.saving );
    35    jQuery.post(ajaxurl, {
    46        action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, cookie: encodeURIComponent(document.cookie)
    57    }, function(str){
    68        var win = window.dialogArguments || opener || parent || top;
     9        $link.text( setPostThumbnailL10n.setThumbnail );
    710        if ( str == '0' ) {
    811            alert( setPostThumbnailL10n.error );
    912        } else {
    10             jQuery('a.wp-post-thumbnail').text( setPostThumbnailL10n.setThumbnail );
    11             jQuery('#media-item-' + id + ' > a.wp-post-thumbnail').hide();
     13            jQuery('a.wp-post-thumbnail').show();
     14            $link.hide();
    1215            win.WPSetThumbnailID(id);
    1316            win.WPSetThumbnailHTML(str);
  • trunk/wp-admin/js/set-post-thumbnail.js

    r12037 r12111  
    1 function WPSetAsThumbnail(id){jQuery("#media-item-"+id+" > a.wp-post-thumbnail").text(setPostThumbnailL10n.saving).attr("href","#");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;if(str=="0"){alert(setPostThumbnailL10n.error)}else{jQuery("a.wp-post-thumbnail").text(setPostThumbnailL10n.setThumbnail);jQuery("#media-item-"+id+" > a.wp-post-thumbnail").hide();win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str)}})};
     1function 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.hide();win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str)}})};
  • trunk/wp-includes/script-loader.php

    r12099 r12111  
    373373        $scripts->add_data( 'image-edit', 'group', 1 );
    374374
    375         $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091015' );
     375        $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091021' );
    376376        $scripts->add_data( 'set-post-thumbnail', 'group', 1 );
    377377        $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
    378             'setThumbnail' => __( 'Use for thumbnail' ),
     378            'setThumbnail' => __( 'Use as thumbnail' ),
    379379            'saving' => __( 'Saving...' ),
    380380            'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' )
Note: See TracChangeset for help on using the changeset viewer.