X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/96bc8e88cf39086a9e0a883b8e2c311fe82a5e97..80b7979fccf09a75af3f4c111fa27060ae6dbf85:/wp-includes/js/plupload/handlers.dev.js diff --git a/wp-includes/js/plupload/handlers.dev.js b/wp-includes/js/plupload/handlers.dev.js index d0f8708d..0a631d61 100644 --- a/wp-includes/js/plupload/handlers.dev.js +++ b/wp-includes/js/plupload/handlers.dev.js @@ -44,11 +44,13 @@ function fileUploading(up, file) { if ( max > hundredmb && file.size > hundredmb ) { setTimeout(function(){ - if ( file.status == 2 && file.loaded == 0 ) { // not uploading - wpFileError(file, pluploadL10n.big_upload_failed.replace('%1$s', '').replace('%2$s', '')); + var done; - if ( up.current && up.current.file.id == file.id && up.current.xhr.abort ) - up.current.xhr.abort(); + if ( file.status < 3 && file.loaded == 0 ) { // not uploading + wpFileError(file, pluploadL10n.big_upload_failed.replace('%1$s', '').replace('%2$s', '')); + up.stop(); // stops the whole queue + up.removeFile(file); + up.start(); // restart the queue } }, 10000); // wait for 10 sec. for the file to start uploading } @@ -81,7 +83,7 @@ function uploadSuccess(fileObj, serverData) { serverData = serverData.replace(/^
(\d+)<\/pre>$/, '$1'); // if async-upload returned an error message, place it in the media item div and return - if ( serverData.match('media-upload-error') ) { + if ( serverData.match(/media-upload-error|error-div/) ) { item.html(serverData); return; } else { @@ -136,7 +138,7 @@ function prepareMediaItemInit(fileObj) { jQuery('a.delete', item).click(function(){ // Tell the server to delete it. TODO: handle exceptions jQuery.ajax({ - url: 'admin-ajax.php', + url: ajaxurl, type: 'post', success: deleteSuccess, error: deleteError, @@ -154,7 +156,7 @@ function prepareMediaItemInit(fileObj) { jQuery('a.undo', item).click(function(){ // Tell the server to untrash it. TODO: handle exceptions jQuery.ajax({ - url: 'admin-ajax.php', + url: ajaxurl, type: 'post', id: fileObj.id, data: { @@ -344,9 +346,9 @@ jQuery(document).ready(function($){ if ( target.is('input[type="radio"]') ) { // remember the last used image size and alignment tr = target.closest('tr'); - if ( $(tr).hasClass('align') ) + if ( tr.hasClass('align') ) setUserSetting('align', target.val()); - else if ( $(tr).hasClass('image-size') ) + else if ( tr.hasClass('image-size') ) setUserSetting('imgsize', target.val()); } else if ( target.is('button.button') ) { // remember the last used image link url @@ -355,7 +357,7 @@ jQuery(document).ready(function($){ if ( c && c[1] ) { setUserSetting('urlbutton', c[1]); - target.siblings('.urlfield').val( target.attr('title') ); + target.siblings('.urlfield').val( target.data('link-url') ); } } else if ( target.is('a.dismiss') ) { target.parents('.media-item').fadeOut(200, function(){ @@ -364,11 +366,11 @@ jQuery(document).ready(function($){ } else if ( target.is('.upload-flash-bypass a') || target.is('a.uploader-html') ) { // switch uploader to html4 $('#media-items, p.submit, span.big-file-warning').css('display', 'none'); switchUploader(0); - return false; + e.preventDefault(); } else if ( target.is('.upload-html-bypass a') ) { // switch uploader to multi-file $('#media-items, p.submit, span.big-file-warning').css('display', ''); switchUploader(1); - return false; + e.preventDefault(); } else if ( target.is('a.describe-toggle-on') ) { // Show target.parent().addClass('open'); target.siblings('.slidetoggle').fadeIn(250, function(){ @@ -386,12 +388,12 @@ jQuery(document).ready(function($){ } } }); - return false; + e.preventDefault(); } else if ( target.is('a.describe-toggle-off') ) { // Hide target.siblings('.slidetoggle').fadeOut(250, function(){ target.parent().removeClass('open'); }); - return false; + e.preventDefault(); } }); @@ -415,7 +417,7 @@ jQuery(document).ready(function($){ setResize( getUserSetting('upload_resize', false) ); - if ( up.features.dragdrop ) { + if ( up.features.dragdrop && ! $(document.body).hasClass('mobile') ) { uploaddiv.addClass('drag-drop'); $('#drag-drop-area').bind('dragover.wp-uploader', function(){ // dragenter doesn't fire right :( uploaddiv.addClass('drag-over');