Build the media item HTML in a clearer manner in the legacy Plupload handler JS. Also update the retired SWFUpload handler JS.

git-svn-id: http://core.svn.wordpress.org/trunk@24472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-06-21 03:44:48 +00:00
parent 274d09b342
commit 25a7b3291a
2 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,12 @@ function fileQueued(fileObj) {
items.removeClass('open').find('.slidetoggle').slideUp(200);
}
// Create a progress bar containing the filename
jQuery('#media-items').append('<div id="media-item-' + fileObj.id + '" class="media-item child-of-' + postid + '"><div class="progress"><div class="percent">0%</div><div class="bar"></div></div><div class="filename original"> ' + fileObj.name + '</div></div>');
jQuery('<div class="media-item">')
.attr( 'id', 'media-item-' + fileObj.id )
.addClass('child-of-' + postid)
.append('<div class="progress"><div class="percent">0%</div><div class="bar"></div></div>',
jQuery('<div class="filename original">').text( ' ' + fileObj.name ))
.appendTo( jQuery('#media-items' ) );
// Disable submit
jQuery('#insert-gallery').prop('disabled', true);

View File

@ -15,7 +15,12 @@ function fileQueued(fileObj) {
jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
}
// Create a progress bar containing the filename
jQuery('#media-items').append('<div id="media-item-' + fileObj.id + '" class="media-item child-of-' + post_id + '"><div class="progress"><div class="bar"></div></div><div class="filename original"><span class="percent"></span> ' + fileObj.name + '</div></div>');
jQuery('<div class="media-item">')
.attr( 'id', 'media-item-' + fileObj.id )
.addClass('child-of-' + post_id)
.append('<div class="progress"><div class="bar"></div></div>',
jQuery('<div class="filename original"><span class="percent"></span>').text( ' ' + fileObj.name ))
.appendTo( jQuery('#media-items' ) );
// Display the progress div
jQuery('.progress', '#media-item-' + fileObj.id).show();