diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css index 5fea972861..775623e98b 100644 --- a/wp-admin/css/wp-admin.css +++ b/wp-admin/css/wp-admin.css @@ -4061,6 +4061,7 @@ body .ui-slider-tooltip { .wp-format-media-holder div { display: none; } + .wp-format-media-holder.drag-over div { position: absolute; top: 10px; @@ -4072,7 +4073,6 @@ body .ui-slider-tooltip { } #poststuff .wp-format-media-holder.drag-over div h3 { - position: absolute; top: 50%; left: 0; @@ -4111,10 +4111,7 @@ body .ui-slider-tooltip { text-align: center; } -body.wp-format-image .attachment-display-settings { - display: none; -} - +body.wp-format-image .attachment-display-settings, body.wp-format-status #titlewrap, body.wp-format-image .wp-media-buttons .insert-media, body.wp-format-audio .wp-media-buttons .insert-media, @@ -4124,6 +4121,8 @@ body.wp-format-status .wp-media-buttons .insert-media { display: none; } +.wp-format-media-select .media-progress-bar, +.wp-format-media-select .media-progress-bar div, .mejs-audio audio, .mejs-video video { display: block; diff --git a/wp-admin/js/post-formats.js b/wp-admin/js/post-formats.js index b37bc0d91f..1c8c96831a 100644 --- a/wp-admin/js/post-formats.js +++ b/wp-admin/js/post-formats.js @@ -59,16 +59,27 @@ window.wp = window.wp || {}; ''].join( '' ) ); } + function imageFormatUploadFilesAdded( uploader, files ) { + $.each( files, function( i, file ) { + if ( i > 0 ) + uploader.removeFile(file); + }); + } + var uploader = { dropzone: $('.wp-format-media-holder[data-format=image]'), success: imageFormatUploadSuccess, - error: imageFormatUploadError, - plupload: {}, + error: imageFormatUploadError, + plupload: { + runtimes: 'html5', + filters: [ {title: 'Image', extensions: 'jpg,jpeg,gif,png'} ] + }, params: {} }; uploader = new wp.Uploader( uploader ); uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart ); uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress ); + uploader.uploader.bind( 'FilesAdded', imageFormatUploadFilesAdded ); function switchFormatClass( format ) { formatField.val( format );