Ticket #24291: 24291.27.diff
File 24291.27.diff, 1.1 KB (added by , 12 years ago) |
---|
-
wp-admin/js/post-formats.js
59 59 '</div>'].join( '' ) ); 60 60 } 61 61 62 function imageFormatUploadFilesAdded( uploader, files ) { 63 $.each( files, function( i, file ) { 64 if ( i > 0 ) 65 uploader.removeFile(file); 66 }); 67 } 68 62 69 var uploader = { 63 70 dropzone: $('.wp-format-media-holder[data-format=image]'), 64 71 success: imageFormatUploadSuccess, 65 error: imageFormatUploadError, 66 plupload: {}, 72 error: imageFormatUploadError, 73 plupload: { 74 runtimes: 'html5', 75 filters: [ {title: 'Image', extensions: 'jpg,jpeg,gif,png'} ] 76 }, 67 77 params: {} 68 78 }; 69 79 uploader = new wp.Uploader( uploader ); 70 80 uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart ); 71 81 uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress ); 82 uploader.uploader.bind( 'FilesAdded', imageFormatUploadFilesAdded ); 72 83 73 84 function switchFormatClass( format ) { 74 85 formatField.val( format );