Ticket #26008: 26008.1.diff
File 26008.1.diff, 1.1 KB (added by , 10 years ago) |
---|
-
src/wp-admin/js/set-post-thumbnail.js
1 /* global setPostThumbnailL10n, ajaxurl, post_id */ 2 /* exported WPSetAsThumbnail */ 3 1 4 function WPSetAsThumbnail(id, nonce){ 2 5 var $link = jQuery('a#wp-post-thumbnail-' + id); 3 6 … … 3 6 $link.text( setPostThumbnailL10n.saving ); 4 7 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 ) 6 9 }, function(str){ 7 10 var win = window.dialogArguments || opener || parent || top; 8 11 $link.text( setPostThumbnailL10n.setThumbnail ); 9 12 if ( str == '0' ) { 10 alert( setPostThumbnailL10n.error );13 window.alert( setPostThumbnailL10n.error ); 11 14 } else { 12 15 jQuery('a.wp-post-thumbnail').show();