<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[19268] trunk: Media Lib: fix displaying file headers in IE7, delegate the Show/Hide JS, prevent displaying upload error for the same file twice, see #19228</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/19268">19268</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-11-13 18:37:30 +0000 (Sun, 13 Nov 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Media Lib: fix displaying file headers in IE7, delegate the Show/Hide JS, prevent displaying upload error for the same file twice, see <a href="http://core.trac.wordpress.org/ticket/19228">#19228</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpincludesjspluploadhandlersdevjs">trunk/wp-includes/js/plupload/handlers.dev.js</a></li>
<li><a href="#trunkwpincludesjspluploadhandlersjs">trunk/wp-includes/js/plupload/handlers.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (19267 => 19268)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2011-11-13 15:20:25 UTC (rev 19267)
+++ trunk/wp-admin/includes/media.php        2011-11-13 18:37:30 UTC (rev 19268)
</span><span class="lines">@@ -1008,7 +1008,7 @@
</span><span class="cx">                 if ( $attachment->post_status == 'trash' )
</span><span class="cx">                         continue;
</span><span class="cx">                 if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) )
</span><del>-                        $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>";
</del><ins>+                        $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-$id' class='hidden'></div><div class='filename hidden'></div>$item\n</div>";
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return $output;
</span></span></pre></div>
<a id="trunkwpincludesjspluploadhandlersdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/handlers.dev.js (19267 => 19268)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/handlers.dev.js        2011-11-13 15:20:25 UTC (rev 19267)
+++ trunk/wp-includes/js/plupload/handlers.dev.js        2011-11-13 18:37:30 UTC (rev 19268)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">
</span><span class="cx">                                 up.removeFile(file);
</span><span class="cx">                         }
</span><del>-                }, 5000); // 20 sec.
</del><ins>+                }, 10000); // wait for 10 sec. for the file to start uploading
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -143,30 +143,6 @@
</span><span class="cx">         // Replace the original filename with the new (unique) one assigned during upload
</span><span class="cx">         jQuery('.filename.original', item).replaceWith( jQuery('.filename.new', item) );
</span><span class="cx">
</span><del>-        // Also bind toggle to the links
-        jQuery('a.toggle', item).click(function(){
-                jQuery(this).siblings('.slidetoggle').slideToggle(350, function(){
-                        var w = jQuery(window).height(), t = jQuery(this).offset().top, h = jQuery(this).height(), b;
-
-                        if ( w && t && h ) {
-                                b = t + h;
-
-                                if ( b > w && (h + 48) < w )
-                                        window.scrollBy(0, b - w + 13);
-                                else if ( b > w )
-                                        window.scrollTo(0, t - 36);
-                        }
-                });
-
-                if ( jQuery(this).is('.describe-toggle-on') )
-                        item.addClass('open');
-                else
-                        item.removeClass('open');
-
-                jQuery(this).siblings('a.toggle').focus();
-                return false;
-        });
-
</del><span class="cx">         // Bind AJAX to the new Delete button
</span><span class="cx">         jQuery('a.delete', item).click(function(){
</span><span class="cx">                 // Tell the server to delete it. TODO: handle exceptions
</span><span class="lines">@@ -216,7 +192,7 @@
</span><span class="cx">         });
</span><span class="cx">
</span><span class="cx">         // Open this item if it says to start open (e.g. to display an error)
</span><del>-        jQuery('#media-item-' + fileObj.id + '.startopen').removeClass('startopen').slideToggle(500).siblings('.toggle').toggle();
</del><ins>+        jQuery('#media-item-' + fileObj.id + '.startopen').removeClass('startopen').addClass('open').find('slidetoggle').fadeIn();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // generic error message
</span><span class="lines">@@ -230,13 +206,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function itemAjaxError(id, message) {
</span><del>-        var item = jQuery('#media-item-' + id), filename = item.find('.filename').text();
</del><ins>+        var item = jQuery('#media-item-' + id), filename = item.find('.filename').text(), last_err = item.data('last-err');
</ins><span class="cx">
</span><ins>+        if ( last_err == id ) // prevent firing an error for the same file twice
+                return;
+
</ins><span class="cx">         item.html('<div class="error-div">'
</span><span class="cx">                                 + '<a class="dismiss" href="#">' + pluploadL10n.dismiss + '</a>'
</span><span class="cx">                                 + '<strong>' + pluploadL10n.error_uploading.replace('%s', jQuery.trim(filename)) + '</strong> '
</span><span class="cx">                                 + message
</span><del>-                                + '</div>');
</del><ins>+                                + '</div>').data('last-err', id);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function deleteSuccess(data, textStatus) {
</span><span class="lines">@@ -304,6 +283,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function uploadError(fileObj, errorCode, message) {
</span><ins>+        var hundredmb = 100 * 1024 * 1024, max;
</ins><span class="cx">
</span><span class="cx">         switch (errorCode) {
</span><span class="cx">                 case plupload.FAILED:
</span><span class="lines">@@ -328,7 +308,12 @@
</span><span class="cx">                         wpQueueError(pluploadL10n.upload_failed);
</span><span class="cx">                         break;
</span><span class="cx">                 case plupload.IO_ERROR:
</span><del>-                        wpQueueError(pluploadL10n.io_error);
</del><ins>+                        max = parseInt(uploader.settings.max_file_size, 10);
+
+                        if ( max > hundredmb && fileObj.size > hundredmb )
+                                wpFileError(fileObj, pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>'));
+                        else
+                                wpQueueError(pluploadL10n.io_error);
</ins><span class="cx">                         break;
</span><span class="cx">                 case plupload.HTTP_ERROR:
</span><span class="cx">                         wpQueueError(pluploadL10n.http_error);
</span><span class="lines">@@ -380,11 +365,36 @@
</span><span class="cx">                                 $(this).remove();
</span><span class="cx">                         });
</span><span class="cx">                 } else if ( target.is('.upload-flash-bypass a') || target.is('a.uploader-html') ) { // switch uploader to html4
</span><ins>+                        $('#media-items, p.submit').css('display', 'none');
</ins><span class="cx">                         switchUploader(0);
</span><span class="cx">                         return false;
</span><span class="cx">                 } else if ( target.is('.upload-html-bypass a') ) { // switch uploader to multi-file
</span><ins>+                        $('#media-items, p.submit').css('display', '');
</ins><span class="cx">                         switchUploader(1);
</span><span class="cx">                         return false;
</span><ins>+                } else if ( target.is('a.describe-toggle-on') ) { // Show
+                        target.parent().addClass('open');
+                        target.siblings('.slidetoggle').fadeIn(250, function(){
+                                var S = $(window).scrollTop(), H = $(window).height(), top = $(this).offset().top, h = $(this).height(), b, B;
+
+                                if ( H && top && h ) {
+                                        b = top + h;
+                                        B = S + H;
+
+                                        if ( b > B ) {
+                                                if ( b - B < top - S )
+                                                        window.scrollBy(0, (b - B) + 10);
+                                                else
+                                                        window.scrollBy(0, top - S - 40);
+                                        }
+                                }
+                        });
+                        return false;
+                } else if ( target.is('a.describe-toggle-off') ) { // Hide
+                        target.siblings('.slidetoggle').fadeOut(250, function(){
+                                target.parent().removeClass('open');
+                        });
+                        return false;
</ins><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesjspluploadhandlersjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/handlers.js (19267 => 19268)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/handlers.js        2011-11-13 15:20:25 UTC (rev 19267)
+++ trunk/wp-includes/js/plupload/handlers.js        2011-11-13 18:37:30 UTC (rev 19268)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var topWin=window.dialogArguments||opener||parent||top,uploader,uploader_init;function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(b){jQuery(".media-blank").remove();var a=jQuery("#media-items").children();if(a.length==1){a.removeClass("open").find(".slidetoggle").slideUp(200)}jQuery("#media-items").append('<div id="media-item-'+b.id+'" class="media-item child-of-'+post_id+'"><div class="progress"><div class="percent">0%</div><div class="bar"></div></div><div class="filename original"> '+b.name+"</div></div>");jQuery(".progress",jQuery("#media-item-"+b.id)).fadeIn();jQuery("#insert-gallery").prop("disabled",true)}function uploadStart(){try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery(&q
uot;#TB_overlay").unbind("click",topWin.tb_remove)}}catch(a){}return true}function uploadProgress(a,b){var c=jQuery("#media-item-"+b.id);jQuery(".bar",c).width((200*b.percent)/100);jQuery(".percent",c).html(b.percent+"%");if(b.percent==100){setTimeout(function(){jQuery(".percent",c).html(pluploadL10n.crunching)},200)}}function fileUploading(c,d){var b=100*1024*1024,a=parseInt(c.settings.max_file_size,10);if(a>b&&d.size>b){setTimeout(function(){if(d.status==2&&d.loaded==0){wpFileError(d,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>"));if(c.current&&c.current.file.id==d.id&&c.current.xhr.abort){c.current.xhr.abort()}c.removeFile(d)}},5000)}}function updateMediaForm(){var a=jQuery("#media-items").children();if(a.length==1){a.addClass("open&quo
t;).find(".slidetoggle").slideDown();jQuery(".insert-gallery").hide()}else{if(a.length>1){a.removeClass("open");jQuery(".insert-gallery").show()}}if(a.not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}}function uploadSuccess(c,a){var b=jQuery("#media-item-"+c.id);if(a.match("media-upload-error")){b.html(a);return}prepareMediaItem(c,a);updateMediaForm();if(b.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function setResize(a){if(a){if(uploader.features.jpgresize){uploader.settings.resize={width:resize_width,height:resize_height,quality:100}}else{uploader.settings.multipart_params.image_resize=true}}else{delete (uploader.settings.resize);delete (uploader.settings.multipart_params.image_resize)}}function prepareMediaItem(c,a){var d=(typeof shortform==&q
uot;undefined")?1:2,b=jQuery("#media-item-"+c.id);jQuery(".bar",b).remove();jQuery(".progress",b).hide();try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load("async-upload.php",{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery("#media-item-"+b.id);jQuery(".thumbnail",a).clone().attr("class","pinkynail toggle").prependTo(a);jQuery(".filename.original",a).replaceWith(jQuery(".filename.new",a));jQuery("a.toggle",a).click(function(){jQuery(this).siblings(".slidetoggle").slideToggle(350,function(){var d=jQuery(window).height(),e=jQuery(this).offset().top,f=jQuery(this).height(),c;if(d&&e&&f){c=e+f;if(c>d&&(f+48)<
d){window.scrollBy(0,c-d+13)}else{if(c>d){window.scrollTo(0,e-36)}}}});if(jQuery(this).is(".describe-toggle-on")){a.addClass("open")}else{a.removeClass("open")}jQuery(this).siblings("a.toggle").focus();return false});jQuery("a.delete",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(d,e){var c=jQuery("#media-item-"+b.id);if(type=jQuery("#type-of-"+b.id).val()){jQuery("#"+type+"-cou
nter").text(jQuery("#"+type+"-counter").text()-0+1)}if(c.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",c).remove();jQuery(".filename .title",c).css("font-weight","normal");jQuery("a.undo",c).addClass("hidden");jQuery(".menu_order_input",c).show();c.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+b.id+".startopen").removeClass("startopen").slideToggle(500).siblings(".toggle").toggle()}function wpQueueError(a){jQuery("#media-upload-error").show().html('<div class="error"><p>'+a+"</p>
</div>")}function wpFileError(b,a){itemAjaxError(b.id,a)}function itemAjaxError(d,c){var b=jQuery("#media-item-"+d),a=b.find(".filename").text();b.html('<div class="error-div"><a class="dismiss" href="#">'+pluploadL10n.dismiss+"</a><strong>"+pluploadL10n.error_uploading.replace("%s",jQuery.trim(a))+"</strong> "+c+"</div>")}function deleteSuccess(b,d){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var c=this.id,a=jQuery("#media-item-"+c);if(type=jQuery("#type-of-"+c).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(a.hasClass("child-of-"+post_id)){jQuery("
;#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",a).toggle();jQuery(".slidetoggle",a).slideUp(200).siblings().removeClass("hidden");a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",a).remove();jQuery(".filename .title",a).css("font-weight","bold");jQuery(".filename",a).append('<span class="trashnotice"> '+pluploadL10n.deleted+" </span>").siblings("a.toggle").hide();jQuery(".filename",a).append(jQuery("a.undo
",a).removeClass("hidden"));jQuery(".menu_order_input",a).hide();return}function deleteError(c,b,a){}function uploadComplete(){jQuery("#insert-gallery").prop("disabled",false)}function switchUploader(a){if(a){deleteUserSetting("uploader");jQuery(".media-upload-form").removeClass("html-uploader");if(typeof(uploader)=="object"){uploader.refresh()}}else{setUserSetting("uploader","1");jQuery(".media-upload-form").addClass("html-uploader")}}function dndHelper(a){var b=document.getElementById("dnd-helper");if(a){b.style.display="block"}else{b.style.display="none"}}function uploadError(b,c,a){switch(c){case plupload.FAILED:wpFileError(b,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileError(b,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:wpQueueError(pluploadL10n.file_exceeds_size_li
mit.replace("%s",b.name));break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(b,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(b,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(b,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:wpQueueError(pluploadL10n.io_error);break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(b,pluploadL10n.default_error)}}function uploadSizeError(a,b){var c=b.file;jQuery("#media-items").append('<div id="media-item-'+c.id+'" class="media-item error"><p>'+pluploadL10n.file_exceeds_size_limit.replace("%s",c.
name)+"</p></div>");a.removeFile(c)}jQuery(document).ready(function(a){a(".media-upload-form").bind("click.uploader",function(f){var d=a(f.target),b,g;if(d.is('input[type="radio"]')){b=d.closest("tr");if(a(b).hasClass("align")){setUserSetting("align",d.val())}else{if(a(b).hasClass("image-size")){setUserSetting("imgsize",d.val())}}}else{if(d.is("button.button")){g=f.target.className||"";g=g.match(/url([^ '"]+)/);if(g&&g[1]){setUserSetting("urlbutton",g[1]);d.siblings(".urlfield").val(d.attr("title"))}}else{if(d.is("a.dismiss")){d.parents(".media-item").fadeOut(200,function(){a(this).remove()})}else{if(d.is(".upload-flash-bypass a")||d.is("a.uploader-html")){switchUploader(0);return false}else{if(d.is(".upload-html-bypass a")){switchUploader(1);return false}}}}}});u
ploader_init=function(){uploader=new plupload.Uploader(wpUploaderInit);a("#image_resize").bind("change",function(){var b=a(this).prop("checked");setResize(b);if(b){setUserSetting("upload_resize","1")}else{deleteUserSetting("upload_resize")}});uploader.bind("Init",function(b){setResize(getUserSetting("upload_resize",false));if(b.features.dragdrop){a("#plupload-upload-ui").addClass("drag-drop");a("#drag-drop-area").bind("dragover.wp-uploader",function(){a(this).css("border-color","#ccff55")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){a(this).css("border-color","")})}else{a("#plupload-upload-ui").removeClass("drag-drop");a("#drag-drop-area").unbind(".wp-uploader")}});uploader.init();uploader.bind("FilesAdded",function(b,c){a("#media-upload-e
rror").html("");uploadStart();b.refresh();b.start()});uploader.bind("BeforeUpload",function(b,c){fileQueued(c)});uploader.bind("UploadFile",function(b,c){fileUploading(b,c)});uploader.bind("UploadProgress",function(b,c){uploadProgress(b,c)});uploader.bind("Error",function(b,c){if(c.code==plupload.FILE_SIZE_ERROR){uploadSizeError(b,c)}else{uploadError(c.file,c.code,c.message);b.refresh()}});uploader.bind("FileUploaded",function(b,d,c){uploadSuccess(d,c.response)});uploader.bind("UploadComplete",function(b,c){uploadComplete()})};if(typeof(wpUploaderInit)=="object"){uploader_init()}});
</del><span class="cx">\ No newline at end of file
</span><ins>+var topWin=window.dialogArguments||opener||parent||top,uploader,uploader_init;function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(b){jQuery(".media-blank").remove();var a=jQuery("#media-items").children();if(a.length==1){a.removeClass("open").find(".slidetoggle").slideUp(200)}jQuery("#media-items").append('<div id="media-item-'+b.id+'" class="media-item child-of-'+post_id+'"><div class="progress"><div class="percent">0%</div><div class="bar"></div></div><div class="filename original"> '+b.name+"</div></div>");jQuery(".progress",jQuery("#media-item-"+b.id)).fadeIn();jQuery("#insert-gallery").prop("disabled",true)}function uploadStart(){try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery(&q
uot;#TB_overlay").unbind("click",topWin.tb_remove)}}catch(a){}return true}function uploadProgress(a,b){var c=jQuery("#media-item-"+b.id);jQuery(".bar",c).width((200*b.percent)/100);jQuery(".percent",c).html(b.percent+"%");if(b.percent==100){setTimeout(function(){jQuery(".percent",c).html(pluploadL10n.crunching)},200)}}function fileUploading(c,d){var b=100*1024*1024,a=parseInt(c.settings.max_file_size,10);if(a>b&&d.size>b){setTimeout(function(){if(d.status==2&&d.loaded==0){wpFileError(d,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>"));if(c.current&&c.current.file.id==d.id&&c.current.xhr.abort){c.current.xhr.abort()}c.removeFile(d)}},10000)}}function updateMediaForm(){var a=jQuery("#media-items").children();if(a.length==1){a.addClass("open&qu
ot;).find(".slidetoggle").slideDown();jQuery(".insert-gallery").hide()}else{if(a.length>1){a.removeClass("open");jQuery(".insert-gallery").show()}}if(a.not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}}function uploadSuccess(c,a){var b=jQuery("#media-item-"+c.id);if(a.match("media-upload-error")){b.html(a);return}prepareMediaItem(c,a);updateMediaForm();if(b.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function setResize(a){if(a){if(uploader.features.jpgresize){uploader.settings.resize={width:resize_width,height:resize_height,quality:100}}else{uploader.settings.multipart_params.image_resize=true}}else{delete (uploader.settings.resize);delete (uploader.settings.multipart_params.image_resize)}}function prepareMediaItem(c,a){var d=(typeof shortform==&
quot;undefined")?1:2,b=jQuery("#media-item-"+c.id);jQuery(".bar",b).remove();jQuery(".progress",b).hide();try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load("async-upload.php",{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery("#media-item-"+b.id);jQuery(".thumbnail",a).clone().attr("class","pinkynail toggle").prependTo(a);jQuery(".filename.original",a).replaceWith(jQuery(".filename.new",a));jQuery("a.delete",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replac
e(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(d,e){var c=jQuery("#media-item-"+b.id);if(type=jQuery("#type-of-"+b.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-0+1)}if(c.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",c).remove();jQuery(".filename .title",c).css("font-weight","normal");jQuery("a.undo",c).addClass("hidden");jQuery(".menu_order_input",c).show();c.css({backgroundColor:"#ceb"}).animate({backgroundColo
r:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+b.id+".startopen").removeClass("startopen").addClass("open").find("slidetoggle").fadeIn()}function wpQueueError(a){jQuery("#media-upload-error").show().html('<div class="error"><p>'+a+"</p></div>")}function wpFileError(b,a){itemAjaxError(b.id,a)}function itemAjaxError(e,c){var b=jQuery("#media-item-"+e),a=b.find(".filename").text(),d=b.data("last-err");if(d==e){return}b.html('<div class="error-div"><a class="dismiss" href="#">'+pluploadL10n.dismiss+"</a><strong>"+pluploadL10n.error_uploading.replace("%s",jQuery.trim(a))+"</strong> "+c+"</div>").data("
;last-err",e)}function deleteSuccess(b,d){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var c=this.id,a=jQuery("#media-item-"+c);if(type=jQuery("#type-of-"+c).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(a.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",a).toggle();jQuery(".slidetoggle",a).slideUp(200).si
blings().removeClass("hidden");a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",a).remove();jQuery(".filename .title",a).css("font-weight","bold");jQuery(".filename",a).append('<span class="trashnotice"> '+pluploadL10n.deleted+" </span>").siblings("a.toggle").hide();jQuery(".filename",a).append(jQuery("a.undo",a).removeClass("hidden"));jQuery(".menu_order_input",a).hide();return}function deleteError(c,b,a){}function uploadComplete(){jQuery("#insert-gallery").prop("disabled",false)}function switchUploader(a){if(a){deleteUserSetting("uploader");jQuery(".media-upload-form").removeClass("html-uploader");if(typeof(uploader)=="object"){uploader.refresh()}}else{setUs
erSetting("uploader","1");jQuery(".media-upload-form").addClass("html-uploader")}}function dndHelper(a){var b=document.getElementById("dnd-helper");if(a){b.style.display="block"}else{b.style.display="none"}}function uploadError(d,e,c){var b=100*1024*1024,a;switch(e){case plupload.FAILED:wpFileError(d,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileError(d,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:wpQueueError(pluploadL10n.file_exceeds_size_limit.replace("%s",d.name));break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(d,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(d,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(d,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:a=parseInt(uplo
ader.settings.max_file_size,10);if(a>b&&d.size>b){wpFileError(d,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>"))}else{wpQueueError(pluploadL10n.io_error)}break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(d,pluploadL10n.default_error)}}function uploadSizeError(a,b){var c=b.file;jQuery("#media-items").append('<div id="media-item-'+c.id+'" class="media-item error"><p>'+pluploadL10n.file_exceeds_size_limit.replace("%s",c.name)+"</p></div>");a.removeFile(c)}jQuery(document).ready(function(a){a(".media-upload-form").bind("click.uploader&
quot;,function(f){var d=a(f.target),b,g;if(d.is('input[type="radio"]')){b=d.closest("tr");if(a(b).hasClass("align")){setUserSetting("align",d.val())}else{if(a(b).hasClass("image-size")){setUserSetting("imgsize",d.val())}}}else{if(d.is("button.button")){g=f.target.className||"";g=g.match(/url([^ '"]+)/);if(g&&g[1]){setUserSetting("urlbutton",g[1]);d.siblings(".urlfield").val(d.attr("title"))}}else{if(d.is("a.dismiss")){d.parents(".media-item").fadeOut(200,function(){a(this).remove()})}else{if(d.is(".upload-flash-bypass a")||d.is("a.uploader-html")){a("#media-items, p.submit").css("display","none");switchUploader(0);return false}else{if(d.is(".upload-html-bypass a")){a("#media-items, p.submit").css("display","");switchUploader(1);return false}else{
if(d.is("a.describe-toggle-on")){d.parent().addClass("open");d.siblings(".slidetoggle").fadeIn(250,function(){var i=a(window).scrollTop(),e=a(window).height(),k=a(this).offset().top,j=a(this).height(),c,l;if(e&&k&&j){c=k+j;l=i+e;if(c>l){if(c-l<k-i){window.scrollBy(0,(c-l)+10)}else{window.scrollBy(0,k-i-40)}}}});return false}else{if(d.is("a.describe-toggle-off")){d.siblings(".slidetoggle").fadeOut(250,function(){d.parent().removeClass("open")});return false}}}}}}}});uploader_init=function(){uploader=new plupload.Uploader(wpUploaderInit);a("#image_resize").bind("change",function(){var b=a(this).prop("checked");setResize(b);if(b){setUserSetting("upload_resize","1")}else{deleteUserSetting("upload_resize")}});uploader.bind("Init",function(b){setResize(getUserSetting("upload_resize",false));if(b.features.dragdrop){a("
;#plupload-upload-ui").addClass("drag-drop");a("#drag-drop-area").bind("dragover.wp-uploader",function(){a(this).css("border-color","#ccff55")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){a(this).css("border-color","")})}else{a("#plupload-upload-ui").removeClass("drag-drop");a("#drag-drop-area").unbind(".wp-uploader")}});uploader.init();uploader.bind("FilesAdded",function(b,c){a("#media-upload-error").html("");uploadStart();b.refresh();b.start()});uploader.bind("BeforeUpload",function(b,c){fileQueued(c)});uploader.bind("UploadFile",function(b,c){fileUploading(b,c)});uploader.bind("UploadProgress",function(b,c){uploadProgress(b,c)});uploader.bind("Error",function(b,c){if(c.code==plupload.FILE_SIZE_ERROR){uploadSizeError(b,c)}else{uploadError(c.file,c.code,c.message);b.r
efresh()}});uploader.bind("FileUploaded",function(b,d,c){uploadSuccess(d,c.response)});uploader.bind("UploadComplete",function(b,c){uploadComplete()})};if(typeof(wpUploaderInit)=="object"){uploader_init()}});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (19267 => 19268)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-11-13 15:20:25 UTC (rev 19267)
+++ trunk/wp-includes/script-loader.php        2011-11-13 18:37:30 UTC (rev 19268)
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">         // cannot use the plupload.full.js, as it loads browserplus init JS from Yahoo
</span><span class="cx">         $scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1511-20111112');
</span><span class="cx">
</span><del>-        $scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111112');
</del><ins>+        $scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111113');
</ins><span class="cx">         $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
</span><span class="cx">
</span><span class="cx">         // keep 'swfupload' for back-compat.
</span></span></pre>
</div>
</div>
</body>
</html>