<!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>[19306] trunk: Make the Save All Changes initially hidden on Media -&gt; Add New screen, improve the progress bar &quot;progress&quot; to 1px ticks, see #19190</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/19306">19306</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-11-15 21:22:27 +0000 (Tue, 15 Nov 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make the Save All Changes initially hidden on Media -&gt; Add New screen, improve the progress bar &quot;progress&quot; to 1px ticks, see <a href="http://core.trac.wordpress.org/ticket/19190">#19190</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmediauploadphp">trunk/wp-admin/media-upload.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminmediauploadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/media-upload.php (19305 => 19306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/media-upload.php        2011-11-15 21:19:29 UTC (rev 19305)
+++ trunk/wp-admin/media-upload.php        2011-11-15 21:22:27 UTC (rev 19306)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">         &lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; id=&quot;post_id&quot; value=&quot;0&quot; /&gt;
</span><span class="cx">         &lt;?php wp_nonce_field('media-form'); ?&gt;
</span><span class="cx">         &lt;div id=&quot;media-items&quot; class=&quot;hide-if-no-js&quot;&gt;&lt;/div&gt;
</span><del>-        &lt;?php submit_button( __( 'Save all changes' ), 'button savebutton hide-if-no-js', 'save' ); ?&gt;
</del><ins>+        &lt;?php submit_button( __( 'Save all changes' ), 'button savebutton hidden', 'save' ); ?&gt;
</ins><span class="cx">         &lt;/form&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesjspluploadhandlersdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/handlers.dev.js (19305 => 19306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/handlers.dev.js        2011-11-15 21:19:29 UTC (rev 19305)
+++ trunk/wp-includes/js/plupload/handlers.dev.js        2011-11-15 21:22:27 UTC (rev 19306)
</span><span class="lines">@@ -36,14 +36,8 @@
</span><span class="cx"> function uploadProgress(up, file) {
</span><span class="cx">         var item = jQuery('#media-item-' + file.id);
</span><span class="cx"> 
</span><del>-        jQuery('.bar', item).width( (200 * file.percent) / 100 );
</del><ins>+        jQuery('.bar', item).width( (200 * file.loaded) / file.size );
</ins><span class="cx">         jQuery('.percent', item).html( file.percent + '%' );
</span><del>-
-        if ( file.percent == 100 ) {
-                setTimeout( function(){
-                        jQuery('.percent', item).html( pluploadL10n.crunching );
-                }, 200 );
-        }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // check to see if a large file failed to upload
</span><span class="lines">@@ -57,8 +51,6 @@
</span><span class="cx"> 
</span><span class="cx">                                 if ( up.current &amp;&amp; up.current.file.id == file.id &amp;&amp; up.current.xhr.abort )
</span><span class="cx">                                         up.current.xhr.abort();
</span><del>-
-                                up.removeFile(file);
</del><span class="cx">                         }
</span><span class="cx">                 }, 10000); // wait for 10 sec. for the file to start uploading
</span><span class="cx">         }
</span><span class="lines">@@ -91,6 +83,8 @@
</span><span class="cx">         if ( serverData.match('media-upload-error') ) {
</span><span class="cx">                 item.html(serverData);
</span><span class="cx">                 return;
</span><ins>+        } else if ( fileObj.status == 5 ) {
+                jQuery('.percent', item).html( pluploadL10n.crunching );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         prepareMediaItem(fileObj, serverData);
</span></span></pre></div>
<a id="trunkwpincludesjspluploadhandlersjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/handlers.js (19305 => 19306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/handlers.js        2011-11-15 21:19:29 UTC (rev 19305)
+++ trunk/wp-includes/js/plupload/handlers.js        2011-11-15 21:22:27 UTC (rev 19306)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var topWin=window.dialogArguments||opener||parent||top,uploader,uploader_init;function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(b){jQuery(&quot;.media-blank&quot;).remove();var a=jQuery(&quot;#media-items&quot;).children();if(a.length==1){a.removeClass(&quot;open&quot;).find(&quot;.slidetoggle&quot;).slideUp(200)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+b.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;percent&quot;&gt;0%&lt;/div&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt; '+b.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,jQuery(&quot;#media-item-&quot;+b.id)).fadeIn();jQuery(&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,true)}function uploadStart(){try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&q
 uot;#TB_overlay&quot;).unbind(&quot;click&quot;,topWin.tb_remove)}}catch(a){}return true}function uploadProgress(a,b){var c=jQuery(&quot;#media-item-&quot;+b.id);jQuery(&quot;.bar&quot;,c).width((200*b.percent)/100);jQuery(&quot;.percent&quot;,c).html(b.percent+&quot;%&quot;);if(b.percent==100){setTimeout(function(){jQuery(&quot;.percent&quot;,c).html(pluploadL10n.crunching)},200)}}function fileUploading(c,d){var b=100*1024*1024,a=parseInt(c.settings.max_file_size,10);if(a&gt;b&amp;&amp;d.size&gt;b){setTimeout(function(){if(d.status==2&amp;&amp;d.loaded==0){wpFileError(d,pluploadL10n.big_upload_failed.replace(&quot;%1$s&quot;,'&lt;a class=&quot;uploader-html&quot; href=&quot;#&quot;&gt;').replace(&quot;%2$s&quot;,&quot;&lt;/a&gt;&quot;));if(c.current&amp;&amp;c.current.file.id==d.id&amp;&amp;c.current.xhr.abort){c.current.xhr.abort()}c.removeFile(d)}},10000)}}function updateMediaForm(){var a=jQuery(&quot;#media-items&quot;).children();if(a.length==1){a.addClass(&quot;open&qu
 ot;).find(&quot;.slidetoggle&quot;).slideDown();jQuery(&quot;.insert-gallery&quot;).hide()}else{if(a.length&gt;1){a.removeClass(&quot;open&quot;);jQuery(&quot;.insert-gallery&quot;).show()}}if(a.not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}}function uploadSuccess(c,a){var b=jQuery(&quot;#media-item-&quot;+c.id);if(a.match(&quot;media-upload-error&quot;)){b.html(a);return}prepareMediaItem(c,a);updateMediaForm();if(b.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).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&quot;)?1:2,b=jQuery(&quot;#media-item-&quot;+c.id);jQuery(&quot;.bar&quot;,b).remove();jQuery(&quot;.progress&quot;,b).hide();try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&quot;#TB_overlay&quot;).click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load(&quot;async-upload.php&quot;,{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery(&quot;#media-item-&quot;+b.id);jQuery(&quot;.thumbnail&quot;,a).clone().attr(&quot;class&quot;,&quot;pinkynail toggle&quot;).prependTo(a);jQuery(&quot;.filename.original&quot;,a).replaceWith(jQuery(&quot;.filename.new&quot;,a));jQuery(&quot;a.delete&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;trash-post&quot;,_ajax_nonce:this.href.replac
 e(/^.*wpnonce=/,&quot;&quot;)}});return false});jQuery(&quot;a.undo&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;untrash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)},success:function(d,e){var c=jQuery(&quot;#media-item-&quot;+b.id);if(type=jQuery(&quot;#type-of-&quot;+b.id).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-0+1)}if(c.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-0+1)}jQuery(&quot;.filename .trashnotice&quot;,c).remove();jQuery(&quot;.filename .title&quot;,c).css(&quot;font-weight&quot;,&quot;normal&quot;);jQuery(&quot;a.undo&quot;,c).addClass(&quot;hidden&quot;);jQuery(&quot;.menu_order_input&quot;,c).show();c.css({backgroundColor:&quot;#ceb&quot;}).animate({backgroundColo
 r:&quot;#fff&quot;},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}}).removeClass(&quot;undo&quot;)}});return false});jQuery(&quot;#media-item-&quot;+b.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).addClass(&quot;open&quot;).find(&quot;slidetoggle&quot;).fadeIn()}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().html('&lt;div class=&quot;error&quot;&gt;&lt;p&gt;'+a+&quot;&lt;/p&gt;&lt;/div&gt;&quot;)}function wpFileError(b,a){itemAjaxError(b.id,a)}function itemAjaxError(e,c){var b=jQuery(&quot;#media-item-&quot;+e),a=b.find(&quot;.filename&quot;).text(),d=b.data(&quot;last-err&quot;);if(d==e){return}b.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,jQuery.trim(a))+&quot;&lt;/strong&gt; &quot;+c+&quot;&lt;/div&gt;&quot;).data(&quot
 ;last-err&quot;,e)}function deleteSuccess(b,d){if(b==&quot;-1&quot;){return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;)}if(b==&quot;0&quot;){return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;)}var c=this.id,a=jQuery(&quot;#media-item-&quot;+c);if(type=jQuery(&quot;#type-of-&quot;+c).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1)}if(a.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1)}if(jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0){jQuery(&quot;.toggle&quot;).toggle();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;.toggle&quot;,a).toggle();jQuery(&quot;.slidetoggle&quot;,a).slideUp(200).si
 blings().removeClass(&quot;hidden&quot;);a.css({backgroundColor:&quot;#faa&quot;}).animate({backgroundColor:&quot;#f4f4f4&quot;},{queue:false,duration:500}).addClass(&quot;undo&quot;);jQuery(&quot;.filename:empty&quot;,a).remove();jQuery(&quot;.filename .title&quot;,a).css(&quot;font-weight&quot;,&quot;bold&quot;);jQuery(&quot;.filename&quot;,a).append('&lt;span class=&quot;trashnotice&quot;&gt; '+pluploadL10n.deleted+&quot; &lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).hide();jQuery(&quot;.filename&quot;,a).append(jQuery(&quot;a.undo&quot;,a).removeClass(&quot;hidden&quot;));jQuery(&quot;.menu_order_input&quot;,a).hide();return}function deleteError(c,b,a){}function uploadComplete(){jQuery(&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,false)}function switchUploader(a){if(a){deleteUserSetting(&quot;uploader&quot;);jQuery(&quot;.media-upload-form&quot;).removeClass(&quot;html-uploader&quot;);if(typeof(uploader)==&quot;object&quot;){uploader.refresh()}}else{setUs
 erSetting(&quot;uploader&quot;,&quot;1&quot;);jQuery(&quot;.media-upload-form&quot;).addClass(&quot;html-uploader&quot;)}}function dndHelper(a){var b=document.getElementById(&quot;dnd-helper&quot;);if(a){b.style.display=&quot;block&quot;}else{b.style.display=&quot;none&quot;}}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(&quot;%s&quot;,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&gt;b&amp;&amp;d.size&gt;b){wpFileError(d,pluploadL10n.big_upload_failed.replace(&quot;%1$s&quot;,'&lt;a class=&quot;uploader-html&quot; href=&quot;#&quot;&gt;').replace(&quot;%2$s&quot;,&quot;&lt;/a&gt;&quot;))}else{wpQueueError(pluploadL10n.io_error)}break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(&quot;.media-upload-form&quot;).addClass(&quot;html-uploader&quot;);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(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+c.id+'&quot; class=&quot;media-item error&quot;&gt;&lt;p&gt;'+pluploadL10n.file_exceeds_size_limit.replace(&quot;%s&quot;,c.name)+&quot;&lt;/p&gt;&lt;/div&gt;&quot;);a.removeFile(c)}jQuery(document).ready(function(a){a(&quot;.media-upload-form&quot;).bind(&quot;click.uploader&
 quot;,function(f){var d=a(f.target),b,g;if(d.is('input[type=&quot;radio&quot;]')){b=d.closest(&quot;tr&quot;);if(a(b).hasClass(&quot;align&quot;)){setUserSetting(&quot;align&quot;,d.val())}else{if(a(b).hasClass(&quot;image-size&quot;)){setUserSetting(&quot;imgsize&quot;,d.val())}}}else{if(d.is(&quot;button.button&quot;)){g=f.target.className||&quot;&quot;;g=g.match(/url([^ '&quot;]+)/);if(g&amp;&amp;g[1]){setUserSetting(&quot;urlbutton&quot;,g[1]);d.siblings(&quot;.urlfield&quot;).val(d.attr(&quot;title&quot;))}}else{if(d.is(&quot;a.dismiss&quot;)){d.parents(&quot;.media-item&quot;).fadeOut(200,function(){a(this).remove()})}else{if(d.is(&quot;.upload-flash-bypass a&quot;)||d.is(&quot;a.uploader-html&quot;)){a(&quot;#media-items, p.submit, span.big-file-warning&quot;).css(&quot;display&quot;,&quot;none&quot;);switchUploader(0);return false}else{if(d.is(&quot;.upload-html-bypass a&quot;)){a(&quot;#media-items, p.submit, span.big-file-warning&quot;).css(&quot;display&quot;,&quo
 t;&quot;);switchUploader(1);return false}else{if(d.is(&quot;a.describe-toggle-on&quot;)){d.parent().addClass(&quot;open&quot;);d.siblings(&quot;.slidetoggle&quot;).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&amp;&amp;k&amp;&amp;j){c=k+j;l=i+e;if(c&gt;l){if(c-l&lt;k-i){window.scrollBy(0,(c-l)+10)}else{window.scrollBy(0,k-i-40)}}}});return false}else{if(d.is(&quot;a.describe-toggle-off&quot;)){d.siblings(&quot;.slidetoggle&quot;).fadeOut(250,function(){d.parent().removeClass(&quot;open&quot;)});return false}}}}}}}});uploader_init=function(){uploader=new plupload.Uploader(wpUploaderInit);a(&quot;#image_resize&quot;).bind(&quot;change&quot;,function(){var b=a(this).prop(&quot;checked&quot;);setResize(b);if(b){setUserSetting(&quot;upload_resize&quot;,&quot;1&quot;)}else{deleteUserSetting(&quot;upload_resize&quot;)}});uploader.bind(&quot;Init&quot;,function(b){setResize(getUserSetting(&quot;upload_resize
 &quot;,false));if(b.features.dragdrop){a(&quot;#plupload-upload-ui&quot;).addClass(&quot;drag-drop&quot;);a(&quot;#drag-drop-area&quot;).bind(&quot;dragover.wp-uploader&quot;,function(){a(this).css(&quot;border-color&quot;,&quot;#ccff55&quot;)}).bind(&quot;dragleave.wp-uploader, drop.wp-uploader&quot;,function(){a(this).css(&quot;border-color&quot;,&quot;&quot;)})}else{a(&quot;#plupload-upload-ui&quot;).removeClass(&quot;drag-drop&quot;);a(&quot;#drag-drop-area&quot;).unbind(&quot;.wp-uploader&quot;)}});uploader.init();uploader.bind(&quot;FilesAdded&quot;,function(b,c){a(&quot;#media-upload-error&quot;).html(&quot;&quot;);uploadStart();b.refresh();b.start()});uploader.bind(&quot;BeforeUpload&quot;,function(b,c){fileQueued(c)});uploader.bind(&quot;UploadFile&quot;,function(b,c){fileUploading(b,c)});uploader.bind(&quot;UploadProgress&quot;,function(b,c){uploadProgress(b,c)});uploader.bind(&quot;Error&quot;,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(&quot;FileUploaded&quot;,function(b,d,c){uploadSuccess(d,c.response)});uploader.bind(&quot;UploadComplete&quot;,function(b,c){uploadComplete()})};if(typeof(wpUploaderInit)==&quot;object&quot;){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(&quot;#media-upload-error&quot;).empty()}function fileQueued(b){jQuery(&quot;.media-blank&quot;).remove();var a=jQuery(&quot;#media-items&quot;).children();if(a.length==1){a.removeClass(&quot;open&quot;).find(&quot;.slidetoggle&quot;).slideUp(200)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+b.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;percent&quot;&gt;0%&lt;/div&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt; '+b.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,jQuery(&quot;#media-item-&quot;+b.id)).fadeIn();jQuery(&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,true)}function uploadStart(){try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&q
 uot;#TB_overlay&quot;).unbind(&quot;click&quot;,topWin.tb_remove)}}catch(a){}return true}function uploadProgress(a,b){var c=jQuery(&quot;#media-item-&quot;+b.id);jQuery(&quot;.bar&quot;,c).width((200*b.loaded)/b.size);jQuery(&quot;.percent&quot;,c).html(b.percent+&quot;%&quot;)}function fileUploading(c,d){var b=100*1024*1024,a=parseInt(c.settings.max_file_size,10);if(a&gt;b&amp;&amp;d.size&gt;b){setTimeout(function(){if(d.status==2&amp;&amp;d.loaded==0){wpFileError(d,pluploadL10n.big_upload_failed.replace(&quot;%1$s&quot;,'&lt;a class=&quot;uploader-html&quot; href=&quot;#&quot;&gt;').replace(&quot;%2$s&quot;,&quot;&lt;/a&gt;&quot;));if(c.current&amp;&amp;c.current.file.id==d.id&amp;&amp;c.current.xhr.abort){c.current.xhr.abort()}}},10000)}}function updateMediaForm(){var a=jQuery(&quot;#media-items&quot;).children();if(a.length==1){a.addClass(&quot;open&quot;).find(&quot;.slidetoggle&quot;).slideDown();jQuery(&quot;.insert-gallery&quot;).hide()}else{if(a.length&gt;1){a.remov
 eClass(&quot;open&quot;);jQuery(&quot;.insert-gallery&quot;).show()}}if(a.not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}}function uploadSuccess(c,a){var b=jQuery(&quot;#media-item-&quot;+c.id);if(a.match(&quot;media-upload-error&quot;)){b.html(a);return}else{if(c.status==5){jQuery(&quot;.percent&quot;,b).html(pluploadL10n.crunching)}}prepareMediaItem(c,a);updateMediaForm();if(b.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).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&quot;)?1:2,b=jQuery(&quo
 t;#media-item-&quot;+c.id);jQuery(&quot;.bar&quot;,b).remove();jQuery(&quot;.progress&quot;,b).hide();try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&quot;#TB_overlay&quot;).click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load(&quot;async-upload.php&quot;,{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery(&quot;#media-item-&quot;+b.id);jQuery(&quot;.thumbnail&quot;,a).clone().attr(&quot;class&quot;,&quot;pinkynail toggle&quot;).prependTo(a);jQuery(&quot;.filename.original&quot;,a).replaceWith(jQuery(&quot;.filename.new&quot;,a));jQuery(&quot;a.delete&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;trash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)}});return
  false});jQuery(&quot;a.undo&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;untrash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)},success:function(d,e){var c=jQuery(&quot;#media-item-&quot;+b.id);if(type=jQuery(&quot;#type-of-&quot;+b.id).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-0+1)}if(c.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-0+1)}jQuery(&quot;.filename .trashnotice&quot;,c).remove();jQuery(&quot;.filename .title&quot;,c).css(&quot;font-weight&quot;,&quot;normal&quot;);jQuery(&quot;a.undo&quot;,c).addClass(&quot;hidden&quot;);jQuery(&quot;.menu_order_input&quot;,c).show();c.css({backgroundColor:&quot;#ceb&quot;}).animate({backgroundColor:&quot;#fff&quot;},{queue:false,durati
 on:500,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}}).removeClass(&quot;undo&quot;)}});return false});jQuery(&quot;#media-item-&quot;+b.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).addClass(&quot;open&quot;).find(&quot;slidetoggle&quot;).fadeIn()}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().html('&lt;div class=&quot;error&quot;&gt;&lt;p&gt;'+a+&quot;&lt;/p&gt;&lt;/div&gt;&quot;)}function wpFileError(b,a){itemAjaxError(b.id,a)}function itemAjaxError(e,c){var b=jQuery(&quot;#media-item-&quot;+e),a=b.find(&quot;.filename&quot;).text(),d=b.data(&quot;last-err&quot;);if(d==e){return}b.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,jQuery.trim(a))+&quot;&lt;/strong&gt; &quot;+c+&quot;&lt;/div&gt;&quot;).data(&quot;last-err&quot;,e)}function deleteSucce
 ss(b,d){if(b==&quot;-1&quot;){return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;)}if(b==&quot;0&quot;){return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;)}var c=this.id,a=jQuery(&quot;#media-item-&quot;+c);if(type=jQuery(&quot;#type-of-&quot;+c).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1)}if(a.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1)}if(jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0){jQuery(&quot;.toggle&quot;).toggle();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;.toggle&quot;,a).toggle();jQuery(&quot;.slidetoggle&quot;,a).slideUp(200).siblings().removeClass(&quot;hidden&quot;
 );a.css({backgroundColor:&quot;#faa&quot;}).animate({backgroundColor:&quot;#f4f4f4&quot;},{queue:false,duration:500}).addClass(&quot;undo&quot;);jQuery(&quot;.filename:empty&quot;,a).remove();jQuery(&quot;.filename .title&quot;,a).css(&quot;font-weight&quot;,&quot;bold&quot;);jQuery(&quot;.filename&quot;,a).append('&lt;span class=&quot;trashnotice&quot;&gt; '+pluploadL10n.deleted+&quot; &lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).hide();jQuery(&quot;.filename&quot;,a).append(jQuery(&quot;a.undo&quot;,a).removeClass(&quot;hidden&quot;));jQuery(&quot;.menu_order_input&quot;,a).hide();return}function deleteError(c,b,a){}function uploadComplete(){jQuery(&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,false)}function switchUploader(a){if(a){deleteUserSetting(&quot;uploader&quot;);jQuery(&quot;.media-upload-form&quot;).removeClass(&quot;html-uploader&quot;);if(typeof(uploader)==&quot;object&quot;){uploader.refresh()}}else{setUserSetting(&quot;uploader&quot;,&quot;1&
 quot;);jQuery(&quot;.media-upload-form&quot;).addClass(&quot;html-uploader&quot;)}}function dndHelper(a){var b=document.getElementById(&quot;dnd-helper&quot;);if(a){b.style.display=&quot;block&quot;}else{b.style.display=&quot;none&quot;}}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(&quot;%s&quot;,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(uploader.settings.max_file_size,10);if(a&gt
 ;b&amp;&amp;d.size&gt;b){wpFileError(d,pluploadL10n.big_upload_failed.replace(&quot;%1$s&quot;,'&lt;a class=&quot;uploader-html&quot; href=&quot;#&quot;&gt;').replace(&quot;%2$s&quot;,&quot;&lt;/a&gt;&quot;))}else{wpQueueError(pluploadL10n.io_error)}break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(&quot;.media-upload-form&quot;).addClass(&quot;html-uploader&quot;);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(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+c.id+'&quot; class=&quot;media-item error&quot;&gt;&lt;p&gt;'+pluploadL10n.file_exceeds_size_limit.replace(&quot;%s&quot;,c.name)+&quot;&lt;/p&gt;&lt;/div&gt;&quot;);a.removeFile(c)}jQuery(document).ready(function(a){a(&quot;.media-upload-form&quot;).bind(&quot;click.uploader&quot;,function(f){var d=a(f.target),b,g
 ;if(d.is('input[type=&quot;radio&quot;]')){b=d.closest(&quot;tr&quot;);if(a(b).hasClass(&quot;align&quot;)){setUserSetting(&quot;align&quot;,d.val())}else{if(a(b).hasClass(&quot;image-size&quot;)){setUserSetting(&quot;imgsize&quot;,d.val())}}}else{if(d.is(&quot;button.button&quot;)){g=f.target.className||&quot;&quot;;g=g.match(/url([^ '&quot;]+)/);if(g&amp;&amp;g[1]){setUserSetting(&quot;urlbutton&quot;,g[1]);d.siblings(&quot;.urlfield&quot;).val(d.attr(&quot;title&quot;))}}else{if(d.is(&quot;a.dismiss&quot;)){d.parents(&quot;.media-item&quot;).fadeOut(200,function(){a(this).remove()})}else{if(d.is(&quot;.upload-flash-bypass a&quot;)||d.is(&quot;a.uploader-html&quot;)){a(&quot;#media-items, p.submit, span.big-file-warning&quot;).css(&quot;display&quot;,&quot;none&quot;);switchUploader(0);return false}else{if(d.is(&quot;.upload-html-bypass a&quot;)){a(&quot;#media-items, p.submit, span.big-file-warning&quot;).css(&quot;display&quot;,&quot;&quot;);switchUploader(1);return fals
 e}else{if(d.is(&quot;a.describe-toggle-on&quot;)){d.parent().addClass(&quot;open&quot;);d.siblings(&quot;.slidetoggle&quot;).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&amp;&amp;k&amp;&amp;j){c=k+j;l=i+e;if(c&gt;l){if(c-l&lt;k-i){window.scrollBy(0,(c-l)+10)}else{window.scrollBy(0,k-i-40)}}}});return false}else{if(d.is(&quot;a.describe-toggle-off&quot;)){d.siblings(&quot;.slidetoggle&quot;).fadeOut(250,function(){d.parent().removeClass(&quot;open&quot;)});return false}}}}}}}});uploader_init=function(){uploader=new plupload.Uploader(wpUploaderInit);a(&quot;#image_resize&quot;).bind(&quot;change&quot;,function(){var b=a(this).prop(&quot;checked&quot;);setResize(b);if(b){setUserSetting(&quot;upload_resize&quot;,&quot;1&quot;)}else{deleteUserSetting(&quot;upload_resize&quot;)}});uploader.bind(&quot;Init&quot;,function(b){setResize(getUserSetting(&quot;upload_resize&quot;,false));if(b.features.dragdrop){
 a(&quot;#plupload-upload-ui&quot;).addClass(&quot;drag-drop&quot;);a(&quot;#drag-drop-area&quot;).bind(&quot;dragover.wp-uploader&quot;,function(){a(this).css(&quot;border-color&quot;,&quot;#ccff55&quot;)}).bind(&quot;dragleave.wp-uploader, drop.wp-uploader&quot;,function(){a(this).css(&quot;border-color&quot;,&quot;&quot;)})}else{a(&quot;#plupload-upload-ui&quot;).removeClass(&quot;drag-drop&quot;);a(&quot;#drag-drop-area&quot;).unbind(&quot;.wp-uploader&quot;)}});uploader.init();uploader.bind(&quot;FilesAdded&quot;,function(b,c){a(&quot;#media-upload-error&quot;).html(&quot;&quot;);uploadStart();b.refresh();b.start()});uploader.bind(&quot;BeforeUpload&quot;,function(b,c){fileQueued(c)});uploader.bind(&quot;UploadFile&quot;,function(b,c){fileUploading(b,c)});uploader.bind(&quot;UploadProgress&quot;,function(b,c){uploadProgress(b,c)});uploader.bind(&quot;Error&quot;,function(b,c){if(c.code==plupload.FILE_SIZE_ERROR){uploadSizeError(b,c)}else{uploadError(c.file,c.code,c.messa
 ge);b.refresh()}});uploader.bind(&quot;FileUploaded&quot;,function(b,d,c){uploadSuccess(d,c.response)});uploader.bind(&quot;UploadComplete&quot;,function(b,c){uploadComplete()})};if(typeof(wpUploaderInit)==&quot;object&quot;){uploader_init()}});
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>