<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[12189] trunk: Fix style of text fields in IE6 in the uploader,
  better regex for Link URL presets buttons</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12189">12189</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-11-16 07:16:34 +0000 (Mon, 16 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix style of text fields in IE6 in the uploader, better regex for Link URL presets buttons</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincssiecss">trunk/wp-admin/css/ie.css</a></li>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpincludesjsswfuploadhandlersdevjs">trunk/wp-includes/js/swfupload/handlers.dev.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadhandlersjs">trunk/wp-includes/js/swfupload/handlers.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincssiecss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/ie.css (12188 => 12189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/ie.css        2009-11-16 01:37:30 UTC (rev 12188)
+++ trunk/wp-admin/css/ie.css        2009-11-16 07:16:34 UTC (rev 12189)
</span><span class="lines">@@ -420,3 +420,8 @@
</span><span class="cx"> #wpcontent #ajax-loading {
</span><span class="cx">         vertical-align: baseline;
</span><span class="cx"> }
</span><ins>+
+* html .describe .field input.text,
+* html .describe .field textarea {
+        width: 440px;
+}
</ins></span></pre></div>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (12188 => 12189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2009-11-16 01:37:30 UTC (rev 12188)
+++ trunk/wp-admin/includes/media.php        2009-11-16 07:16:34 UTC (rev 12189)
</span><span class="lines">@@ -876,7 +876,7 @@
</span><span class="cx">                 $url = $link;
</span><span class="cx"> 
</span><span class="cx">         return &quot;
</span><del>-        &lt;input type='text' class='urlfield' name='attachments[$post-&gt;ID][url]' value='&quot; . esc_attr($url) . &quot;' /&gt;&lt;br /&gt;
</del><ins>+        &lt;input type='text' class='text urlfield' name='attachments[$post-&gt;ID][url]' value='&quot; . esc_attr($url) . &quot;' /&gt;&lt;br /&gt;
</ins><span class="cx">         &lt;button type='button' class='button urlnone' title=''&gt;&quot; . __('None') . &quot;&lt;/button&gt;
</span><span class="cx">         &lt;button type='button' class='button urlfile' title='&quot; . esc_attr($file) . &quot;'&gt;&quot; . __('File URL') . &quot;&lt;/button&gt;
</span><span class="cx">         &lt;button type='button' class='button urlpost' title='&quot; . esc_attr($link) . &quot;'&gt;&quot; . __('Post URL') . &quot;&lt;/button&gt;
</span><span class="lines">@@ -1037,7 +1037,7 @@
</span><span class="cx">                 'image_url'        =&gt; array(
</span><span class="cx">                         'label'      =&gt; __('File URL'),
</span><span class="cx">                         'input'      =&gt; 'html',
</span><del>-                        'html'       =&gt; &quot;&lt;input type='text' class='urlfield' readonly='readonly' name='attachments[$post-&gt;ID][url]' value='&quot; . esc_attr($image_url) . &quot;' /&gt;&lt;br /&gt;&quot;,
</del><ins>+                        'html'       =&gt; &quot;&lt;input type='text' class='text urlfield' readonly='readonly' name='attachments[$post-&gt;ID][url]' value='&quot; . esc_attr($image_url) . &quot;' /&gt;&lt;br /&gt;&quot;,
</ins><span class="cx">                         'value'      =&gt; isset($edit_post-&gt;post_url) ? $edit_post-&gt;post_url : wp_get_attachment_url($post-&gt;ID),
</span><span class="cx">                         'helps'      =&gt; __('Location of the uploaded file.')
</span><span class="cx">                 )
</span><span class="lines">@@ -1264,7 +1264,7 @@
</span><span class="cx">                 elseif ( $field['input'] == 'textarea' ) {
</span><span class="cx">                         $item .= &quot;&lt;textarea type='text' id='$name' name='$name'&quot; . $aria_required . &quot;&gt;&quot; . esc_html( $field['value'] ) . &quot;&lt;/textarea&gt;&quot;;
</span><span class="cx">                 } else {
</span><del>-                        $item .= &quot;&lt;input type='text' id='$name' name='$name' value='&quot; . esc_attr( $field['value'] ) . &quot;'&quot; . $aria_required . &quot;/&gt;&quot;;
</del><ins>+                        $item .= &quot;&lt;input type='text' class='text' id='$name' name='$name' value='&quot; . esc_attr( $field['value'] ) . &quot;'&quot; . $aria_required . &quot;/&gt;&quot;;
</ins><span class="cx">                 }
</span><span class="cx">                 if ( !empty($field['helps']) )
</span><span class="cx">                         $item .= &quot;&lt;p class='help'&gt;&quot; . join( &quot;&lt;/p&gt;\n&lt;p class='help'&gt;&quot;, array_unique((array) $field['helps']) ) . '&lt;/p&gt;';
</span></span></pre></div>
<a id="trunkwpincludesjsswfuploadhandlersdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/swfupload/handlers.dev.js (12188 => 12189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/handlers.dev.js        2009-11-16 01:37:30 UTC (rev 12188)
+++ trunk/wp-includes/js/swfupload/handlers.dev.js        2009-11-16 07:16:34 UTC (rev 12189)
</span><span class="lines">@@ -328,9 +328,9 @@
</span><span class="cx"> 
</span><span class="cx">         $('button.button', '#media-items').live('click', function(){
</span><span class="cx">                 var c = this.className || '';
</span><del>-                c = c.replace(/.*?url([^ '&quot;]+).*/, '$1');
-                if ( c ) {
-                        setUserSetting('urlbutton', c);
</del><ins>+                c = c.match(/url([^ '&quot;]+)/);
+                if ( c &amp;&amp; c[1] ) {
+                        setUserSetting('urlbutton', c[1]);
</ins><span class="cx">                         $(this).siblings('.urlfield').val( $(this).attr('title') );
</span><span class="cx">                 }
</span><span class="cx">         });
</span></span></pre></div>
<a id="trunkwpincludesjsswfuploadhandlersjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/swfupload/handlers.js (12188 => 12189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/handlers.js        2009-11-16 01:37:30 UTC (rev 12188)
+++ trunk/wp-includes/js/swfupload/handlers.js        2009-11-16 07:16:34 UTC (rev 12189)
</span><span class="lines">@@ -1 +1 @@
</span><del>-function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();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;.describe-toggle-on&quot;).show();jQuery(&quot;.describe-toggle-off&quot;).hide();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,&quot;#media-item-&quot;+a.id).show();jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}function uploadStart(a){return true}function uploadProgress(e,b,d){var a=jQuery(&quot;#media-items&quot;).width()-2,c=jQuery(&quot;#media-item-&quot;+e.id);jQuery(&quot;.bar&quot;,c).width(a*b/d);jQuery(&quot;.percent&quot;,c).html(Math.ceil(b/d*100)+&quot;%&quot;);if(b==d){jQuery(&quot;.bar&quot;,c).html('&lt;strong class=&quot;crunching&quot;&gt;'+swfuploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}}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();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;className&quot;,&quot;pinkynail toggle&quot;).prependTo(a);jQuery(&quot;.filename.original&quot;,a).replaceWith(jQuery(&quot;.filename.new&quot;,a));jQuery(&quot;a.toggle&quot;,a).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(350,function(){var c=jQuery(this).offset();window.scrollTo(0,c.top-36)});jQuery(this).siblings(&quot;.toggle&quot;).andSelf().toggle();jQuery(this).siblings(&quot;a.toggle&quot;).focus();return false});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;a.undo&quot;,c).addClass(&quot;hidden&quot;);jQuery(&quot;a.describe-toggle-on, .menu_order_input&quot;,c).show();c.animate({backgroundColor:&quot;#fff&quot;},{queue:false,duration:200,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}})}});return false});jQuery(&quot;#media-item-&quot;+b.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).siblings(&quot;.toggle&quot;).toggle()}function itemAjaxError(c,b){var a=jQuery(&quot;#media-item-error&quot;+c);a.html('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+c+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);jQuery(&quot;#dismiss-&quot;+c).click(function(){jQuery(this).parents(&quot;.file-error&quot;).slideUp(200,function(){jQuery(this).empty()})})}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).siblings().removeClass(&quot;hidden&quot;);a.css({backgroundColor:&quot;#fff&quot;}).animate({backgroundColor:&quot;#ffc0c0&quot;},{queue:false,duration:500});jQuery(&quot;.filename:empty&quot;,a).remove();jQuery(&quot;.filename&quot;,a).append('&lt;span class=&quot;trashnotice&quot;&gt; '+swfuploadL10n.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 updateMediaForm(){var b=jQuery(&quot;form.type-form #media-items&quot;).children(),a=jQuery(&quot;#media-items&quot;).children();if(b.length==1){jQuery(&quot;.slidetoggle&quot;,b).slideDown(500).siblings().addClass(&quot;hidden&quot;).filter(&quot;.toggle&quot;).toggle()}if(a.not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}if(a.length&gt;1){jQuery(&quot;.insert-gallery&quot;).show()}else{jQuery(&quot;.insert-gallery&quot;).hide()}}function uploadSuccess(b,a){if(a.match(&quot;media-upload-error&quot;)){jQuery(&quot;#media-item-&quot;+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery(&quot;#media-item-&quot;+b.id).hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}function wpFileError(b,a){jQuery(&quot;#media-item-&quot;+b.id+&quot; .filename&quot;).after('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+b.id+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+a+&quot;&lt;/div&gt;&quot;).siblings(&quot;.toggle&quot;).remove();jQuery(&quot;#dismiss-&quot;+b.id).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b&gt;0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display=&quot;block&quot;;a.style.display=&quot;none&quot;}else{c.style.display=&quot;none&quot;;a.style.display=&quot;block&quot;}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery(&quot;#media-item-&quot;+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}jQuery(document).ready(function(a){a('input[type=&quot;radio&quot;]',&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=a(this).closest(&quot;tr&quot;);if(a(b).hasClass(&quot;align&quot;)){setUserSetting(&quot;align&quot;,a(this).val())}else{if(a(b).hasClass(&quot;image-size&quot;)){setUserSetting(&quot;imgsize&quot;,a(this).val())}}});a(&quot;button.button&quot;,&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=this.className||&quot;&quot;;b=b.replace(/.*?url([^ '&quot;]+).*/,&quot;$1&quot;);if(b){setUserSetting(&quot;urlbutton&quot;,b);a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))}})});
</del><span class="cx">\ No newline at end of file
</span><ins>+function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();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;.describe-toggle-on&quot;).show();jQuery(&quot;.describe-toggle-off&quot;).hide();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,&quot;#media-item-&quot;+a.id).show();jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}function uploadStart(a){return true}function uploadProgress(e,b,d){var a=jQuery(&quot;#media-items&quot;).width()-2,c=jQuery(&quot;#media-item-&quot;+e.id);jQuery(&quot;.bar&quot;,c).width(a*b/d);jQuery(&quot;.percent&quot;,c).html(Math.ceil(b/d*100)+&quot;%&quot;);if(b==d){jQuery(&quot;.bar&quot;,c).html('&lt;strong class=&quot;crunching&quot;&gt;'+swfuploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}}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();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;className&quot;,&quot;pinkynail toggle&quot;).prependTo(a);jQuery(&quot;.filename.original&quot;,a).replaceWith(jQuery(&quot;.filename.new&quot;,a));jQuery(&quot;a.toggle&quot;,a).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(350,function(){var c=jQuery(this).offset();window.scrollTo(0,c.top-36)});jQuery(this).siblings(&quot;.toggle&quot;).andSelf().toggle();jQuery(this).siblings(&quot;a.toggle&quot;).focus();return false});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;a.undo&quot;,c).addClass(&quot;hidden&quot;);jQuery(&quot;a.describe-toggle-on, .menu_order_input&quot;,c).show();c.animate({backgroundColor:&quot;#fff&quot;},{queue:false,duration:200,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}})}});return false});jQuery(&quot;#media-item-&quot;+b.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).siblings(&quot;.toggle&quot;).toggle()}function itemAjaxError(c,b){var a=jQuery(&quot;#media-item-error&quot;+c);a.html('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+c+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);jQuery(&quot;#dismiss-&quot;+c).click(function(){jQuery(this).parents(&quot;.file-error&quot;).slideUp(200,function(){jQuery(this).empty()})})}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).siblings().removeClass(&quot;hidden&quot;);a.css({backgroundColor:&quot;#fff&quot;}).animate({backgroundColor:&quot;#ffc0c0&quot;},{queue:false,duration:500});jQuery(&quot;.filename:empty&quot;,a).remove();jQuery(&quot;.filename&quot;,a).append('&lt;span class=&quot;trashnotice&quot;&gt; '+swfuploadL10n.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 updateMediaForm(){var b=jQuery(&quot;form.type-form #media-items&quot;).children(),a=jQuery(&quot;#media-items&quot;).children();if(b.length==1){jQuery(&quot;.slidetoggle&quot;,b).slideDown(500).siblings().addClass(&quot;hidden&quot;).filter(&quot;.toggle&quot;).toggle()}if(a.not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}if(a.length&gt;1){jQuery(&quot;.insert-gallery&quot;).show()}else{jQuery(&quot;.insert-gallery&quot;).hide()}}function uploadSuccess(b,a){if(a.match(&quot;media-upload-error&quot;)){jQuery(&quot;#media-item-&quot;+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery(&quot;#media-item-&quot;+b.id).hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}function wpFileError(b,a){jQuery(&quot;#media-item-&quot;+b.id+&quot; .filename&quot;).after('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+b.id+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+a+&quot;&lt;/div&gt;&quot;).siblings(&quot;.toggle&quot;).remove();jQuery(&quot;#dismiss-&quot;+b.id).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b&gt;0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display=&quot;block&quot;;a.style.display=&quot;none&quot;}else{c.style.display=&quot;none&quot;;a.style.display=&quot;block&quot;}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery(&quot;#media-item-&quot;+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}jQuery(document).ready(function(a){a('input[type=&quot;radio&quot;]',&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=a(this).closest(&quot;tr&quot;);if(a(b).hasClass(&quot;align&quot;)){setUserSetting(&quot;align&quot;,a(this).val())}else{if(a(b).hasClass(&quot;image-size&quot;)){setUserSetting(&quot;imgsize&quot;,a(this).val())}}});a(&quot;button.button&quot;,&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=this.className||&quot;&quot;;b=b.match(/url([^ '&quot;]+)/);if(b&amp;&amp;b[1]){setUserSetting(&quot;urlbutton&quot;,b[1]);a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))}})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>