Make WordPress Core

Ticket #26008: 26008.1.diff

File 26008.1.diff, 1.1 KB (added by atimmer, 10 years ago)
  • src/wp-admin/js/set-post-thumbnail.js

     
     1/* global setPostThumbnailL10n, ajaxurl, post_id */
     2/* exported WPSetAsThumbnail */
     3
    14function WPSetAsThumbnail(id, nonce){
    25        var $link = jQuery('a#wp-post-thumbnail-' + id);
    36
     
    36        $link.text( setPostThumbnailL10n.saving );
    47        jQuery.post(ajaxurl, {
    5                 action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
     8                action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
    69        }, function(str){
    710                var win = window.dialogArguments || opener || parent || top;
    811                $link.text( setPostThumbnailL10n.setThumbnail );
    912                if ( str == '0' ) {
    10                         alert( setPostThumbnailL10n.error );
     13                        window.alert( setPostThumbnailL10n.error );
    1114                } else {
    1215                        jQuery('a.wp-post-thumbnail').show();