Remove a few unnecessary jQuery selectors added in [27239]. Playlists don't exist in some older contexts that galleries do.
See #26631. Built from https://develop.svn.wordpress.org/trunk@27243 git-svn-id: http://core.svn.wordpress.org/trunk@27100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c0379aaafc
commit
4b66e01e6d
|
@ -22,7 +22,7 @@ function fileQueued(fileObj) {
|
||||||
.appendTo( jQuery('#media-items' ) );
|
.appendTo( jQuery('#media-items' ) );
|
||||||
|
|
||||||
// Disable submit
|
// Disable submit
|
||||||
jQuery('#insert-gallery, #insert-playlist').prop('disabled', true);
|
jQuery('#insert-gallery').prop('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadStart() {
|
function uploadStart() {
|
||||||
|
@ -47,7 +47,7 @@ function fileUploading(up, file) {
|
||||||
|
|
||||||
if ( max > hundredmb && file.size > hundredmb ) {
|
if ( max > hundredmb && file.size > hundredmb ) {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|
||||||
if ( file.status < 3 && file.loaded === 0 ) { // not uploading
|
if ( file.status < 3 && file.loaded === 0 ) { // not uploading
|
||||||
wpFileError(file, pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>'));
|
wpFileError(file, pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>'));
|
||||||
up.stop(); // stops the whole queue
|
up.stop(); // stops the whole queue
|
||||||
|
@ -64,11 +64,11 @@ function updateMediaForm() {
|
||||||
// Just one file, no need for collapsible part
|
// Just one file, no need for collapsible part
|
||||||
if ( items.length == 1 ) {
|
if ( items.length == 1 ) {
|
||||||
items.addClass('open').find('.slidetoggle').show();
|
items.addClass('open').find('.slidetoggle').show();
|
||||||
jQuery('.insert-gallery, .insert-playlist').hide();
|
jQuery('.insert-gallery').hide();
|
||||||
} else if ( items.length > 1 ) {
|
} else if ( items.length > 1 ) {
|
||||||
items.removeClass('open');
|
items.removeClass('open');
|
||||||
// Only show Gallery/Playlist buttons when there are at least two files.
|
// Only show Gallery/Playlist buttons when there are at least two files.
|
||||||
jQuery('.insert-gallery, .insert-playlist').show();
|
jQuery('.insert-gallery').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only show Save buttons when there is at least one file.
|
// Only show Save buttons when there is at least one file.
|
||||||
|
@ -171,7 +171,7 @@ function prepareMediaItemInit(fileObj) {
|
||||||
success: function( ){
|
success: function( ){
|
||||||
var type,
|
var type,
|
||||||
item = jQuery('#media-item-' + fileObj.id);
|
item = jQuery('#media-item-' + fileObj.id);
|
||||||
|
|
||||||
if ( type = jQuery('#type-of-' + fileObj.id).val() )
|
if ( type = jQuery('#type-of-' + fileObj.id).val() )
|
||||||
jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-0+1);
|
jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-0+1);
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ function deleteError() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadComplete() {
|
function uploadComplete() {
|
||||||
jQuery('#insert-gallery, #insert-playlist').prop('disabled', false);
|
jQuery('#insert-gallery').prop('disabled', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchUploader(s) {
|
function switchUploader(s) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -32,7 +32,7 @@ function fileQueued(fileObj) {
|
||||||
function uploadStart(fileObj) {
|
function uploadStart(fileObj) {
|
||||||
try {
|
try {
|
||||||
if ( typeof topWin.tb_remove != 'undefined' )
|
if ( typeof topWin.tb_remove != 'undefined' )
|
||||||
topWin.jQuery('#TB_overlay').unbind('click', topWin.tb_remove);
|
topWin.jQuery('#TB_overlay').unbind('click', topWin.tb_remove);
|
||||||
} catch(e){}
|
} catch(e){}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -212,11 +212,11 @@ function updateMediaForm() {
|
||||||
else
|
else
|
||||||
jQuery('.savebutton').hide();
|
jQuery('.savebutton').hide();
|
||||||
|
|
||||||
// Only show Gallery/Playlist buttons when there are at least two files.
|
// Only show Gallery buttons when there are at least two files.
|
||||||
if ( items.length > 1 ) {
|
if ( items.length > 1 ) {
|
||||||
jQuery('.insert-gallery, .insert-playlist').show();
|
jQuery('.insert-gallery').show();
|
||||||
} else {
|
} else {
|
||||||
jQuery('.insert-gallery, .insert-playlist').hide();
|
jQuery('.insert-gallery').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ function uploadComplete(fileObj) {
|
||||||
// If no more uploads queued, enable the submit button
|
// If no more uploads queued, enable the submit button
|
||||||
if ( swfu.getStats().files_queued == 0 ) {
|
if ( swfu.getStats().files_queued == 0 ) {
|
||||||
jQuery('#cancel-upload').prop('disabled', true);
|
jQuery('#cancel-upload').prop('disabled', true);
|
||||||
jQuery('#insert-gallery, #insert-playlist').prop('disabled', false);
|
jQuery('#insert-gallery').prop('disabled', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue