<!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>[22546] trunk: Compress scripts/styles: 3.5-beta2-22546.</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/22546">22546</a></dd>
<dt>Author</dt> <dd>bumpbot</dd>
<dt>Date</dt> <dd>2012-11-11 22:58:32 +0000 (Sun, 11 Nov 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Compress scripts/styles: 3.5-beta2-22546.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjsdashboardminjs">trunk/wp-admin/js/dashboard.min.js</a></li>
<li><a href="#trunkwpincludescssmediaviewsmincss">trunk/wp-includes/css/media-views.min.css</a></li>
<li><a href="#trunkwpincludesjsmediamodelsminjs">trunk/wp-includes/js/media-models.min.js</a></li>
<li><a href="#trunkwpincludesjsmediaviewsminjs">trunk/wp-includes/js/media-views.min.js</a></li>
<li><a href="#trunkwpincludesjspluploadwppluploadminjs">trunk/wp-includes/js/plupload/wp-plupload.min.js</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjsdashboardminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/dashboard.min.js (22545 => 22546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/dashboard.min.js        2012-11-11 21:51:27 UTC (rev 22545)
+++ trunk/wp-admin/js/dashboard.min.js        2012-11-11 22:58:32 UTC (rev 22546)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(c){var d=c(&quot;#welcome-panel&quot;),a=c(&quot;#wp_welcome_panel-hide&quot;),b=function(e){c.post(ajaxurl,{action:&quot;update-welcome-panel&quot;,visible:e,welcomepanelnonce:c(&quot;#welcomepanelnonce&quot;).val()})};if(d.hasClass(&quot;hidden&quot;)&amp;&amp;a.prop(&quot;checked&quot;)){d.removeClass(&quot;hidden&quot;)}c(&quot;.welcome-panel-close, .welcome-panel-dismiss a&quot;,d).click(function(f){f.preventDefault();d.addClass(&quot;hidden&quot;);b(0);c(&quot;#wp_welcome_panel-hide&quot;).prop(&quot;checked&quot;,false)});a.click(function(){d.toggleClass(&quot;hidden&quot;,!this.checked);b(this.checked?1:0)});ajaxWidgets=[&quot;dashboard_incoming_links&quot;,&quot;dashboard_primary&quot;,&quot;dashboard_secondary&quot;,&quot;dashboard_plugins&quot;];ajaxPopulateWidgets=function(f){function e(g,k){var j,h=c(&quot;#&quot;+k+&quot; div.inside:visible&quot;).find(&quot;.widget-l
 oading&quot;);if(h.length){j=h.parent();setTimeout(function(){j.load(ajaxurl+&quot;?action=dashboard-widgets&amp;widget=&quot;+k,&quot;&quot;,function(){j.hide().slideDown(&quot;normal&quot;,function(){c(this).css(&quot;display&quot;,&quot;&quot;)})})},g*500)}}if(f){f=f.toString();if(c.inArray(f,ajaxWidgets)!=-1){e(0,f)}}else{c.each(ajaxWidgets,e)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var e=c(&quot;#quickpost-action&quot;),f;f=c(&quot;#quick-press&quot;).submit(function(){c(&quot;#dashboard_quick_press #publishing-action .spinner&quot;).show();c('#quick-press .submit input[type=&quot;submit&quot;], #quick-press .submit input[type=&quot;reset&quot;]').prop(&quot;disabled&quot;,true);if(&quot;post&quot;==e.val()){e.val(&quot;post-quickpress-publish&quot;)}c(&quot;#dashboard_quick_press div.inside&quot;).load(f.attr(&quot;action&quot;),f.serializeArray(),function(){c(&quot;#dashboard_quick_press #pu
 blishing-action .spinner&quot;).hide();c('#quick-press .submit input[type=&quot;submit&quot;], #quick-press .submit input[type=&quot;reset&quot;]').prop(&quot;disabled&quot;,false);c(&quot;#dashboard_quick_press ul&quot;).next(&quot;p&quot;).remove();c(&quot;#dashboard_quick_press ul&quot;).find(&quot;li&quot;).each(function(){c(&quot;#dashboard_recent_drafts ul&quot;).prepend(this)}).end().remove();quickPressLoad()});return false});c(&quot;#publish&quot;).click(function(){e.val(&quot;post-quickpress-publish&quot;)});c(&quot;#title, #tags-input&quot;).each(function(){var h=c(this),g=c(&quot;#&quot;+this.id+&quot;-prompt-text&quot;);if(&quot;&quot;===this.value){g.removeClass(&quot;screen-reader-text&quot;)}g.click(function(){c(this).addClass(&quot;screen-reader-text&quot;);h.focus()});h.blur(function(){if(&quot;&quot;===this.value){g.removeClass(&quot;screen-reader-text&quot;)}});h.focus(function(){g.addClass(&quot;screen-reader-text&quot;)})});c(&quot;#dashboard_quick_press
  #title, #dashboard_quick_press #content&quot;).focus(function(){wpActiveEditor=&quot;content&quot;})};quickPressLoad()});
</del><span class="cx">\ No newline at end of file
</span><ins>+var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(c){var d=c(&quot;#welcome-panel&quot;),a=c(&quot;#wp_welcome_panel-hide&quot;),b=function(e){c.post(ajaxurl,{action:&quot;update-welcome-panel&quot;,visible:e,welcomepanelnonce:c(&quot;#welcomepanelnonce&quot;).val()})};if(d.hasClass(&quot;hidden&quot;)&amp;&amp;a.prop(&quot;checked&quot;)){d.removeClass(&quot;hidden&quot;)}c(&quot;.welcome-panel-close, .welcome-panel-dismiss a&quot;,d).click(function(f){f.preventDefault();d.addClass(&quot;hidden&quot;);b(0);c(&quot;#wp_welcome_panel-hide&quot;).prop(&quot;checked&quot;,false)});a.click(function(){d.toggleClass(&quot;hidden&quot;,!this.checked);b(this.checked?1:0)});ajaxWidgets=[&quot;dashboard_incoming_links&quot;,&quot;dashboard_primary&quot;,&quot;dashboard_secondary&quot;,&quot;dashboard_plugins&quot;];ajaxPopulateWidgets=function(f){function e(g,k){var j,h=c(&quot;#&quot;+k+&quot; div.inside:visible&quot;).find(&quot;.widget-l
 oading&quot;);if(h.length){j=h.parent();setTimeout(function(){j.load(ajaxurl+&quot;?action=dashboard-widgets&amp;widget=&quot;+k,&quot;&quot;,function(){j.hide().slideDown(&quot;normal&quot;,function(){c(this).css(&quot;display&quot;,&quot;&quot;)})})},g*500)}}if(f){f=f.toString();if(c.inArray(f,ajaxWidgets)!=-1){e(0,f)}}else{c.each(ajaxWidgets,e)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var e=c(&quot;#quickpost-action&quot;),f;f=c(&quot;#quick-press&quot;).submit(function(){c(&quot;#dashboard_quick_press #publishing-action .spinner&quot;).show();c('#quick-press .submit input[type=&quot;submit&quot;], #quick-press .submit input[type=&quot;reset&quot;]').prop(&quot;disabled&quot;,true);if(&quot;post&quot;==e.val()){e.val(&quot;post-quickpress-publish&quot;)}c(&quot;#dashboard_quick_press div.inside&quot;).load(f.attr(&quot;action&quot;),f.serializeArray(),function(){c(&quot;#dashboard_quick_press #pu
 blishing-action .spinner&quot;).hide();c('#quick-press .submit input[type=&quot;submit&quot;], #quick-press .submit input[type=&quot;reset&quot;]').prop(&quot;disabled&quot;,false);c(&quot;#dashboard_quick_press ul&quot;).next(&quot;p&quot;).remove();c(&quot;#dashboard_quick_press ul&quot;).find(&quot;li&quot;).each(function(){c(&quot;#dashboard_recent_drafts ul&quot;).prepend(this)}).end().remove();quickPressLoad()});return false});c(&quot;#publish&quot;).click(function(){e.val(&quot;post-quickpress-publish&quot;)});c(&quot;#title, #tags-input&quot;).each(function(){var h=c(this),g=c(&quot;#&quot;+this.id+&quot;-prompt-text&quot;);if(&quot;&quot;===this.value){g.removeClass(&quot;screen-reader-text&quot;)}g.click(function(){c(this).addClass(&quot;screen-reader-text&quot;);h.focus()});h.blur(function(){if(&quot;&quot;===this.value){g.removeClass(&quot;screen-reader-text&quot;)}});h.focus(function(){g.addClass(&quot;screen-reader-text&quot;)})});c(&quot;#quick-press&quot;).on
 (&quot;click focusin&quot;,function(){wpActiveEditor=&quot;content&quot;})};quickPressLoad()});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludescssmediaviewsmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/css/media-views.min.css (22545 => 22546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/media-views.min.css        2012-11-11 21:51:27 UTC (rev 22545)
+++ trunk/wp-includes/css/media-views.min.css        2012-11-11 22:58:32 UTC (rev 22546)
</span><span class="lines">@@ -1 +1 @@
</span><del>-.media-modal{position:fixed;top:60px;left:40px;right:40px;bottom:40px;z-index:125000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.8;z-index:120000}.media-modal-backdrop div{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed rgba(255,255,255,0.5)}.media-modal-title,.media-modal-close{position:absolute;top:-40px;height:40px;line-height:40px;color:#fff;font-weight:200;text-shadow:0 0 16px rgba(0,0,0,0.6)}.media-modal-title{left:0;float:left;padding:0;margin:0;font-size:16px}.media-modal-close{right:0;float:right;text-decoration:none;font-size:1.8em}.media-modal-close:hover,.media-modal-close:focus{color:#fff;text-shadow:0 0 16px rgba(255,255,255,0.8)}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;background:#fff}.media-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfd
 fdf}.media-frame&gt;.media-toolbar{top:auto;left:200px;bottom:0;border-width:1px 0 0 0}.media-frame.hide-toolbar&gt;.media-toolbar{bottom:-61px}.media-toolbar-primary{float:right}.media-toolbar-secondary{float:left}.media-toolbar-primary&gt;.media-button,.media-toolbar-primary&gt;.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary&gt;.media-button,.media-toolbar-secondary&gt;.media-button-group{margin-right:10px;float:left;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:61px;width:267px;padding:0 16px 24px;z-index:75;background:#f5f5f5;border-left:1px solid #dfdfdf;overflow:auto}.hide-sidebar .media-sidebar{right:-300px}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-weight:200;font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.media-sidebar .selection-preview{displ
 ay:block;padding-top:5px}.media-sidebar h3{position:relative;font-weight:bold;text-transform:uppercase;font-size:12px;color:#777;text-shadow:0 1px 0 #fff;margin:24px 0 8px}.media-sidebar .setting{display:block;float:left;width:100%;margin:1px 0}.media-sidebar .setting span{float:left;min-width:30%;min-height:24px;margin-right:4%;padding-top:8px;line-height:16px;text-align:right;color:#999;text-shadow:0 1px 0 #fff}.media-sidebar .setting input,.media-sidebar .setting textarea{float:right;width:65%;padding:6px 8px;line-height:16px;resize:none}.media-sidebar .setting textarea{height:62px}.media-sidebar .setting select{height:28px;line-height:28px;margin-top:3px}.media-menu{position:absolute;top:0;left:0;bottom:0;width:199px;margin:0;padding:16px 0;z-index:200;box-shadow:inset -6px 0 6px -6px rgba(0,0,0,0.4)}.media-menu li{position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff}.media-menu-item{cursor:pointer}.media-menu
  li:hover{background:rgba(0,0,0,0.04)}.media-menu .active,.media-menu .active:hover{color:#333;font-weight:bold}.media-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #dfdfdf;border-bottom:1px solid #fff}.media-menu&gt;a.button{margin:0 20px}.media-frame{overflow:hidden}.media-frame .region-content{position:absolute;top:0;left:200px;right:300px;bottom:61px;height:auto;width:auto;margin:0;overflow:auto}.media-frame.hide-sidebar .region-content{right:0}.media-frame.hide-toolbar .region-content{bottom:0}.media-frame .media-toolbar .add-to-gallery{display:none}.media-frame .media-iframe{overflow:hidden}.media-iframe iframe{height:100%;width:100%}.media-frame .search{margin-top:11px;padding:4px;line-height:18px;font-size:13px;color:#464646;font-family:sans-serif}.media-toolbar-secondary .search{margin-right:16px}.attachments{margin:0;padding-right:16px}.attachment{position:relative;float:left;padding:0;margin:0 10px 20px;color:#464646;-webkit-user-select:
 none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.selected.attachment{box-shadow:0 0 0 1px #fff,0 0 0 4px #777}.details.attachment{box-shadow:0 0 0 1px #fff,0 0 0 4px #1e8cbe}.attachment.library.selected:after{content:'\2713';display:block;height:24px;width:24px;position:absolute;top:-1px;right:-1px;line-height:24px;font-size:18px;text-align:center;color:#fff;text-shadow:0 1px 0 rgba(0,0,0,0.5);background:#777;border:1px solid #fff;border-width:0 0 1px 1px;box-shadow:-1px 1px 0 rgba(0,0,0,0.1)}.attachment.library.details:after{background:#1e8cbe}.attachment-preview{position:relative;width:199px;height:199px;overflow:hidden;box-shadow:inset 0 0 15px rgba(0,0,0,0.1),inset 0 0 0 1px rgba(0,0,0,0.05);background:#eee;cursor:pointer}.attachment .icon,.attachment .thumbnail{display:block;position:absolute;top:0;left:0;margin:0 auto}.attachment .icon{top:50%;left:50%}.attachment-preview .thumbnail:after{content:'';display:block;position:absolute;t
 op:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);overflow:hidden}.attachment .thumbnail img{top:0;left:0}.attachment .thumbnail .centered{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transform:translate(50%,50%);-moz-transform:translate(50%,50%);-ms-transform:translate(50%,50%);-o-transform:translate(50%,50%);transform:translate(50%,50%)}.attachment .icon,.attachment .thumbnail .centered img{-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.attachment .filename{position:absolute;left:0;right:0;bottom:0;padding:5px 10px;text-align:center;font-weight:bold;background:rgba(255,255,255,0.8);box-shadow:0 0 2px rgba(0,0,0,0.2)}.attachment-preview .thumbnail{width:199px;height:199px}.attachment .thumbnail img{position:absolute}.attachment .insert{display:none;position:absolute;left:7px;bottom:7px}.attachment:hover .inse
 rt{display:block}.attachment .close{display:none;position:absolute;top:5px;right:5px;height:22px;width:22px;padding:0;font-size:20px;line-height:20px;text-align:center;text-decoration:none;color:#464646;background:#fff;border-width:0;box-shadow:0 0 0 1px rgba(0,0,0,0.3)}.attachment .close:hover{box-shadow:0 0 0 1px rgba(0,0,0,0.6)}.attachment:hover .close{display:block}.media-frame .describe{position:relative;display:block;width:100%;height:50px;margin:-1px 0 0;padding:8px;font-size:12px;resize:none;border-radius:0}.media-frame .attachments-browser{overflow:hidden}.attachments-browser .media-toolbar{height:50px}.attachments-browser .attachments{position:absolute;top:50px;left:0;right:0;bottom:0;overflow:auto}.attachments-browser .instructions{display:inline-block;margin-top:16px;line-height:18px;font-size:13px;color:#999}.media-progress-bar{position:relative;height:8px;width:70%;margin:10px auto;padding:2px;border:2px solid #ccc;border-radius:8px;background:#fff}.media-progr
 ess-bar div{height:8px;min-width:8px;width:0;background:#ccc;border-radius:10px;-webkit-transition:width 300ms;-moz-transition:width 300ms;-ms-transition:width 300ms;-o-transition:width 300ms;transition:width 300ms}.attachment-preview .media-progress-bar{position:absolute;top:50%;left:15%;width:70%;margin:-8px 0 0 -4px}.uploader-window{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,86,132,0.9);z-index:250000;display:none;text-align:center;opacity:0;-webkit-transition:opacity 250ms;-moz-transition:opacity 250ms;-ms-transition:opacity 250ms;-o-transition:opacity 250ms;transition:opacity 250ms}.uploader-window-content{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed #fff}.uploader-window h3{position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);font-size:20px;font-weight:200;color:#fff;padding:0
 }.uploader-window .media-progress-bar{margin-top:20px;max-width:300px;background:transparent;border-color:#fff;display:none}.uploader-window .media-progress-bar div{background:#fff}.uploading .uploader-window .media-progress-bar{display:block}.region-content.uploader-inline{margin:20px;padding:20px;border:1px dashed #aaa;text-align:center}.uploader-inline-content{position:absolute;top:30%;left:0;right:0}.uploader-inline h3{font-size:20px;font-weight:200;margin-bottom:1.6em}.uploader-inline .media-progress-bar{display:none}.uploading.uploader-inline .media-progress-bar{display:block}.uploader-inline .browser{display:inline-block!important}.media-selection{position:absolute;top:0;left:0;right:350px;height:60px;padding:0 0 0 16px;overflow:hidden;white-space:nowrap}.media-selection .selection-info{display:inline-block;height:60px;margin-right:10px;vertical-align:top}.media-selection.empty{display:none}.media-selection .count{display:block;padding-top:12px;font-size:14px;line-hei
 ght:20px;font-weight:bold}.media-selection .clear-selection{display:block;text-decoration:none;line-height:16px}.media-selection .attachments{display:inline-block;height:60px;margin-top:5px;overflow:hidden;vertical-align:top}.media-selection .selected.attachment{box-shadow:none}.media-selection .details.attachment{box-shadow:0 0 0 1px #fff,0 0 0 3px #1e8cbe}.media-selection:after{content:'';display:block;position:absolute;top:0;right:0;bottom:0;width:25px;background-image:-webkit-gradient(linear,right top,right top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to left,rgba(255,255,255,1),rgba(255,255,255,0))}.media-selection .attachment .filename{display:none}.selection-preview{position
 :relative;height:60px;overflow:hidden}.selected-img{float:left;position:relative;margin-right:14px}.selection-preview img{max-width:40px;max-height:40px;float:left;margin-top:6px;margin-left:1px;border:2px solid white;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc,6px 6px 0 0 #fff,6px 6px 0 1px #ccc}.selection-preview .selected-count-1 img{margin-top:8px;box-shadow:0 0 0 1px #ccc}.selection-preview .selected-count-2 img{margin-top:7px;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc}.selection-preview .count{position:absolute;bottom:0;right:0;height:16px;min-width:8px;padding:0 4px;font-size:12px;text-align:center;font-weight:bold;color:#999;background:#fff;box-shadow:-1px -1px 2px -1px rgba(0,0,0,0.2)}.selection-preview .clear-selection{float:left;line-height:60px}.attachment-details{overflow:auto}.attachment-info{overflow:hidden;min-height:60px;margin-bottom:16px;line-height:18px;color:#999;border-bottom:1px solid #e5e5e5;box-shadow:0 1px 0 #fff
 ;padding-bottom:16px}.attachment-info .filename{font-weight:bold;color:#464646}.attachment-info .thumbnail{position:relative;float:left;max-width:120px;max-height:120px;margin-right:10px}.attachment-info .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15);overflow:hidden}.attachment-info .thumbnail img{display:block;max-width:120px;max-height:120px;margin:0 auto}.attachment-info .details{float:left}.attachment-display-settings h4{margin:1.4em 0 .4em}.gallery-settings{overflow:hidden}
</del><span class="cx">\ No newline at end of file
</span><ins>+.media-modal{position:fixed;top:60px;left:40px;right:40px;bottom:40px;z-index:125000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.8;z-index:120000}.media-modal-backdrop div{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed rgba(255,255,255,0.5)}.media-modal-title,.media-modal-close{position:absolute;top:-40px;height:40px;line-height:40px;color:#fff;font-weight:200;text-shadow:0 0 16px rgba(0,0,0,0.6)}.media-modal-title{left:0;float:left;padding:0;margin:0;font-size:16px}.media-modal-close{right:0;float:right;text-decoration:none;font-size:1.8em}.media-modal-close:hover,.media-modal-close:focus{color:#fff;text-shadow:0 0 16px rgba(255,255,255,0.8)}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;background:#fff}.media-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfd
 fdf}.media-frame&gt;.media-toolbar{top:auto;left:200px;bottom:0;border-width:1px 0 0 0}.media-frame.hide-toolbar&gt;.media-toolbar{bottom:-61px}.media-toolbar-primary{float:right}.media-toolbar-secondary{float:left}.media-toolbar-primary&gt;.media-button,.media-toolbar-primary&gt;.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary&gt;.media-button,.media-toolbar-secondary&gt;.media-button-group{margin-right:10px;float:left;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:61px;width:267px;padding:0 16px 24px;z-index:75;background:#f5f5f5;border-left:1px solid #dfdfdf;overflow:auto}.hide-sidebar .media-sidebar{right:-300px}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-weight:200;font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.media-sidebar .selection-preview{displ
 ay:block;padding-top:5px}.media-sidebar h3{position:relative;font-weight:bold;text-transform:uppercase;font-size:12px;color:#777;text-shadow:0 1px 0 #fff;margin:24px 0 8px}.media-sidebar .setting{display:block;float:left;width:100%;margin:1px 0}.media-sidebar .setting span{min-width:30%;margin-right:4%}.media-sidebar .setting span,.compat-item label span{float:left;min-height:22px;padding-top:8px;line-height:16px;text-align:right;font-weight:normal;color:#999;text-shadow:0 1px 0 #fff}.media-sidebar .setting input,.media-sidebar .setting textarea,.compat-item .field input,.compat-item .field textarea{padding:6px 8px;line-height:16px}.media-sidebar .setting input,.media-sidebar .setting textarea{width:65%;float:right}.media-sidebar .setting textarea,.compat-item .field textarea{height:62px;resize:none}.media-sidebar .setting select,.compat-item .field select{height:28px;line-height:28px;margin-top:3px}.compat-item{float:left;width:100%;overflow:hidden}.compat-item table{width:
 100%;table-layout:fixed;border-spacing:0;border:0}.compat-item tr{padding:2px 0;display:block;overflow:hidden}.compat-item .label,.compat-item .field{display:block;margin:0;padding:0}.compat-item .label{min-width:30%;margin-right:4%;float:left;text-align:right}.compat-item .label span{display:block;width:100%}.compat-item .field{float:right;width:65%;padding-right:1px}.compat-item .field input{width:100%;margin:0}.media-menu{position:absolute;top:0;left:0;bottom:0;width:199px;margin:0;padding:16px 0;z-index:200;box-shadow:inset -6px 0 6px -6px rgba(0,0,0,0.4)}.media-menu li{position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff}.media-menu-item{cursor:pointer}.media-menu li:hover{background:rgba(0,0,0,0.04)}.media-menu .active,.media-menu .active:hover{color:#333;font-weight:bold}.media-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #dfdfdf;border-bottom:1px solid #fff}.media-menu&gt;a.butt
 on{margin:0 20px}.media-frame{overflow:hidden}.media-frame .region-content{position:absolute;top:0;left:200px;right:300px;bottom:61px;height:auto;width:auto;margin:0;overflow:auto}.media-frame.hide-sidebar .region-content{right:0}.media-frame.hide-toolbar .region-content{bottom:0}.media-frame .media-toolbar .add-to-gallery{display:none}.media-frame .media-iframe{overflow:hidden}.media-iframe iframe{height:100%;width:100%}.media-frame .search{margin-top:11px;padding:4px;line-height:18px;font-size:13px;color:#464646;font-family:sans-serif}.media-toolbar-secondary .search{margin-right:16px}.attachments{margin:0;padding-right:16px}.attachment{position:relative;float:left;padding:0;margin:0 10px 20px;color:#464646;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.selected.attachment{box-shadow:0 0 0 1px #fff,0 0 0 4px #777}.details.attachment{box-shadow:0 0 0 1px #fff,0 0 0 4px #1e8cbe}.attachment.library.selected:after{cont
 ent:'\2713';display:block;height:24px;width:24px;position:absolute;top:-1px;right:-1px;line-height:24px;font-size:18px;text-align:center;color:#fff;text-shadow:0 1px 0 rgba(0,0,0,0.5);background:#777;border:1px solid #fff;border-width:0 0 1px 1px;box-shadow:-1px 1px 0 rgba(0,0,0,0.1)}.attachment.library.details:after{background:#1e8cbe}.attachment-preview{position:relative;width:199px;height:199px;overflow:hidden;box-shadow:inset 0 0 15px rgba(0,0,0,0.1),inset 0 0 0 1px rgba(0,0,0,0.05);background:#eee;cursor:pointer}.attachment .icon,.attachment .thumbnail{display:block;position:absolute;top:0;left:0;margin:0 auto}.attachment .icon{top:50%;left:50%}.attachment-preview .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);overflow:hidden}.attachment .thumbnail img{top:0;left:0}.attachment .thumbnail .centered{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transform:translate(50%,50%
 );-moz-transform:translate(50%,50%);-ms-transform:translate(50%,50%);-o-transform:translate(50%,50%);transform:translate(50%,50%)}.attachment .icon,.attachment .thumbnail .centered img{-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.attachment .filename{position:absolute;left:0;right:0;bottom:0;padding:5px 10px;text-align:center;font-weight:bold;background:rgba(255,255,255,0.8);box-shadow:0 0 2px rgba(0,0,0,0.2)}.attachment-preview .thumbnail{width:199px;height:199px}.attachment .thumbnail img{position:absolute}.attachment .insert{display:none;position:absolute;left:7px;bottom:7px}.attachment:hover .insert{display:block}.attachment .close{display:none;position:absolute;top:5px;right:5px;height:22px;width:22px;padding:0;font-size:20px;line-height:20px;text-align:center;text-decoration:none;color:#464646;background:#fff;border-width:0;box-shadow:0 0 0
  1px rgba(0,0,0,0.3)}.attachment .close:hover{box-shadow:0 0 0 1px rgba(0,0,0,0.6)}.attachment:hover .close{display:block}.media-frame .describe{position:relative;display:block;width:100%;height:50px;margin:-1px 0 0;padding:8px;font-size:12px;resize:none;border-radius:0}.media-frame .attachments-browser{overflow:hidden}.attachments-browser .media-toolbar{height:50px}.attachments-browser .attachments{position:absolute;top:50px;left:0;right:0;bottom:0;overflow:auto}.attachments-browser .instructions{display:inline-block;margin-top:16px;line-height:18px;font-size:13px;color:#999}.media-progress-bar{position:relative;height:8px;width:70%;margin:10px auto;padding:2px;border:2px solid #ccc;border-radius:8px;background:#fff}.media-progress-bar div{height:8px;min-width:8px;width:0;background:#ccc;border-radius:10px;-webkit-transition:width 300ms;-moz-transition:width 300ms;-ms-transition:width 300ms;-o-transition:width 300ms;transition:width 300ms}.attachment-preview .media-progress
 -bar{position:absolute;top:50%;left:15%;width:70%;margin:-8px 0 0 -4px}.uploader-window{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,86,132,0.9);z-index:250000;display:none;text-align:center;opacity:0;-webkit-transition:opacity 250ms;-moz-transition:opacity 250ms;-ms-transition:opacity 250ms;-o-transition:opacity 250ms;transition:opacity 250ms}.uploader-window-content{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed #fff}.uploader-window h3{position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);font-size:20px;font-weight:200;color:#fff;padding:0}.uploader-window .media-progress-bar{margin-top:20px;max-width:300px;background:transparent;border-color:#fff;display:none}.uploader-window .media-progress-bar div{background:#fff}.uploading .uploader-window .media-progress-bar{display:block}.region
 -content.uploader-inline{margin:20px;padding:20px;border:1px dashed #aaa;text-align:center}.uploader-inline-content{position:absolute;top:30%;left:0;right:0}.uploader-inline h3{font-size:20px;font-weight:200;margin-bottom:1.6em}.uploader-inline .media-progress-bar{display:none}.uploading.uploader-inline .media-progress-bar{display:block}.uploader-inline .browser{display:inline-block!important}.media-selection{position:absolute;top:0;left:0;right:350px;height:60px;padding:0 0 0 16px;overflow:hidden;white-space:nowrap}.media-selection .selection-info{display:inline-block;height:60px;margin-right:10px;vertical-align:top}.media-selection.empty{display:none}.media-selection .count{display:block;padding-top:12px;font-size:14px;line-height:20px;font-weight:bold}.media-selection .clear-selection{display:block;text-decoration:none;line-height:16px}.media-selection .attachments{display:inline-block;height:60px;margin-top:5px;overflow:hidden;vertical-align:top}.media-selection .selecte
 d.attachment{box-shadow:none}.media-selection .details.attachment{box-shadow:0 0 0 1px #fff,0 0 0 3px #1e8cbe}.media-selection:after{content:'';display:block;position:absolute;top:0;right:0;bottom:0;width:25px;background-image:-webkit-gradient(linear,right top,right top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to left,rgba(255,255,255,1),rgba(255,255,255,0))}.media-selection .attachment .filename{display:none}.selection-preview{position:relative;height:60px;overflow:hidden}.selected-img{float:left;position:relative;margin-right:14px}.selection-preview img{max-width:40px;max-height:40px;float:left;margin-top:6px;margin-left:1px;border:2px solid white;box-shadow:0 0 0 1px #ccc,3px 3p
 x 0 0 #fff,3px 3px 0 1px #ccc,6px 6px 0 0 #fff,6px 6px 0 1px #ccc}.selection-preview .selected-count-1 img{margin-top:8px;box-shadow:0 0 0 1px #ccc}.selection-preview .selected-count-2 img{margin-top:7px;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc}.selection-preview .count{position:absolute;bottom:0;right:0;height:16px;min-width:8px;padding:0 4px;font-size:12px;text-align:center;font-weight:bold;color:#999;background:#fff;box-shadow:-1px -1px 2px -1px rgba(0,0,0,0.2)}.selection-preview .clear-selection{float:left;line-height:60px}.attachment-details{overflow:auto}.attachment-info{overflow:hidden;min-height:60px;margin-bottom:16px;line-height:18px;color:#999;border-bottom:1px solid #e5e5e5;box-shadow:0 1px 0 #fff;padding-bottom:11px}.attachment-info .filename{font-weight:bold;color:#464646}.attachment-info .thumbnail{position:relative;float:left;max-width:120px;max-height:120px;margin-right:10px;margin-bottom:5px}.uploading .attachment-info .thumbnail{width:
 120px;height:80px;box-shadow:inset 0 0 15px rgba(0,0,0,0.1)}.uploading .attachment-info .media-progress-bar{margin-top:32px}.attachment-info .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15);overflow:hidden}.attachment-info .thumbnail img{display:block;max-width:120px;max-height:120px;margin:0 auto}.attachment-info .details{float:left}.attachment-info .compat-meta{float:left}.attachment-display-settings{overflow:hidden;float:left}.attachment-display-settings h4{margin:1.4em 0 .4em}.gallery-settings{overflow:hidden}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsmediamodelsminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-models.min.js (22545 => 22546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-models.min.js        2012-11-11 21:51:27 UTC (rev 22545)
+++ trunk/wp-includes/js/media-models.min.js        2012-11-11 22:58:32 UTC (rev 22546)
</span><span class="lines">@@ -1 +1 @@
</span><del>-window.wp=window.wp||{};(function(f){var d,c,a,e,b;media=wp.media=function(g){var h=media.view.MediaFrame,i;if(!h){return}g=_.defaults(g||{},{frame:&quot;select&quot;});if(&quot;select&quot;===g.frame&amp;&amp;h.Select){i=new h.Select(g)}else{if(&quot;post&quot;===g.frame&amp;&amp;h.Post){i=new h.Post(g)}}delete g.frame;i.state(i.options.state);return i.render().attach().open()};_.extend(media,{model:{},view:{},controller:{}});b=media.model.l10n=_.isUndefined(_wpMediaModelsL10n)?{}:_wpMediaModelsL10n;e=function(h,g,i,j){if(_.isEqual(h,g)){return i===j?0:(i&gt;j?-1:1)}else{return h&gt;g?-1:1}};_.extend(media,{template:_.memoize(function(i){var h,g={evaluate:/&lt;#([\s\S]+?)#&gt;/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return function(j){h=h||_.template(f(&quot;#tmpl-&quot;+i).html(),null,g);return h(j)}}),post:function(h,g){return media.ajax({data:_.isObject(h)?h:_.extend(g||{},{action:h})})},ajax:function(h,g){if(_.isObject(h)){
 g=h}else{g=g||{};g.data=_.extend(g.data||{},{action:h})}g=_.defaults(g||{},{type:&quot;POST&quot;,url:ajaxurl,context:this});return f.Deferred(function(i){if(g.success){i.done(g.success)}if(g.error){i.fail(g.error)}delete g.success;delete g.error;f.ajax(g).done(function(j){if(_.isObject(j)&amp;&amp;!_.isUndefined(j.success)){i[j.success?&quot;resolveWith&quot;:&quot;rejectWith&quot;](this,[j.data])}else{i.rejectWith(this,[j])}}).fail(function(){i.rejectWith(this,arguments)})}).promise()},fit:function(k){var h=k.width,g=k.height,j=k.maxWidth,i=k.maxHeight,l;if(!_.isUndefined(j)&amp;&amp;!_.isUndefined(i)){l=(h/g&gt;j/i)?&quot;width&quot;:&quot;height&quot;}else{if(_.isUndefined(i)){l=&quot;width&quot;}else{if(_.isUndefined(j)&amp;&amp;g&gt;i){l=&quot;height&quot;}}}if(&quot;width&quot;===l&amp;&amp;h&gt;j){return{width:j,height:Math.round(j*g/h)}}else{if(&quot;height&quot;===l&amp;&amp;g&gt;i){return{width:Math.round(i*h/g),height:i}}else{return{width:h,height:g}}}}});d=media
 .model.Attachment=Backbone.Model.extend({sync:function(i,h,g){if(&quot;read&quot;===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:&quot;get-attachment&quot;,id:this.id});return media.ajax(g)}else{if(&quot;update&quot;===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:&quot;save-attachment&quot;,id:this.id,nonce:b.saveAttachmentNonce});if(g.changes){_.each(g.changes,function(k,j){g.changes[j]=this.get(j)},this);g.data.changes=g.changes;delete g.changes}return media.ajax(g)}}},parse:function(h,g){if(!h){return h}h.date=new Date(h.date);h.modified=new Date(h.modified);return h}},{create:function(g){return c.all.push(g)},get:_.memoize(function(h,g){return c.all.push(g||{id:h})})});c=media.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(h,g){g=g||{};this.props=new Backbone.Model();this.filters=g.filters||{};this.props.on(&quot;change:order&quot;,this._changeOrder,this);this.props.on(&quot;change:orderby&quot;,this._changeOrder
 by,this);this.props.on(&quot;change:query&quot;,this._changeQuery,this);this.props.on(&quot;change:search&quot;,this._changeSearch,this);this.props.on(&quot;change:type&quot;,this._changeType,this);this.props.set(_.defaults(g.props||{}));if(g.observe){this.observe(g.observe)}},_changeOrder:function(h,g){if(this.comparator){this.sort()}},_changeOrderby:function(g,h){if(this.comparator&amp;&amp;this.comparator!==c.comparator){return}if(h&amp;&amp;&quot;post__in&quot;!==h){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(g,h){if(h){this.props.on(&quot;change&quot;,this._requery,this);this._requery()}else{this.props.off(&quot;change&quot;,this._requery,this)}},_changeFilteredProp:function(i,g,h){if(this.props.get(i)===h){return}if(h&amp;&amp;!this.filters[i]){this.filters[i]=c.filters[i]}else{if(!h&amp;&amp;this.filters[i]===c.filters[i]){delete this.filters[i]}}if(!this.props.get(&quot;source&quot;)){this.props.set(&quot;source&quot;,new c(this.m
 odels))}this.reset(this.props.get(&quot;source&quot;).filter(this.validator))},_changeSearch:function(g,h){return this._changeFilteredProp(&quot;search&quot;,g,h)},_changeType:function(g,h){return this._changeFilteredProp(&quot;type&quot;,g,h)},validator:function(g){return _.all(this.filters,function(i,h){return !!i.call(this,g)},this)},validate:function(h,g){return this[this.validator(h)?&quot;add&quot;:&quot;remove&quot;](h,g)},observe:function(g){g.on(&quot;add change&quot;,this.validate,this)},unobserve:function(g){g.off(&quot;add change&quot;,this.validate,this)},mirror:function(g){if(this.mirroring&amp;&amp;this.mirroring===g){return}this.unmirror();this.mirroring=g;this.reset(g.models);g.on(&quot;add&quot;,this._mirrorAdd,this);g.on(&quot;remove&quot;,this._mirrorRemove,this);g.on(&quot;reset&quot;,this._mirrorReset,this)},unmirror:function(){if(!this.mirroring){return}this.mirroring.off(&quot;add&quot;,this._mirrorAdd,this);this.mirroring.off(&quot;remove&quot;,this.
 _mirrorRemove,this);this.mirroring.off(&quot;reset&quot;,this._mirrorReset,this);delete this.mirroring},_mirrorAdd:function(i,g,h){this.add(i,{at:h.index})},_mirrorRemove:function(g){this.remove(g)},_mirrorReset:function(g){this.reset(g.models)},more:function(g){if(this.mirroring&amp;&amp;this.mirroring.more){return this.mirroring.more(g)}return f.Deferred().resolve().promise()},parse:function(h,g){return _.map(h,function(i){var j=d.get(i.id);return j.set(j.parse(i,g))})},_requery:function(){if(this.props.get(&quot;query&quot;)){this.mirror(a.get(this.props.toJSON()))}}},{comparator:function(i,h){var j=this.props.get(&quot;orderby&quot;),g=this.props.get(&quot;order&quot;)||&quot;DESC&quot;,k=i.cid,l=h.cid;i=i.get(j);h=h.get(j);if(&quot;date&quot;===j||&quot;modified&quot;===j){i=i||new Date();h=h||new Date()}return(&quot;DESC&quot;===g)?e(i,h,k,l):e(h,i,l,k)},filters:{search:function(g){if(!this.props.get(&quot;search&quot;)){return true}return _.any([&quot;title&quot;,&quo
 t;filename&quot;,&quot;description&quot;,&quot;caption&quot;,&quot;name&quot;],function(h){var i=g.get(h);return i&amp;&amp;-1!==i.search(this.props.get(&quot;search&quot;))},this)},type:function(h){var g=this.props.get(&quot;type&quot;);if(!g){return true}return -1!==g.indexOf(h.get(&quot;type&quot;))}}});c.all=new c();media.query=function(g){return new c(null,{props:_.extend(_.defaults(g||{},{orderby:&quot;date&quot;}),{query:true})})};a=media.model.Query=c.extend({initialize:function(i,g){var h;g=g||{};c.prototype.initialize.apply(this,arguments);this.args=g.args;this.hasMore=true;this.created=new Date();this.filters.order=function(j){if(!this.comparator){return true}if(this.length){return 1!==this.comparator(j,this.last())}else{if(&quot;DESC&quot;===this.args.order&amp;&amp;(&quot;date&quot;===this.args.orderby||&quot;modified&quot;===this.args.orderby)){return j.get(this.args.orderby)&gt;=this.created}}return false};h=[&quot;s&quot;,&quot;order&quot;,&quot;orderby&quot;
 ,&quot;posts_per_page&quot;,&quot;post_mime_type&quot;];if(_(this.args).chain().keys().difference(h).isEmpty().value()){this.observe(c.all)}},more:function(g){var h=this;if(this._more&amp;&amp;&quot;pending&quot;===this._more.state()){return this._more}if(!this.hasMore){return f.Deferred().resolve().promise()}g=g||{};g.add=true;return this._more=this.fetch(g).done(function(i){if(_.isEmpty(i)||-1===this.args.posts_per_page||i.length&lt;this.args.posts_per_page){h.hasMore=false}})},sync:function(j,h,g){var i;if(&quot;read&quot;===j){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:&quot;query-attachments&quot;});args=_.clone(this.args);if(-1!==args.posts_per_page){args.paged=Math.floor(this.length/args.posts_per_page)+1}g.data.query=args;return media.ajax(g)}else{i=c.prototype.sync?c.prototype:Backbone;return i.sync.apply(this,arguments)}}},{defaultProps:{orderby:&quot;date&quot;,order:&quot;DESC&quot;},defaultArgs:{posts_per_page:40},orderby:{allowed:[&quot;name&quot
 ;,&quot;author&quot;,&quot;date&quot;,&quot;title&quot;,&quot;modified&quot;,&quot;uploadedTo&quot;,&quot;id&quot;,&quot;post__in&quot;],valuemap:{id:&quot;ID&quot;,uploadedTo:&quot;parent&quot;}},propmap:{search:&quot;s&quot;,type:&quot;post_mime_type&quot;,parent:&quot;post_parent&quot;,perPage:&quot;posts_per_page&quot;},get:(function(){var g=[];return function(j,i){var h={},l=a.orderby,m=a.defaultProps,k;delete j.query;_.defaults(j,m);j.order=j.order.toUpperCase();if(&quot;DESC&quot;!==j.order&amp;&amp;&quot;ASC&quot;!==j.order){j.order=m.order.toUpperCase()}if(!_.contains(l.allowed,j.orderby)){j.orderby=m.orderby}_.each(j,function(n,o){h[a.propmap[o]||o]=n});_.defaults(h,a.defaultArgs);h.orderby=l.valuemap[j.orderby]||j.orderby;k=_.find(g,function(n){return _.isEqual(n.args,h)});if(!k){k=new a([],_.extend(i||{},{props:j,args:h}));g.push(k)}return k}}())});media.model.Selection=c.extend({initialize:function(h,g){c.prototype.initialize.apply(this,arguments);this.multiple=
 g&amp;&amp;g.multiple;this.on(&quot;add remove reset&quot;,_.bind(this.single,this))},add:function(h,g){if(!this.multiple){h=_.isArray(h)&amp;&amp;h.length?_.first(h):h;this.clear(g)}return c.prototype.add.call(this,h,g)},clear:function(g){this.remove(this.models,g).single();return this},reset:function(h,g){this.clear(g).add(h,g).single();return this},has:function(g){return !!(this.getByCid(g.cid)||this.get(g.id))},single:function(g){var h=this._single;if(g){this._single=g}if(this._single&amp;&amp;!this.has(this._single)){delete this._single}this._single=this._single||this.last();if(this._single!==h){if(this._single){this._single.trigger(&quot;selection:single&quot;,this._single,this)}if(h){h.trigger(&quot;selection:unsingle&quot;,h,this)}}return this._single}});media.model.Composite=c.extend({initialize:function(h,g){this.observe(this,{silent:true});c.prototype.initialize.apply(this,arguments)},evaluate:function(j,h){var i=this.validator(j),g=!!this.getByCid(j.cid);if(!i&am
 p;&amp;g){this.remove(j,h)}else{if(i&amp;&amp;!g){this.add(j,h);if(this.comparator&amp;&amp;(!h||!h.silent)){this.sort({silent:true})}}}return this},validator:function(){return true},evaluateAll:function(g,h){_.each(g.models,function(i){this.evaluate(i,{silent:true})},this);if(this.comparator){this.sort(h)}return this},observe:function(g,i){var h=i&amp;&amp;i.silent;this.observers=this.observers||[];this.observers.push(g);g.on(&quot;add remove&quot;,h?this._evaluateSilentHandler:this._evaluateHandler,this);g.on(&quot;reset&quot;,h?this._evaluateAllSilentHandler:this._evaluateAllHandler,this);this.evaluateAll(g,i);return this},unobserve:function(g){if(g){g.off(null,null,this);this.observers=_.without(this.observers,g)}else{_.each(this.observers,function(h){h.off(null,null,this)},this);delete this.observers}return this},_evaluateHandler:function(i,g,h){return this.evaluate(i,h)},_evaluateAllHandler:function(g,h){return this.evaluateAll(g,h)},_evaluateSilentHandler:function(i,g
 ,h){return this.evaluate(i,_.defaults({silent:true},h))},_evaluateAllSilentHandler:function(g,h){return this.evaluateAll(g,_.defaults({silent:true},h))}})}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+window.wp=window.wp||{};(function(f){var d,c,a,e,b;media=wp.media=function(g){var h=media.view.MediaFrame,i;if(!h){return}g=_.defaults(g||{},{frame:&quot;select&quot;});if(&quot;select&quot;===g.frame&amp;&amp;h.Select){i=new h.Select(g)}else{if(&quot;post&quot;===g.frame&amp;&amp;h.Post){i=new h.Post(g)}}delete g.frame;i.state(i.options.state);return i.render().attach().open()};_.extend(media,{model:{},view:{},controller:{}});b=media.model.l10n=_.isUndefined(_wpMediaModelsL10n)?{}:_wpMediaModelsL10n;e=function(h,g,i,j){if(_.isEqual(h,g)){return i===j?0:(i&gt;j?-1:1)}else{return h&gt;g?-1:1}};_.extend(media,{template:_.memoize(function(i){var h,g={evaluate:/&lt;#([\s\S]+?)#&gt;/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return function(j){h=h||_.template(f(&quot;#tmpl-&quot;+i).html(),null,g);return h(j)}}),post:function(h,g){return media.ajax({data:_.isObject(h)?h:_.extend(g||{},{action:h})})},ajax:function(h,g){if(_.isObject(h)){
 g=h}else{g=g||{};g.data=_.extend(g.data||{},{action:h})}g=_.defaults(g||{},{type:&quot;POST&quot;,url:ajaxurl,context:this});return f.Deferred(function(i){if(g.success){i.done(g.success)}if(g.error){i.fail(g.error)}delete g.success;delete g.error;f.ajax(g).done(function(j){if(_.isObject(j)&amp;&amp;!_.isUndefined(j.success)){i[j.success?&quot;resolveWith&quot;:&quot;rejectWith&quot;](this,[j.data])}else{i.rejectWith(this,[j])}}).fail(function(){i.rejectWith(this,arguments)})}).promise()},fit:function(k){var h=k.width,g=k.height,j=k.maxWidth,i=k.maxHeight,l;if(!_.isUndefined(j)&amp;&amp;!_.isUndefined(i)){l=(h/g&gt;j/i)?&quot;width&quot;:&quot;height&quot;}else{if(_.isUndefined(i)){l=&quot;width&quot;}else{if(_.isUndefined(j)&amp;&amp;g&gt;i){l=&quot;height&quot;}}}if(&quot;width&quot;===l&amp;&amp;h&gt;j){return{width:j,height:Math.round(j*g/h)}}else{if(&quot;height&quot;===l&amp;&amp;g&gt;i){return{width:Math.round(i*h/g),height:i}}else{return{width:h,height:g}}}}});d=media
 .model.Attachment=Backbone.Model.extend({sync:function(i,h,g){if(&quot;read&quot;===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:&quot;get-attachment&quot;,id:this.id});return media.ajax(g)}else{if(&quot;update&quot;===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:&quot;save-attachment&quot;,id:this.id,nonce:b.saveAttachmentNonce});if(g.changes){_.each(g.changes,function(k,j){g.changes[j]=this.get(j)},this);g.data.changes=g.changes;delete g.changes}return media.ajax(g)}}},parse:function(h,g){if(!h){return h}h.date=new Date(h.date);h.modified=new Date(h.modified);return h},saveCompat:function(i,h){var g=this;return media.post(&quot;save-attachment-compat&quot;,_.defaults({id:this.id,nonce:b.saveAttachmentNonce},i)).done(function(l,j,k){g.set(g.parse(l,k),h)})}},{create:function(g){return c.all.push(g)},get:_.memoize(function(h,g){return c.all.push(g||{id:h})})});c=media.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(h,
 g){g=g||{};this.props=new Backbone.Model();this.filters=g.filters||{};this.props.on(&quot;change:order&quot;,this._changeOrder,this);this.props.on(&quot;change:orderby&quot;,this._changeOrderby,this);this.props.on(&quot;change:query&quot;,this._changeQuery,this);this.props.on(&quot;change:search&quot;,this._changeSearch,this);this.props.on(&quot;change:type&quot;,this._changeType,this);this.props.set(_.defaults(g.props||{}));if(g.observe){this.observe(g.observe)}},_changeOrder:function(h,g){if(this.comparator){this.sort()}},_changeOrderby:function(g,h){if(this.comparator&amp;&amp;this.comparator!==c.comparator){return}if(h&amp;&amp;&quot;post__in&quot;!==h){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(g,h){if(h){this.props.on(&quot;change&quot;,this._requery,this);this._requery()}else{this.props.off(&quot;change&quot;,this._requery,this)}},_changeFilteredProp:function(i,g,h){if(this.props.get(i)===h){return}if(h&amp;&amp;!this.filters[i]){
 this.filters[i]=c.filters[i]}else{if(!h&amp;&amp;this.filters[i]===c.filters[i]){delete this.filters[i]}}if(!this.props.get(&quot;source&quot;)){this.props.set(&quot;source&quot;,new c(this.models))}this.reset(this.props.get(&quot;source&quot;).filter(this.validator))},_changeSearch:function(g,h){return this._changeFilteredProp(&quot;search&quot;,g,h)},_changeType:function(g,h){return this._changeFilteredProp(&quot;type&quot;,g,h)},validator:function(g){return _.all(this.filters,function(i,h){return !!i.call(this,g)},this)},validate:function(h,g){return this[this.validator(h)?&quot;add&quot;:&quot;remove&quot;](h,g)},observe:function(g){g.on(&quot;add change&quot;,this.validate,this)},unobserve:function(g){g.off(&quot;add change&quot;,this.validate,this)},mirror:function(g){if(this.mirroring&amp;&amp;this.mirroring===g){return}this.unmirror();this.mirroring=g;this.reset(g.models);g.on(&quot;add&quot;,this._mirrorAdd,this);g.on(&quot;remove&quot;,this._mirrorRemove,this);g.on
 (&quot;reset&quot;,this._mirrorReset,this)},unmirror:function(){if(!this.mirroring){return}this.mirroring.off(&quot;add&quot;,this._mirrorAdd,this);this.mirroring.off(&quot;remove&quot;,this._mirrorRemove,this);this.mirroring.off(&quot;reset&quot;,this._mirrorReset,this);delete this.mirroring},_mirrorAdd:function(i,g,h){this.add(i,{at:h.index})},_mirrorRemove:function(g){this.remove(g)},_mirrorReset:function(g){this.reset(g.models)},more:function(g){if(this.mirroring&amp;&amp;this.mirroring.more){return this.mirroring.more(g)}return f.Deferred().resolve().promise()},parse:function(h,g){return _.map(h,function(i){var j=d.get(i.id);return j.set(j.parse(i,g))})},_requery:function(){if(this.props.get(&quot;query&quot;)){this.mirror(a.get(this.props.toJSON()))}}},{comparator:function(i,h){var j=this.props.get(&quot;orderby&quot;),g=this.props.get(&quot;order&quot;)||&quot;DESC&quot;,k=i.cid,l=h.cid;i=i.get(j);h=h.get(j);if(&quot;date&quot;===j||&quot;modified&quot;===j){i=i||new 
 Date();h=h||new Date()}return(&quot;DESC&quot;===g)?e(i,h,k,l):e(h,i,l,k)},filters:{search:function(g){if(!this.props.get(&quot;search&quot;)){return true}return _.any([&quot;title&quot;,&quot;filename&quot;,&quot;description&quot;,&quot;caption&quot;,&quot;name&quot;],function(h){var i=g.get(h);return i&amp;&amp;-1!==i.search(this.props.get(&quot;search&quot;))},this)},type:function(h){var g=this.props.get(&quot;type&quot;);if(!g){return true}return -1!==g.indexOf(h.get(&quot;type&quot;))}}});c.all=new c();media.query=function(g){return new c(null,{props:_.extend(_.defaults(g||{},{orderby:&quot;date&quot;}),{query:true})})};a=media.model.Query=c.extend({initialize:function(i,g){var h;g=g||{};c.prototype.initialize.apply(this,arguments);this.args=g.args;this.hasMore=true;this.created=new Date();this.filters.order=function(j){if(!this.comparator){return true}if(this.length){return 1!==this.comparator(j,this.last())}else{if(&quot;DESC&quot;===this.args.order&amp;&amp;(&quot;da
 te&quot;===this.args.orderby||&quot;modified&quot;===this.args.orderby)){return j.get(this.args.orderby)&gt;=this.created}}return false};h=[&quot;s&quot;,&quot;order&quot;,&quot;orderby&quot;,&quot;posts_per_page&quot;,&quot;post_mime_type&quot;];if(_(this.args).chain().keys().difference(h).isEmpty().value()){this.observe(c.all)}},more:function(g){var h=this;if(this._more&amp;&amp;&quot;pending&quot;===this._more.state()){return this._more}if(!this.hasMore){return f.Deferred().resolve().promise()}g=g||{};g.add=true;return this._more=this.fetch(g).done(function(i){if(_.isEmpty(i)||-1===this.args.posts_per_page||i.length&lt;this.args.posts_per_page){h.hasMore=false}})},sync:function(j,h,g){var i;if(&quot;read&quot;===j){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:&quot;query-attachments&quot;});args=_.clone(this.args);if(-1!==args.posts_per_page){args.paged=Math.floor(this.length/args.posts_per_page)+1}g.data.query=args;return media.ajax(g)}else{i=c.prototype.syn
 c?c.prototype:Backbone;return i.sync.apply(this,arguments)}}},{defaultProps:{orderby:&quot;date&quot;,order:&quot;DESC&quot;},defaultArgs:{posts_per_page:40},orderby:{allowed:[&quot;name&quot;,&quot;author&quot;,&quot;date&quot;,&quot;title&quot;,&quot;modified&quot;,&quot;uploadedTo&quot;,&quot;id&quot;,&quot;post__in&quot;],valuemap:{id:&quot;ID&quot;,uploadedTo:&quot;parent&quot;}},propmap:{search:&quot;s&quot;,type:&quot;post_mime_type&quot;,parent:&quot;post_parent&quot;,perPage:&quot;posts_per_page&quot;},get:(function(){var g=[];return function(j,i){var h={},l=a.orderby,m=a.defaultProps,k;delete j.query;_.defaults(j,m);j.order=j.order.toUpperCase();if(&quot;DESC&quot;!==j.order&amp;&amp;&quot;ASC&quot;!==j.order){j.order=m.order.toUpperCase()}if(!_.contains(l.allowed,j.orderby)){j.orderby=m.orderby}_.each(j,function(n,o){h[a.propmap[o]||o]=n});_.defaults(h,a.defaultArgs);h.orderby=l.valuemap[j.orderby]||j.orderby;k=_.find(g,function(n){return _.isEqual(n.args,h)});if(
 !k){k=new a([],_.extend(i||{},{props:j,args:h}));g.push(k)}return k}}())});media.model.Selection=c.extend({initialize:function(h,g){c.prototype.initialize.apply(this,arguments);this.multiple=g&amp;&amp;g.multiple;this.on(&quot;add remove reset&quot;,_.bind(this.single,this))},add:function(h,g){if(!this.multiple){h=_.isArray(h)&amp;&amp;h.length?_.first(h):h;this.clear(g)}return c.prototype.add.call(this,h,g)},clear:function(g){this.remove(this.models,g).single();return this},reset:function(h,g){this.clear(g).add(h,g).single();return this},has:function(g){return !!(this.getByCid(g.cid)||this.get(g.id))},single:function(g){var h=this._single;if(g){this._single=g}if(this._single&amp;&amp;!this.has(this._single)){delete this._single}this._single=this._single||this.last();if(this._single!==h){if(this._single){this._single.trigger(&quot;selection:single&quot;,this._single,this)}if(h){h.trigger(&quot;selection:unsingle&quot;,h,this)}}return this._single}});media.model.Composite=c.e
 xtend({initialize:function(h,g){this.observe(this,{silent:true});c.prototype.initialize.apply(this,arguments)},evaluate:function(j,h){var i=this.validator(j),g=!!this.getByCid(j.cid);if(!i&amp;&amp;g){this.remove(j,h)}else{if(i&amp;&amp;!g){this.add(j,h);if(this.comparator&amp;&amp;(!h||!h.silent)){this.sort({silent:true})}}}return this},validator:function(){return true},evaluateAll:function(g,h){_.each(g.models,function(i){this.evaluate(i,{silent:true})},this);if(this.comparator){this.sort(h)}return this},observe:function(g,i){var h=i&amp;&amp;i.silent;this.observers=this.observers||[];this.observers.push(g);g.on(&quot;add remove&quot;,h?this._evaluateSilentHandler:this._evaluateHandler,this);g.on(&quot;reset&quot;,h?this._evaluateAllSilentHandler:this._evaluateAllHandler,this);this.evaluateAll(g,i);return this},unobserve:function(g){if(g){g.off(null,null,this);this.observers=_.without(this.observers,g)}else{_.each(this.observers,function(h){h.off(null,null,this)},this);del
 ete this.observers}return this},_evaluateHandler:function(i,g,h){return this.evaluate(i,h)},_evaluateAllHandler:function(g,h){return this.evaluateAll(g,h)},_evaluateSilentHandler:function(i,g,h){return this.evaluate(i,_.defaults({silent:true},h))},_evaluateAllSilentHandler:function(g,h){return this.evaluateAll(g,_.defaults({silent:true},h))}})}(jQuery));
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsmediaviewsminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.min.js (22545 => 22546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.min.js        2012-11-11 21:51:27 UTC (rev 22545)
+++ trunk/wp-includes/js/media-views.min.js        2012-11-11 22:58:32 UTC (rev 22546)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(e){var f=wp.media,d=f.model.Attachment,c=f.model.Attachments,a=f.model.Query,b;b=f.view.l10n=_.isUndefined(_wpMediaViewsL10n)?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:&quot;webkitTransitionEnd&quot;,MozTransition:&quot;transitionend&quot;,OTransition:&quot;oTransitionEnd otransitionend&quot;,transition:&quot;transitionend&quot;},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&amp;&amp;{end:h[i]}}());f.transition=function(g){var h=e.Deferred();if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,h.resolve)}else{h.resolve()}return h.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},&quot;id&quot;,&quot;controller&quot;));this.on(&quot;activate:empty&quot;,this.empty,this);this.mode(&quot;empty&quot;)};f.controller.Region.extend=Backbone.Model.extend;_.exte
 nd(f.controller.Region.prototype,Backbone.Events,{trigger:(function(){var g=/\s+/,h=Backbone.Events.trigger;return function(i){var j=&quot;:&quot;+this._mode,k=i.split(g).join(j)+j;h.apply(this,arguments);h.apply(this,[k].concat(_.rest(arguments)));return this}}()),mode:function(g){if(g){this.trigger(&quot;deactivate&quot;,this);this._mode=g;return this.trigger(&quot;activate&quot;,this)}return this._mode},view:function(g){var h=this._view,i=this._mode,j=this.id;if(!g){return h}if(g===h){return}if(j){g.$el.addClass(&quot;region-&quot;+j)}if(i){g.$el.addClass(&quot;mode-&quot;+i)}if(h){h.$el.replaceWith(g.$el);if(h.destroy){h.destroy()}h.undelegateEvents()}this._view=g},empty:function(){this.view(new Backbone.View())}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,Backbone.Events,{get:function(g){this.states=this.states||new Backbone.Collection(
 );if(!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},state:function(h){var g;if(!h){return this._state?this.get(this._state):null}g=this.state();if((g&amp;&amp;h===g.id)||!this.states||!this.states.get(h)){return}if(g){g.trigger(&quot;deactivate&quot;);this._previous=g.id}this._state=h;this.state().trigger(&quot;activate&quot;)},previous:function(){return this._previous}});_.each([&quot;on&quot;,&quot;off&quot;,&quot;trigger&quot;],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({initialize:function(){this.on(&quot;activate&quot;,this._activate,this);this.on(&quot;activate&quot;,this.activate,this);this.on(&quot;deactivate&quot;,this._deactivate,this);this.on(&quot;deactivate&quot;,this.deactivate,this);this.on(&quot;reset&quot;,this.reset,this)},activate:function(){},_activate:function(){
 this.active=true;this.menu();this.toolbar();this.sidebar();this.content()},deactivate:function(){},_deactivate:function(){this.active=false},reset:function(){},menu:function(){var i=this.frame.menu,h=this.get(&quot;menu&quot;),g;if(!h){return}if(i.mode()!==h){i.mode(h)}g=i.view();if(g.select){g.select(this.id)}}});_.each([&quot;toolbar&quot;,&quot;sidebar&quot;,&quot;content&quot;],function(g){f.controller.State.prototype[g]=function(){var h=this.get(g);if(h){this.frame[g].mode(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:&quot;library&quot;,multiple:false,describe:false,toolbar:&quot;main-attachments&quot;,sidebar:&quot;settings&quot;,searchable:true},initialize:function(){if(!this.get(&quot;selection&quot;)){this.set(&quot;selection&quot;,new f.model.Selection(null,{multiple:this.get(&quot;multiple&quot;)}))}if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query())}if(!this.get(&quot;edge&quot;)){this.set(&quot;edge&quot;,120)}if(!th
 is.get(&quot;gutter&quot;)){this.set(&quot;gutter&quot;,8)}if(!this.get(&quot;details&quot;)){this.set(&quot;details&quot;,[])}f.controller.State.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get(&quot;selection&quot;);this._excludeStateLibrary();this.buildComposite();this.on(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.on(&quot;change:excludeState&quot;,this._excludeState,this);if(this.get(&quot;multiple&quot;)){wp.Uploader.queue.on(&quot;add&quot;,this.selectUpload,this)}g.on(&quot;selection:single selection:unsingle&quot;,this.sidebar,this);g.on(&quot;add remove reset&quot;,this.refreshSelection,this);this._updateEmpty();this.get(&quot;library&quot;).on(&quot;add remove reset&quot;,this._updateEmpty,this);this.on(&quot;change:empty&quot;,this.refresh,this);this.refresh()},deactivate:function(){this.off(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.off(&quot;change:excludeState&quot;,this._
 excludeState,this);this.destroyComposite();wp.Uploader.queue.off(&quot;add&quot;,this.selectUpload,this);this.get(&quot;selection&quot;).off(null,null,this);this.get(&quot;library&quot;).off(&quot;add remove reset&quot;,this._updateEmpty,this);this.off(&quot;change:empty&quot;,this.refresh,this)},reset:function(){this.get(&quot;selection&quot;).clear()},sidebar:function(){var g=this.frame.sidebar;if(this.get(&quot;selection&quot;).single()){g.mode(this.get(&quot;sidebar&quot;))}else{g.mode(&quot;clear&quot;)}},content:function(){var g=this.frame;if(this.get(&quot;empty&quot;)){this.get(&quot;library&quot;).more();g.content.mode(&quot;upload&quot;)}else{g.content.mode(&quot;browse&quot;)}},refresh:function(){this.frame.$el.toggleClass(&quot;hide-sidebar hide-toolbar&quot;,this.get(&quot;empty&quot;));this.content();this.refreshSelection()},_updateEmpty:function(){var g=this.get(&quot;library&quot;);this.set(&quot;empty&quot;,!g.length&amp;&amp;!g.props.get(&quot;search&quot;)
 )},refreshSelection:function(){this.frame.toolbar.view().refresh();this.trigger(&quot;refresh:selection&quot;,this,this.get(&quot;selection&quot;))},selectUpload:function(g){this.get(&quot;selection&quot;).add(g)},toggleSelection:function(g){var h=this.get(&quot;selection&quot;);if(!g){return}if(h.has(g)){h[h.single()===g?&quot;remove&quot;:&quot;single&quot;](g)}else{h.add(g).single()}return this},buildComposite:function(){var h=this.get(&quot;_library&quot;),g=this.get(&quot;exclude&quot;),i;this.destroyComposite();if(!this.get(&quot;exclude&quot;)){return}if(!h){this.set(&quot;_library&quot;,h=this.get(&quot;library&quot;))}i=new f.model.Composite(null,{props:_.pick(h.props.toJSON(),&quot;order&quot;,&quot;orderby&quot;)});i.validator=function(j){return !!h.getByCid(j.cid)&amp;&amp;!g.getByCid(j.cid)};i.observe(h).observe(g);i.more=_.bind(h.more,h);this.set(&quot;library&quot;,i)},destroyComposite:function(){var h=this.get(&quot;library&quot;),g=this.get(&quot;_library&qu
 ot;);if(!g){return}h.unobserve();this.set(&quot;library&quot;,g);this.unset(&quot;_library&quot;)},_excludeState:function(){var h=this.get(&quot;excludeState&quot;),g=this.previous(&quot;excludeState&quot;);if(g){this.frame.get(g).off(&quot;change:library&quot;,this._excludeStateLibrary,this)}if(h){this.frame.get(h).on(&quot;change:library&quot;,this._excludeStateLibrary,this)}},_excludeStateLibrary:function(){var g=this.get(&quot;excludeState&quot;);if(!g){return}this.set(&quot;exclude&quot;,this.frame.get(g).get(&quot;library&quot;))}});f.controller.Upload=f.controller.Library.extend({defaults:_.defaults({id:&quot;upload&quot;},f.controller.Library.prototype.defaults),initialize:function(){var g=this.get(&quot;library&quot;);if(!g){g=new c();g.props.set({orderby:&quot;date&quot;,order:&quot;ASC&quot;});g.observe(wp.Uploader.queue);this.set(&quot;library&quot;,g)}f.controller.Library.prototype.initialize.apply(this,arguments)}});f.controller.Gallery=f.controller.Library.ext
 end({defaults:{id:&quot;gallery-edit&quot;,multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:&quot;gallery-edit&quot;,sidebar:&quot;settings&quot;},initialize:function(){if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,new f.model.Selection())}if(!this.get(&quot;AttachmentView&quot;)){this.set(&quot;AttachmentView&quot;,f.view.Attachment.Gallery)}f.controller.Library.prototype.initialize.apply(this,arguments)},sidebar:function(){f.controller.Library.prototype.sidebar.apply(this,arguments);this.frame.sidebar.trigger(&quot;gallery-settings&quot;);return this}});f.view.Frame=Backbone.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({controller:this,id:g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});
 this.states.on(&quot;add&quot;,function(g){g.frame=this},this)},render:function(){var g=_.map(this.regions,function(h){return this[h].view().el},this);e(g).detach();this.$el.html(g);return this},reset:function(){this.states.invoke(&quot;trigger&quot;,&quot;reset&quot;);return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:&quot;media-frame&quot;,regions:[&quot;menu&quot;,&quot;content&quot;,&quot;sidebar&quot;,&quot;toolbar&quot;],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:&quot;&quot;,modal:true,uploader:true});if(this.options.modal){this.modal=new f.view.Modal({controller:this,$content:this.$el,title:this.options.title})}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({uploader:{dropzone:this.modal?this.modal.$el:this.$el}})}},render:function(){if(this.modal){this.modal.render()}f.view.Frame.prototype.render.appl
 y(this,arguments);if(this.uploader){this.uploader.render().$el.appendTo(this.$el)}return this},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e(&quot;#post_ID&quot;);if(h.length){k+=&quot;&amp;post_id=&quot;+h.val()}_.each(i,function(m,n){var l=this.get(&quot;iframe:&quot;+n).set(_.defaults({tab:n,src:k+&quot;&amp;tab=&quot;+n,title:m,content:&quot;iframe&quot;,menu:&quot;main&quot;},g))},this);this.content.on(&quot;activate:iframe&quot;,this.iframeContent,this);this.menu.on(&quot;activate:main&quot;,this.iframeMenu,this);this.on(&quot;open&quot;,this.hijackThickbox,this);this.on(&quot;close&quot;,this.restoreThickbox,this)},iframeContent:function(){this.$el.addClass(&quot;hide-toolbar hide-sidebar&quot;);this.content.view(new f.view.Iframe({controller:this}).render())},iframeMenu:function(){var g={};_.each(f.view.settings.tabs,function(h,i){g[&quot;iframe:&quot;+i]={text:this.get(&quot;iframe:&quot;+i).get(&quot;title&quot;),p
 riority:200}},this);this.menu.view().add(g)},hijackThickbox:function(){var g=this;if(!window.tb_remove||this._tb_remove){return}this._tb_remove=window.tb_remove;window.tb_remove=function(){g.close();g.reset();g.state(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each([&quot;open&quot;,&quot;close&quot;,&quot;attach&quot;,&quot;detach&quot;],function(g){f.view.MediaFrame.prototype[g]=function(h){this.trigger(g);if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{state:&quot;upload&quot;,selection:[],library:{},multiple:false});this.createSelection();this.createStates();this.bindHandlers()},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)
 ){this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}},createStates:function(){var h=this.options,g;g={multiple:this.options.multiple,menu:&quot;main&quot;,toolbar:&quot;select&quot;};this.states.add([new f.controller.Library(_.defaults({selection:h.selection,library:f.query(h.library)},g)),new f.controller.Upload(g)])},bindHandlers:function(){this.menu.on(&quot;activate:main&quot;,this.mainMenu,this);this.content.on(&quot;activate:browse&quot;,this.browseContent,this);this.content.on(&quot;activate:upload&quot;,this.uploadContent,this);this.sidebar.on(&quot;activate:clear&quot;,this.clearSidebar,this);this.sidebar.on(&quot;activate:settings&quot;,this.settingsSidebar,this);this.toolbar.on(&quot;activate:select&quot;,this.selectToolbar,this);this.on(&quot;refresh:selection&quot;,this.refreshSelectToolbar,this)},mainMenu:function(g){this.menu.view(new f.view.Menu({controller:this,silent:g&amp;&amp;g.silent,views:{upload:{text:b.uploadFilesTitle,p
 riority:20},library:{text:b.mediaLibraryTitle,priority:40}}}))},browseContent:function(){var g=this.state();this.content.view(new f.view.AttachmentsBrowser({controller:this,collection:g.get(&quot;library&quot;),model:g,sortable:g.get(&quot;sortable&quot;),search:g.get(&quot;searchable&quot;),AttachmentView:g.get(&quot;AttachmentView&quot;)}).render())},uploadContent:function(){this.content.view(new f.view.UploaderInline({controller:this}).render())},clearSidebar:function(){this.sidebar.view(new f.view.Sidebar({controller:this}))},settingsSidebar:function(g){this.sidebar.view(new f.view.Sidebar({controller:this,silent:g&amp;&amp;g.silent,views:{details:new f.view.Attachment.Details({controller:this,model:this.state().get(&quot;selection&quot;).single(),priority:80}).render()}}))},selectToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{select:{style:&quot;primary&quot;,text:b.select,priority:80,click:function(){var g=this.controller;g.close();g.st
 ate().trigger(&quot;select&quot;);g.reset().state(g.options.state)}}}}))},refreshSelectToolbar:function(){var g=this.state().get(&quot;selection&quot;);if(!g||&quot;select&quot;!==this.toolbar.mode()){return}this.toolbar.view().get(&quot;select&quot;).model.set(&quot;disabled&quot;,!g.length)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{state:&quot;upload&quot;,multiple:true,editing:false});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var j=this.options,g,h,i;g={multiple:this.options.multiple,menu:&quot;main&quot;,displayUserSettings:true};h={multiple:true,menu:&quot;gallery&quot;,toolbar:&quot;gallery-add&quot;,excludeState:&quot;gallery-edit&quot;};i={multiple:true,menu:&quot;batch&quot;,toolbar:&quot;batch-add&quot;,excludeState:&quot;batch-edit&quot;};this.states.add([new f.controller.Library(_.defaults({selection:j.selection,library:f.qu
 ery(j.library)},g)),new f.controller.Upload(g),new f.controller.Gallery({library:j.selection,editing:j.editing,menu:&quot;gallery&quot;}),new f.controller.Library(_.defaults({id:&quot;gallery-library&quot;,library:f.query({type:&quot;image&quot;})},h)),new f.controller.Upload(_.defaults({id:&quot;gallery-upload&quot;},h)),new f.controller.Library({id:&quot;batch-edit&quot;,multiple:false,describe:true,edge:199,sortable:true,searchable:false,menu:&quot;batch&quot;,toolbar:&quot;batch-edit&quot;,sidebar:&quot;attachment-settings&quot;}),new f.controller.Library(_.defaults({id:&quot;batch-library&quot;,library:f.query({type:&quot;image&quot;})},i)),new f.controller.Upload(_.defaults({id:&quot;batch-upload&quot;},i))])},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);var g={menu:{batch:&quot;batchMenu&quot;,gallery:&quot;galleryMenu&quot;},content:{embed:&quot;embedContent&quot;},sidebar:{&quot;attachment-settings&quot;:&quot;attachm
 entSettingsSidebar&quot;},toolbar:{&quot;main-attachments&quot;:&quot;mainAttachmentsToolbar&quot;,&quot;main-embed&quot;:&quot;mainEmbedToolbar&quot;,&quot;batch-edit&quot;:&quot;batchEditToolbar&quot;,&quot;batch-add&quot;:&quot;batchAddToolbar&quot;,&quot;gallery-edit&quot;:&quot;galleryEditToolbar&quot;,&quot;gallery-add&quot;:&quot;galleryAddToolbar&quot;}};_.each(g,function(i,h){_.each(i,function(k,j){this[h].on(&quot;activate:&quot;+j,this[k],this)},this)},this);_.each([&quot;library&quot;,&quot;upload&quot;],function(h){this.get(h).on(&quot;refresh:selection&quot;,function(k,i){var j=this.sidebar;if(!i.length){j.mode(&quot;clear&quot;)}else{if(i.length===1){j.mode(&quot;attachment-settings&quot;)}else{j.mode(&quot;settings&quot;)}}},this)},this);this.sidebar.on(&quot;gallery-settings&quot;,this.onSidebarGallerySettings,this)},mainMenu:function(){f.view.MediaFrame.Select.prototype.mainMenu.call(this,{silent:true});this.menu.view().add({separateLibrary:new Backbone.Vie
 w({className:&quot;separator&quot;,priority:60}),embed:{text:b.embedFromUrlTitle,priority:80}})},batchMenu:function(){var g=this.previous(),h=this;this.menu.view(new f.view.Menu({controller:this,views:{cancel:{text:b.cancelBatchTitle,priority:20,click:function(){if(g){h.state(g)}else{h.close()}}},separateCancel:new Backbone.View({className:&quot;separator&quot;,priority:40}),&quot;batch-edit&quot;:{text:b.editBatchTitle,priority:60},&quot;batch-upload&quot;:{text:b.uploadFilesTitle,priority:80},&quot;batch-library&quot;:{text:b.mediaLibraryTitle,priority:100}}}))},galleryMenu:function(){var g=this.previous(),h=this;this.menu.view(new f.view.Menu({controller:this,views:{cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(g){h.state(g)}else{h.close()}}},separateCancel:new Backbone.View({className:&quot;separator&quot;,priority:40}),&quot;gallery-edit&quot;:{text:b.editGalleryTitle,priority:60},&quot;gallery-upload&quot;:{text:b.uploadImagesTitle,priority:80},&quo
 t;gallery-library&quot;:{text:b.mediaLibraryTitle,priority:100}}}))},embedContent:function(){},onSidebarGallerySettings:function(h){var g=this.state().get(&quot;library&quot;);g.gallery=g.gallery||new Backbone.Model();this.sidebar.view().add({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40}).render()},h)},attachmentSettingsSidebar:function(g){var h=this.state(),i=h.get(&quot;details&quot;),j=h.get(&quot;selection&quot;).single();this.settingsSidebar({silent:true});i[j.cid]=i[j.cid]||new Backbone.Model({align:getUserSetting(&quot;align&quot;,&quot;none&quot;),size:getUserSetting(&quot;imgsize&quot;,&quot;medium&quot;),link:getUserSetting(&quot;urlbutton&quot;,&quot;post&quot;)});this.sidebar.view().add({display:new f.view.Settings.AttachmentDisplay({controller:this,model:i[j.cid],sizes:j.get(&quot;sizes&quot;),priority:100,userSettings:h.get(&quot;displayUserSettings&quot;)}).render()},g)},mainAttachmentsToolbar:function(){this.toolbar.view(ne
 w f.view.Toolbar.Insert.Post({controller:this}))},mainEmbedToolbar:function(){},batchEditToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.insertIntoPost,priority:80,click:function(){var g=this.controller,h=g.state();g.close();h.trigger(&quot;insert&quot;,h.get(&quot;library&quot;));g.reset();g.state(&quot;upload&quot;)}}}}))},batchAddToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.addToBatch,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.get(&quot;batch-edit&quot;);h.get(&quot;library&quot;).add(i.get(&quot;selection&quot;).models);i.trigger(&quot;reset&quot;);g.state(&quot;batch-edit&quot;)}}}}))},galleryEditToolbar:function(){var g=this.state().get(&quot;editing&quot;);this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:g?b.updateGallery:b.insertGallery,priority:8
 0,click:function(){var h=this.controller,i=h.state();h.close();i.trigger(&quot;update&quot;,i.get(&quot;library&quot;));h.reset();h.state(&quot;upload&quot;)}}}}))},galleryAddToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.addToGallery,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.get(&quot;gallery-edit&quot;);h.get(&quot;library&quot;).add(i.get(&quot;selection&quot;).models);i.trigger(&quot;reset&quot;);g.state(&quot;gallery-edit&quot;)}}}}))}});f.view.Modal=Backbone.View.extend({tagName:&quot;div&quot;,template:f.template(&quot;media-modal&quot;),events:{&quot;click .media-modal-backdrop, .media-modal-close&quot;:&quot;closeHandler&quot;},initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{container:document.body,title:&quot;&quot;})},render:function(){this.options.$content=this.options.$content||e(&quot;&lt;div /&gt;&quot;);this.options.$conten
 t.detach();this.$el.html(this.template({title:this.options.title}));this.options.$content.addClass(&quot;media-modal-content&quot;);this.$(&quot;.media-modal&quot;).append(this.options.$content);return this},attach:function(){this.$el.appendTo(this.options.container);this.controller.trigger(&quot;attach&quot;,this.controller);return this},detach:function(){this.$el.detach();this.controller.trigger(&quot;detach&quot;,this.controller);return this},open:function(){this.$el.show();this.controller.trigger(&quot;open&quot;,this.controller);return this},close:function(){this.$el.hide();this.controller.trigger(&quot;close&quot;,this.controller);return this},closeHandler:function(g){g.preventDefault();this.close()},content:function(g){if(this.options.$content){this.options.$content.detach()}this.options.$content=(g instanceof Backbone.View)?g.$el:g;return this.render()}});f.view.UploaderWindow=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-window&quot;,templat
 e:f.template(&quot;uploader-window&quot;),initialize:function(){var g;this.controller=this.options.controller;this.$browser=e('&lt;a href=&quot;#&quot; class=&quot;browser&quot; /&gt;').hide().appendTo(&quot;body&quot;);g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone){if(!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}g.dropzone.one(&quot;mouseenter dragenter&quot;,_.bind(this.maybeInitUploader,this))}},render:function(){this.maybeInitUploader();this.$el.html(this.template(this.options));return this},refresh:function(){if(this.uploader){this.uploader.refresh()}},maybeInitUploader:function(){var h,g;if(this.uploader||!this.$el.closest(&quot;body&quot;).length){return}h=e(&quot;#post_ID&quot;);if(h.length){this.options.uploader.params.post_id=h.val()}this.uploader=new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on(&quot;dropzone:enter&quot;,_.bind(this.show,this));g.on(&quot;
 dropzone:leave&quot;,_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if(&quot;0&quot;===g.css(&quot;opacity&quot;)){g.hide()}})}});f.view.UploaderInline=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-inline&quot;,template:f.template(&quot;uploader-inline&quot;),initialize:function(){this.controller=this.options.controller;if(!this.options.$browser){this.options.$browser=this.controller.uploader.$browser}wp.Uploader.queue.on(&quot;add remove reset change:percent&quot;,this.renderUploadProgress,this)},destroy:function(){wp.Uploader.queue.off(&quot;add remove reset change:percent&quot;,this.renderUploadProgress,this);this.remove()},render:function(){var g=this.options.$browser,h;this.renderUploadProgress();this.$el.html(this.template(this.options));h=this.$(&quot;.browser&quot;);g.text(h.text());g[0].className=h[0].class
 Name;h.replaceWith(g.show());this.$bar=this.$(&quot;.media-progress-bar div&quot;);return this},renderUploadProgress:function(){var g=wp.Uploader.queue;this.$el.toggleClass(&quot;uploading&quot;,!!g.length);if(!this.$bar||!g.length){return}this.$bar.width((g.reduce(function(h,i){if(i.get(&quot;uploading&quot;)){return h+(i.get(&quot;percent&quot;)||0)}else{return h+100}},0)/g.length)+&quot;%&quot;)}});f.view.Toolbar=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-toolbar&quot;,initialize:function(){this.controller=this.options.controller;this._views={};this.$primary=e('&lt;div class=&quot;media-toolbar-primary&quot; /&gt;').prependTo(this.$el);this.$secondary=e('&lt;div class=&quot;media-toolbar-secondary&quot; /&gt;').prependTo(this.$el);if(this.options.items){this.add(this.options.items,{silent:true})}if(!this.options.silent){this.render()}},destroy:function(){this.remove();_.each(this._views,function(g){if(g.destroy){g.destroy()}})},render:function(){v
 ar g=_.chain(this._views).sortBy(function(h){return h.options.priority||10}).groupBy(function(h){return(h.options.priority||10)&gt;0?&quot;primary&quot;:&quot;secondary&quot;}).value();e(_.pluck(this._views,&quot;el&quot;)).detach();this.$primary.html(_.pluck(g.primary||[],&quot;el&quot;));this.$secondary.html(_.pluck(g.secondary||[],&quot;el&quot;));this.refresh();return this},add:function(i,g,h){h=h||{};if(_.isObject(i)){_.each(i,function(j,k){this.add(k,j,{silent:true})},this);if(!h.silent){this.render()}return this}if(!(g instanceof Backbone.View)){g.classes=[i].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[i]=g;if(!h.silent){this.render()}return this},get:function(g){return this._views[g]},remove:function(h,g){delete this._views[h];if(!g||!g.silent){this.render()}return this},refresh:function(){}});f.view.Toolbar.Insert=f.view.Toolbar.extend({initialize:function(){var g=this.options.controller,h=g.state().ge
 t(&quot;selection&quot;);this.options.items=_.defaults(this.options.items||{},{selection:new f.view.Selection({controller:g,collection:h,priority:-40}).render(),insert:{style:&quot;primary&quot;,priority:80,text:b.insertIntoPost,click:function(){g.close();g.state().trigger(&quot;insert&quot;,h);h.clear()}}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().get(&quot;selection&quot;);this.get(&quot;insert&quot;).model.set(&quot;disabled&quot;,!g.length)}});f.view.Toolbar.Insert.Post=f.view.Toolbar.Insert.extend({initialize:function(){var g=function(i,h){return function(){var j=this.controller,k=j.state().get(&quot;selection&quot;),l=j.get(i),m=h?h(k):k.models;l.set(&quot;library&quot;,new f.model.Selection(m,{props:k.props.toJSON(),multiple:true}));this.controller.state(i)}};this.options.items=_.defaults(this.options.items||{},{gallery:{text:b.createNewGallery,priority:40,click:g(&quot;gallery-edit&quot;,function(h){r
 eturn h.where({type:&quot;image&quot;})})},batch:{text:b.batchInsert,priority:60,click:g(&quot;batch-edit&quot;)}});f.view.Toolbar.Insert.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().get(&quot;selection&quot;),h=g.length;f.view.Toolbar.Insert.prototype.refresh.apply(this,arguments);this.get(&quot;gallery&quot;).$el.toggle(h&gt;1&amp;&amp;g.any(function(i){return&quot;image&quot;===i.get(&quot;type&quot;)}));this.get(&quot;batch&quot;).$el.toggle(h&gt;1);this.get(&quot;insert&quot;).$el.toggle(h&lt;=1)}});f.view.Button=Backbone.View.extend({tagName:&quot;a&quot;,className:&quot;media-button&quot;,attributes:{href:&quot;#&quot;},events:{click:&quot;click&quot;},defaults:{text:&quot;&quot;,style:&quot;&quot;,size:&quot;large&quot;,disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.opt
 ions[g]},this);if(this.options.dropdown){this.options.dropdown.addClass(&quot;dropdown&quot;)}this.model.on(&quot;change&quot;,this.render,this)},render:function(){var h=[&quot;button&quot;,this.className],g=this.model.toJSON();if(g.style){h.push(&quot;button-&quot;+g.style)}if(g.size){h.push(&quot;button-&quot;+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(&quot; &quot;);this.$el.attr(&quot;disabled&quot;,g.disabled);if(this.options.dropdown){this.options.dropdown.detach()}this.$el.text(this.model.get(&quot;text&quot;));if(this.options.dropdown){this.$el.append(this.options.dropdown)}return this},click:function(g){if(&quot;#&quot;===this.attributes.href){g.preventDefault()}if(this.options.click&amp;&amp;!this.model.get(&quot;disabled&quot;)){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;button-group button-large media-button-group&quot;,initialize:function(){this.butt
 ons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,&quot;el&quot;)).detach());return this}});f.view.PriorityList=Backbone.View.extend({tagName:&quot;div&quot;,initialize:function(){this.controller=this.options.controller;this._views={};this.add(_.extend({},this.views,this.options.views),{silent:true});delete this.views;delete this.options.views;if(!this.options.silent){this.render()}},destroy:function(){this.remove();_.each(this._views,function(g){if(g.destroy){g.destroy()}})},render:function(){var g=_(this._views).chain().sortBy(function(h){return h.options.priority||10}).pluck(&quot;el&quot;).value();e(g).detach();this.$el.html(g);return this},add:function(i,g,h){h=h||{};if(_.isObject(i)){_.each(i,function(j,k){this.add(k,j,{silent:true})},this);
 if(!h.silent){this.render()}return this}if(!(g instanceof Backbone.View)){g=this.toView(g,i,h)}g.controller=g.controller||this.controller;this._views[i]=g;if(!h.silent){this.render()}return this},get:function(g){return this._views[g]},remove:function(h,g){delete this._views[h];if(!g||!g.silent){this.render()}return this},toView:function(g){return new Backbone.View(g)}});f.view.Menu=f.view.PriorityList.extend({tagName:&quot;ul&quot;,className:&quot;media-menu&quot;,toView:function(g,h){g=g||{};g.id=g.id||h;return new f.view.MenuItem(g).render()},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass(&quot;active&quot;)},deselect:function(){this.$el.children().removeClass(&quot;active&quot;)}});f.view.MenuItem=Backbone.View.extend({tagName:&quot;li&quot;,className:&quot;media-menu-item&quot;,events:{click:&quot;click&quot;},click:function(){var g=this.options;if(g.click){g.click.call(this)}else{if(g.id){this.controller.state(g.id)}}},render:function(
 ){var g=this.options;if(g.text){this.$el.text(g.text)}else{if(g.html){this.$el.html(g.html)}}return this}});f.view.Sidebar=f.view.PriorityList.extend({className:&quot;media-sidebar&quot;});f.view.Attachment=Backbone.View.extend({tagName:&quot;li&quot;,className:&quot;attachment&quot;,template:f.template(&quot;attachment&quot;),events:{&quot;mousedown .attachment-preview&quot;:&quot;toggleSelection&quot;,&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;},buttons:{},initialize:function(){this.controller=this.options.controller;this.model.on(&quot;change:sizes change:uploading change:caption change:title&quot;,this.render,this);this.model.on(&quot;change:percent&quot;,this.progress,this);this.model.on(&quot;add&quot;,this.select,this);this.model.on(&quot;remove&quot;,th
 is.deselect,this);this.model.on(&quot;selection:single selection:unsingle&quot;,this.details,this);this.details(this.model,this.controller.state().get(&quot;selection&quot;));this.$el.on(&quot;click&quot;,&quot;a&quot;,this.preventDefault)},destroy:function(){this.model.off(null,null,this);this.$el.off(&quot;click&quot;,&quot;a&quot;,this.preventDefault);this.remove()},render:function(){var h=this.model.toJSON(),g=_.defaults(this.model.toJSON(),{orientation:&quot;landscape&quot;,uploading:false,type:&quot;&quot;,subtype:&quot;&quot;,icon:&quot;&quot;,filename:&quot;&quot;,caption:&quot;&quot;,title:&quot;&quot;});g.buttons=this.buttons;g.describe=this.controller.state().get(&quot;describe&quot;);if(&quot;image&quot;===g.type){_.extend(g,this.imageSize())}this.$el.html(this.template(g));if(g.uploading){this.$bar=this.$(&quot;.media-progress-bar div&quot;)}else{delete this.$bar}if(this.selected()){this.select()}return this},progress:function(){if(this.$bar&amp;&amp;this.$bar.l
 ength){this.$bar.width(this.model.get(&quot;percent&quot;)+&quot;%&quot;)}},toggleSelection:function(g){this.controller.state().toggleSelection(this.model)},selected:function(){var g=this.controller.state().get(&quot;selection&quot;);if(g){return g.has(this.model)}},select:function(g,i){var h=this.controller.state().get(&quot;selection&quot;);if(!h||(i&amp;&amp;i!==h)){return}this.$el.addClass(&quot;selected&quot;)},deselect:function(g,i){var h=this.controller.state().get(&quot;selection&quot;);if(!h||(i&amp;&amp;i!==h)){return}this.$el.removeClass(&quot;selected&quot;)},details:function(g,j){var i=this.controller.state().get(&quot;selection&quot;),h;if(i!==j){return}h=i.single();this.$el.toggleClass(&quot;details&quot;,h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get(&quot;sizes&quot;);g=g||&quot;medium&quot;;if(h&amp;&amp;h[g]){return _.clone(h[g])}else{return{url:this.model.get(&quot;url&quot;),width:this.model.get
 (&quot;width&quot;),height:this.model.get(&quot;height&quot;),orientation:this.model.get(&quot;orientation&quot;)}}},updateSetting:function(h){var g=e(h.target).closest(&quot;[data-setting]&quot;);if(!g.length){return}this.model.save(g.data(&quot;setting&quot;),h.target.value)}});f.view.Attachment.Library=f.view.Attachment.extend({className:&quot;attachment library&quot;});f.view.Attachment.Gallery=f.view.Attachment.extend({buttons:{close:true},events:(function(){var g=_.clone(f.view.Attachment.prototype.events);g[&quot;click .close&quot;]=&quot;removeFromGallery&quot;;return g}()),removeFromGallery:function(g){g.stopPropagation();this.controller.state().get(&quot;library&quot;).remove(this.model)}});f.view.Attachments=Backbone.View.extend({tagName:&quot;ul&quot;,className:&quot;attachments&quot;,template:f.template(&quot;attachments-css&quot;),events:{scroll:&quot;scroll&quot;},initialize:function(){this.controller=this.options.controller;this.el.id=_.uniqueId(&quot;__attac
 hments-view-&quot;);_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false});_.each([&quot;add&quot;,&quot;remove&quot;],function(g){this.collection.on(g,function(j,h,i){this[g](j,i.index)},this)},this);this.collection.on(&quot;reset&quot;,this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();_.bindAll(this,&quot;css&quot;);this.model.on(&quot;change:edge change:gutter&quot;,this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);e(window).on(&quot;resize.attachments&quot;,this._resizeCss);this.css()},destroy:function(){this.collection.off(&quot;add remove reset&quot;,null,this);this.model.off(&quot;change:edge change:gutter&quot;,this.css,this);e(window).off(&quot;resize.attachments&quot;,this._resizeCss);this.remove()},css:function(){var g=e(&quot;#&quot;+this.el.id+&quot;-css&quot;);if(g.length){g.remove
 ()}f.view.Attachments.$head().append(this.template({id:this.el.id,edge:this.edge(),gutter:this.model.get(&quot;gutter&quot;)}))},edge:function(){var i=this.model.get(&quot;edge&quot;),j,h,g;if(!this.$el.is(&quot;:visible&quot;)){return i}j=this.model.get(&quot;gutter&quot;)*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection,h;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable({disabled:!!g.comparator,containment:this.$el,tolerance:&quot;pointer&quot;,start:function(i,j){h=j.item.index()},update:function(j,k){var i=g.at(h);g.remove(i,{silent:true}).add(i,{at:k.item.index(),silent:true})}});g.props.on(&quot;change:orderby&quot;,function(){this.$el.sortable(&quot;option&quot;,&quot;disabled&quot;,!!g.comparator)},this)},render:function(){if(!this.collection.length){this.collection.more().done(this.scroll);this.$el.empty();return this}this.$el.html(this.collection.map(function(g){return n
 ew this.options.AttachmentView({controller:this.controller,model:g}).render().$el},this));this.scroll();return this},add:function(j,h){var g,i;g=new this.options.AttachmentView({controller:this.controller,model:j}).render();i=this.$el.children();if(i.length&gt;h){i.eq(h).before(g.$el)}else{this.$el.append(g.$el)}},remove:function(i,g){var h=this.$el.children();if(h.length){h.eq(g).detach()}},scroll:function(g){if(!this.$el.is(&quot;:visible&quot;)){return}if(this.el.scrollHeight&lt;this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e(&quot;head&quot;)}}())});f.view.Search=Backbone.View.extend({tagName:&quot;input&quot;,className:&quot;search&quot;,attributes:{type:&quot;search&quot;,placeholder:b.search},events:{keyup:&quot;search&quot;,change:&quot;search&quot;,search:&quot;search&quot;},render:function(){this.el.value=this.model.escape(&quot;search&quot;)
 ;return this},search:function(g){if(g.target.value){this.model.set(&quot;search&quot;,g.target.value)}else{this.model.unset(&quot;search&quot;)}}});f.view.AttachmentsBrowser=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;attachments-browser&quot;,initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{search:true,upload:false,total:true,AttachmentView:f.view.Attachment.Library});this.toolbar=new f.view.Toolbar({controller:this.controller});if(this.options.search){this.toolbar.add(&quot;search&quot;,new f.view.Search({controller:this.controller,model:this.collection.props,priority:-60}).render())}if(this.options.sortable){this.toolbar.add(&quot;dragInfo&quot;,new Backbone.View({el:e('&lt;div class=&quot;instructions&quot;&gt;'+b.dragInfo+&quot;&lt;/div&gt;&quot;)[0],priority:-40}))}this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,model:this.model,sortable:this.options.sortable,Attachme
 ntView:this.options.AttachmentView})},destroy:function(){this.remove();this.toolbar.destroy();this.attachments.destroy()},render:function(){this.toolbar.$el.detach();this.attachments.$el.detach();this.$el.html([this.toolbar.render().el,this.attachments.render().el]);return this}});f.view.SelectionPreview=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;selection-preview&quot;,template:f.template(&quot;media-selection-preview&quot;),events:{&quot;click .clear-selection&quot;:&quot;clear&quot;},initialize:function(){_.defaults(this.options,{clearable:true});this.controller=this.options.controller;this.collection.on(&quot;add change:url remove&quot;,this.render,this);this.render()},render:function(){var g=_.clone(this.options),j,i,h;if(!this.collection.length){this.$el.empty();return this}g.count=this.collection.length;j=this.collection.last();i=j.get(&quot;sizes&quot;);if(&quot;image&quot;===j.get(&quot;type&quot;)){g.thumbnail=(i&amp;&amp;i.thumbnail)?i.thumbnail
 .url:j.get(&quot;url&quot;)}else{g.thumbnail=j.get(&quot;icon&quot;)}this.$el.html(this.template(g));return this},clear:function(g){g.preventDefault();this.collection.clear()}});f.view.Selection=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-selection&quot;,template:f.template(&quot;media-selection&quot;),events:{&quot;click .clear-selection&quot;:&quot;clear&quot;},initialize:function(){_.defaults(this.options,{clearable:true});this.controller=this.options.controller;this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,sortable:true,model:new Backbone.Model({edge:40,gutter:5}),AttachmentView:f.view.Attachment.Selection});this.collection.on(&quot;add remove reset&quot;,this.refresh,this)},destroy:function(){this.remove();this.collection.off(&quot;add remove reset&quot;,this.refresh,this);this.attachments.destroy()},render:function(){this.attachments.$el.detach();this.attachments.render();this.$el.html(this.templa
 te(this.options));this.$(&quot;.selection-view&quot;).replaceWith(this.attachments.$el);this.refresh();return this},refresh:function(){if(!this.$el.children().length){return}this.$el.toggleClass(&quot;empty&quot;,!this.collection.length);this.$(&quot;.count&quot;).text(this.collection.length+&quot; &quot;+b.selected)},clear:function(g){g.preventDefault();this.collection.clear()}});f.view.Attachment.Selection=f.view.Attachment.extend({toggleSelection:function(){this.controller.state().get(&quot;selection&quot;).single(this.model)}});f.view.Settings=Backbone.View.extend({events:{&quot;click button&quot;:&quot;updateHandler&quot;,&quot;change input&quot;:&quot;updateHandler&quot;,&quot;change select&quot;:&quot;updateHandler&quot;,&quot;change textarea&quot;:&quot;updateHandler&quot;},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on(&quot;change&quot;,this.updateChanges,this)},destroy:function(){this.model.off(null,null,this)},render:function(){th
 is.$el.html(this.template(_.defaults({model:this.model.toJSON()},this.options)));_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(i){var j=this.model.get(i),h=this.$('[data-setting=&quot;'+i+'&quot;]'),g;if(!h.length){return}if(h.is(&quot;select&quot;)){h.find('[value=&quot;'+j+'&quot;]').attr(&quot;selected&quot;,true)}else{if(h.hasClass(&quot;button-group&quot;)){g=h.find(&quot;button&quot;).removeClass(&quot;active&quot;);g.filter('[value=&quot;'+j+'&quot;]').addClass(&quot;active&quot;)}}},updateHandler:function(i){var h=e(i.target).closest(&quot;[data-setting]&quot;),j=i.target.value,g;i.preventDefault();if(!h.length){return}this.model.set(h.data(&quot;setting&quot;),j);if(g=h.data(&quot;userSetting&quot;)){setUserSetting(g,j)}},updateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:&quot;attachment-display-settings&quo
 t;,template:f.template(&quot;attachment-display-settings&quot;),initialize:function(){_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on(&quot;change:link&quot;,this.updateCustomLink,this)},render:function(){f.view.Settings.prototype.render.call(this);this.updateCustomLink();return this},updateCustomLink:function(){var g=&quot;custom&quot;===this.model.get(&quot;link&quot;),h=this.$(&quot;.link-to-custom&quot;);if(!g){h.hide();return}h.show();if(!this.model.get(&quot;linkUrl&quot;)){h.val(&quot;http://&quot;)}if(h.is(&quot;:visible&quot;)){h.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:&quot;gallery-settings&quot;,template:f.template(&quot;gallery-settings&quot;)});f.view.Attachment.Details=f.view.Attachment.extend({tagName:&quot;div&quot;,className:&quot;attachment-details&quot;,template:f.template(&quot;attachment-details&quot;),events:{&quot;change [data-setting]&quot;
 :&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;}});f.view.Iframe=Backbone.View.extend({className:&quot;media-iframe&quot;,initialize:function(){this.controller=this.options.controller},render:function(){this.$el.html('&lt;iframe src=&quot;'+this.controller.state().get(&quot;src&quot;)+'&quot; /&gt;');return this}})}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(e){var f=wp.media,d=f.model.Attachment,c=f.model.Attachments,a=f.model.Query,b;b=f.view.l10n=_.isUndefined(_wpMediaViewsL10n)?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:&quot;webkitTransitionEnd&quot;,MozTransition:&quot;transitionend&quot;,OTransition:&quot;oTransitionEnd otransitionend&quot;,transition:&quot;transitionend&quot;},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&amp;&amp;{end:h[i]}}());f.transition=function(g){var h=e.Deferred();if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,h.resolve)}else{h.resolve()}return h.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},&quot;id&quot;,&quot;controller&quot;));this.on(&quot;activate:empty&quot;,this.empty,this);this.mode(&quot;empty&quot;)};f.controller.Region.extend=Backbone.Model.extend;_.exte
 nd(f.controller.Region.prototype,Backbone.Events,{trigger:(function(){var g=/\s+/,h=Backbone.Events.trigger;return function(i){var j=&quot;:&quot;+this._mode,k=i.split(g).join(j)+j;h.apply(this,arguments);h.apply(this,[k].concat(_.rest(arguments)));return this}}()),mode:function(g){if(g){this.trigger(&quot;deactivate&quot;,this);this._mode=g;return this.trigger(&quot;activate&quot;,this)}return this._mode},view:function(g){var h=this._view,i=this._mode,j=this.id;if(!g){return h}if(g===h){return}if(j){g.$el.addClass(&quot;region-&quot;+j)}if(i){g.$el.addClass(&quot;mode-&quot;+i)}if(h){h.$el.replaceWith(g.$el);if(h.destroy){h.destroy()}h.undelegateEvents()}this._view=g},empty:function(){this.view(new Backbone.View())}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,Backbone.Events,{get:function(g){this.states=this.states||new Backbone.Collection(
 );if(!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},state:function(h){var g;if(!h){return this._state?this.get(this._state):null}g=this.state();if((g&amp;&amp;h===g.id)||!this.states||!this.states.get(h)){return}if(g){g.trigger(&quot;deactivate&quot;);this._previous=g.id}this._state=h;this.state().trigger(&quot;activate&quot;)},previous:function(){return this._previous}});_.each([&quot;on&quot;,&quot;off&quot;,&quot;trigger&quot;],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({initialize:function(){this.on(&quot;activate&quot;,this._activate,this);this.on(&quot;activate&quot;,this.activate,this);this.on(&quot;deactivate&quot;,this._deactivate,this);this.on(&quot;deactivate&quot;,this.deactivate,this);this.on(&quot;reset&quot;,this.reset,this)},activate:function(){},_activate:function(){
 this.active=true;this.menu();this.toolbar();this.sidebar();this.content()},deactivate:function(){},_deactivate:function(){this.active=false},reset:function(){},menu:function(){var i=this.frame.menu,h=this.get(&quot;menu&quot;),g;if(!h){return}if(i.mode()!==h){i.mode(h)}g=i.view();if(g.select){g.select(this.id)}}});_.each([&quot;toolbar&quot;,&quot;sidebar&quot;,&quot;content&quot;],function(g){f.controller.State.prototype[g]=function(){var h=this.get(g);if(h){this.frame[g].mode(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:&quot;library&quot;,multiple:false,describe:false,toolbar:&quot;main-attachments&quot;,sidebar:&quot;settings&quot;,searchable:true},initialize:function(){if(!this.get(&quot;selection&quot;)){this.set(&quot;selection&quot;,new f.model.Selection(null,{multiple:this.get(&quot;multiple&quot;)}))}if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query())}if(!this.get(&quot;edge&quot;)){this.set(&quot;edge&quot;,120)}if(!th
 is.get(&quot;gutter&quot;)){this.set(&quot;gutter&quot;,8)}if(!this.get(&quot;details&quot;)){this.set(&quot;details&quot;,[])}f.controller.State.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get(&quot;selection&quot;);this._excludeStateLibrary();this.buildComposite();this.on(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.on(&quot;change:excludeState&quot;,this._excludeState,this);if(this.get(&quot;multiple&quot;)){wp.Uploader.queue.on(&quot;add&quot;,this.selectUpload,this)}g.on(&quot;selection:single selection:unsingle&quot;,this.sidebar,this);g.on(&quot;add remove reset&quot;,this.refreshSelection,this);this._updateEmpty();this.get(&quot;library&quot;).on(&quot;add remove reset&quot;,this._updateEmpty,this);this.on(&quot;change:empty&quot;,this.refresh,this);this.refresh()},deactivate:function(){this.off(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.off(&quot;change:excludeState&quot;,this._
 excludeState,this);this.destroyComposite();wp.Uploader.queue.off(&quot;add&quot;,this.selectUpload,this);this.get(&quot;selection&quot;).off(null,null,this);this.get(&quot;library&quot;).off(&quot;add remove reset&quot;,this._updateEmpty,this);this.off(&quot;change:empty&quot;,this.refresh,this)},reset:function(){this.get(&quot;selection&quot;).clear()},sidebar:function(){var g=this.frame.sidebar;if(this.get(&quot;selection&quot;).single()){g.mode(this.get(&quot;sidebar&quot;))}else{g.mode(&quot;clear&quot;)}},content:function(){var g=this.frame;if(this.get(&quot;empty&quot;)){this.get(&quot;library&quot;).more();g.content.mode(&quot;upload&quot;)}else{g.content.mode(&quot;browse&quot;)}},refresh:function(){this.frame.$el.toggleClass(&quot;hide-sidebar hide-toolbar&quot;,this.get(&quot;empty&quot;));this.content();this.refreshSelection()},_updateEmpty:function(){var g=this.get(&quot;library&quot;);this.set(&quot;empty&quot;,!g.length&amp;&amp;!g.props.get(&quot;search&quot;)
 )},refreshSelection:function(){this.frame.toolbar.view().refresh();this.trigger(&quot;refresh:selection&quot;,this,this.get(&quot;selection&quot;))},selectUpload:function(g){this.get(&quot;selection&quot;).add(g)},toggleSelection:function(g){var h=this.get(&quot;selection&quot;);if(!g){return}if(h.has(g)){h[h.single()===g?&quot;remove&quot;:&quot;single&quot;](g)}else{h.add(g).single()}return this},buildComposite:function(){var h=this.get(&quot;_library&quot;),g=this.get(&quot;exclude&quot;),i;this.destroyComposite();if(!this.get(&quot;exclude&quot;)){return}if(!h){this.set(&quot;_library&quot;,h=this.get(&quot;library&quot;))}i=new f.model.Composite(null,{props:_.pick(h.props.toJSON(),&quot;order&quot;,&quot;orderby&quot;)});i.validator=function(j){return !!h.getByCid(j.cid)&amp;&amp;!g.getByCid(j.cid)};i.observe(h).observe(g);i.more=_.bind(h.more,h);this.set(&quot;library&quot;,i)},destroyComposite:function(){var h=this.get(&quot;library&quot;),g=this.get(&quot;_library&qu
 ot;);if(!g){return}h.unobserve();this.set(&quot;library&quot;,g);this.unset(&quot;_library&quot;)},_excludeState:function(){var h=this.get(&quot;excludeState&quot;),g=this.previous(&quot;excludeState&quot;);if(g){this.frame.get(g).off(&quot;change:library&quot;,this._excludeStateLibrary,this)}if(h){this.frame.get(h).on(&quot;change:library&quot;,this._excludeStateLibrary,this)}},_excludeStateLibrary:function(){var g=this.get(&quot;excludeState&quot;);if(!g){return}this.set(&quot;exclude&quot;,this.frame.get(g).get(&quot;library&quot;))}});f.controller.Upload=f.controller.Library.extend({defaults:_.defaults({id:&quot;upload&quot;},f.controller.Library.prototype.defaults),initialize:function(){var g=this.get(&quot;library&quot;);if(!g){g=new c();g.props.set({orderby:&quot;date&quot;,order:&quot;ASC&quot;});g.observe(wp.Uploader.queue);this.set(&quot;library&quot;,g)}f.controller.Library.prototype.initialize.apply(this,arguments)}});f.controller.Gallery=f.controller.Library.ext
 end({defaults:{id:&quot;gallery-edit&quot;,multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:&quot;gallery-edit&quot;,sidebar:&quot;settings&quot;},initialize:function(){if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,new f.model.Selection())}if(!this.get(&quot;AttachmentView&quot;)){this.set(&quot;AttachmentView&quot;,f.view.Attachment.Gallery)}f.controller.Library.prototype.initialize.apply(this,arguments)},sidebar:function(){f.controller.Library.prototype.sidebar.apply(this,arguments);this.frame.sidebar.trigger(&quot;gallery-settings&quot;);return this}});f.view.Frame=Backbone.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({controller:this,id:g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});
 this.states.on(&quot;add&quot;,function(g){g.frame=this},this)},render:function(){var g=_.map(this.regions,function(h){return this[h].view().el},this);e(g).detach();this.$el.html(g);return this},reset:function(){this.states.invoke(&quot;trigger&quot;,&quot;reset&quot;);return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:&quot;media-frame&quot;,regions:[&quot;menu&quot;,&quot;content&quot;,&quot;sidebar&quot;,&quot;toolbar&quot;],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:&quot;&quot;,modal:true,uploader:true});if(this.options.modal){this.modal=new f.view.Modal({controller:this,$content:this.$el,title:this.options.title})}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({uploader:{dropzone:this.modal?this.modal.$el:this.$el}})}},render:function(){if(this.modal){this.modal.render()}f.view.Frame.prototype.render.appl
 y(this,arguments);if(this.uploader){this.uploader.render().$el.appendTo(this.$el)}return this},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e(&quot;#post_ID&quot;);if(h.length){k+=&quot;&amp;post_id=&quot;+h.val()}_.each(i,function(m,n){var l=this.get(&quot;iframe:&quot;+n).set(_.defaults({tab:n,src:k+&quot;&amp;tab=&quot;+n,title:m,content:&quot;iframe&quot;,menu:&quot;main&quot;},g))},this);this.content.on(&quot;activate:iframe&quot;,this.iframeContent,this);this.menu.on(&quot;activate:main&quot;,this.iframeMenu,this);this.on(&quot;open&quot;,this.hijackThickbox,this);this.on(&quot;close&quot;,this.restoreThickbox,this)},iframeContent:function(){this.$el.addClass(&quot;hide-toolbar hide-sidebar&quot;);this.content.view(new f.view.Iframe({controller:this}).render())},iframeMenu:function(){var g={};_.each(f.view.settings.tabs,function(h,i){g[&quot;iframe:&quot;+i]={text:this.get(&quot;iframe:&quot;+i).get(&quot;title&quot;),p
 riority:200}},this);this.menu.view().add(g)},hijackThickbox:function(){var g=this;if(!window.tb_remove||this._tb_remove){return}this._tb_remove=window.tb_remove;window.tb_remove=function(){g.close();g.reset();g.state(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each([&quot;open&quot;,&quot;close&quot;,&quot;attach&quot;,&quot;detach&quot;],function(g){f.view.MediaFrame.prototype[g]=function(h){this.trigger(g);if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{state:&quot;upload&quot;,selection:[],library:{},multiple:false});this.createSelection();this.createStates();this.bindHandlers()},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)
 ){this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}},createStates:function(){var h=this.options,g;g={multiple:this.options.multiple,menu:&quot;main&quot;,toolbar:&quot;select&quot;};this.states.add([new f.controller.Library(_.defaults({selection:h.selection,library:f.query(h.library)},g)),new f.controller.Upload(g)])},bindHandlers:function(){this.menu.on(&quot;activate:main&quot;,this.mainMenu,this);this.content.on(&quot;activate:browse&quot;,this.browseContent,this);this.content.on(&quot;activate:upload&quot;,this.uploadContent,this);this.sidebar.on(&quot;activate:clear&quot;,this.clearSidebar,this);this.sidebar.on(&quot;activate:settings&quot;,this.settingsSidebar,this);this.toolbar.on(&quot;activate:select&quot;,this.selectToolbar,this);this.on(&quot;refresh:selection&quot;,this.refreshSelectToolbar,this)},mainMenu:function(g){this.menu.view(new f.view.Menu({controller:this,silent:g&amp;&amp;g.silent,views:{upload:{text:b.uploadFilesTitle,p
 riority:20},library:{text:b.mediaLibraryTitle,priority:40}}}))},browseContent:function(){var g=this.state();this.content.view(new f.view.AttachmentsBrowser({controller:this,collection:g.get(&quot;library&quot;),model:g,sortable:g.get(&quot;sortable&quot;),search:g.get(&quot;searchable&quot;),AttachmentView:g.get(&quot;AttachmentView&quot;)}).render())},uploadContent:function(){this.content.view(new f.view.UploaderInline({controller:this}).render())},clearSidebar:function(){this.sidebar.view(new f.view.Sidebar({controller:this}))},settingsSidebar:function(h){var i=this.state().get(&quot;selection&quot;).single(),g={};g.details=new f.view.Attachment.Details({controller:this,model:i,priority:80}).render();if(i.get(&quot;compat&quot;)){g.compat=new f.view.AttachmentCompat({controller:this,model:i,priority:120}).render()}this.sidebar.view(new f.view.Sidebar({controller:this,silent:h&amp;&amp;h.silent,views:g}))},selectToolbar:function(){this.toolbar.view(new f.view.Toolbar({contr
 oller:this,items:{select:{style:&quot;primary&quot;,text:b.select,priority:80,click:function(){var g=this.controller;g.close();g.state().trigger(&quot;select&quot;);g.reset().state(g.options.state)}}}}))},refreshSelectToolbar:function(){var g=this.state().get(&quot;selection&quot;);if(!g||&quot;select&quot;!==this.toolbar.mode()){return}this.toolbar.view().get(&quot;select&quot;).model.set(&quot;disabled&quot;,!g.length)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{state:&quot;upload&quot;,multiple:true,editing:false});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var j=this.options,g,h,i;g={multiple:this.options.multiple,menu:&quot;main&quot;,displayUserSettings:true};h={multiple:true,menu:&quot;gallery&quot;,toolbar:&quot;gallery-add&quot;,excludeState:&quot;gallery-edit&quot;};i={multiple:true,menu:&quot;batch&quot;,toolbar:&quot;batch-add&
 quot;,excludeState:&quot;batch-edit&quot;};this.states.add([new f.controller.Library(_.defaults({selection:j.selection,library:f.query(j.library)},g)),new f.controller.Upload(g),new f.controller.Gallery({library:j.selection,editing:j.editing,menu:&quot;gallery&quot;}),new f.controller.Library(_.defaults({id:&quot;gallery-library&quot;,library:f.query({type:&quot;image&quot;})},h)),new f.controller.Upload(_.defaults({id:&quot;gallery-upload&quot;},h)),new f.controller.Library({id:&quot;batch-edit&quot;,multiple:false,describe:true,edge:199,sortable:true,searchable:false,menu:&quot;batch&quot;,toolbar:&quot;batch-edit&quot;,sidebar:&quot;attachment-settings&quot;}),new f.controller.Library(_.defaults({id:&quot;batch-library&quot;,library:f.query({type:&quot;image&quot;})},i)),new f.controller.Upload(_.defaults({id:&quot;batch-upload&quot;},i))])},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);var g={menu:{batch:&quot;batchMenu&quo
 t;,gallery:&quot;galleryMenu&quot;},content:{embed:&quot;embedContent&quot;},sidebar:{&quot;attachment-settings&quot;:&quot;attachmentSettingsSidebar&quot;},toolbar:{&quot;main-attachments&quot;:&quot;mainAttachmentsToolbar&quot;,&quot;main-embed&quot;:&quot;mainEmbedToolbar&quot;,&quot;batch-edit&quot;:&quot;batchEditToolbar&quot;,&quot;batch-add&quot;:&quot;batchAddToolbar&quot;,&quot;gallery-edit&quot;:&quot;galleryEditToolbar&quot;,&quot;gallery-add&quot;:&quot;galleryAddToolbar&quot;}};_.each(g,function(i,h){_.each(i,function(k,j){this[h].on(&quot;activate:&quot;+j,this[k],this)},this)},this);_.each([&quot;library&quot;,&quot;upload&quot;],function(h){this.get(h).on(&quot;refresh:selection&quot;,function(k,i){var j=this.sidebar;if(!i.length){j.mode(&quot;clear&quot;)}else{if(i.length===1){j.mode(&quot;attachment-settings&quot;)}else{j.mode(&quot;settings&quot;)}}},this)},this);this.sidebar.on(&quot;gallery-settings&quot;,this.onSidebarGallerySettings,this)},mainMenu:fun
 ction(){f.view.MediaFrame.Select.prototype.mainMenu.call(this,{silent:true});this.menu.view().add({separateLibrary:new Backbone.View({className:&quot;separator&quot;,priority:60}),embed:{text:b.embedFromUrlTitle,priority:80}})},batchMenu:function(){var g=this.previous(),h=this;this.menu.view(new f.view.Menu({controller:this,views:{cancel:{text:b.cancelBatchTitle,priority:20,click:function(){if(g){h.state(g)}else{h.close()}}},separateCancel:new Backbone.View({className:&quot;separator&quot;,priority:40}),&quot;batch-edit&quot;:{text:b.editBatchTitle,priority:60},&quot;batch-upload&quot;:{text:b.uploadFilesTitle,priority:80},&quot;batch-library&quot;:{text:b.mediaLibraryTitle,priority:100}}}))},galleryMenu:function(){var g=this.previous(),h=this;this.menu.view(new f.view.Menu({controller:this,views:{cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(g){h.state(g)}else{h.close()}}},separateCancel:new Backbone.View({className:&quot;separator&quot;,priority:40}),&q
 uot;gallery-edit&quot;:{text:b.editGalleryTitle,priority:60},&quot;gallery-upload&quot;:{text:b.uploadImagesTitle,priority:80},&quot;gallery-library&quot;:{text:b.mediaLibraryTitle,priority:100}}}))},embedContent:function(){},onSidebarGallerySettings:function(h){var g=this.state().get(&quot;library&quot;);g.gallery=g.gallery||new Backbone.Model();this.sidebar.view().add({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40}).render()},h)},attachmentSettingsSidebar:function(g){var h=this.state(),i=h.get(&quot;details&quot;),j=h.get(&quot;selection&quot;).single();this.settingsSidebar({silent:true});i[j.cid]=i[j.cid]||new Backbone.Model({align:getUserSetting(&quot;align&quot;,&quot;none&quot;),size:getUserSetting(&quot;imgsize&quot;,&quot;medium&quot;),link:getUserSetting(&quot;urlbutton&quot;,&quot;post&quot;)});this.sidebar.view().add({display:new f.view.Settings.AttachmentDisplay({controller:this,model:i[j.cid],sizes:j.get(&quot;sizes&quot;),prio
 rity:160,userSettings:h.get(&quot;displayUserSettings&quot;)}).render()},g)},mainAttachmentsToolbar:function(){this.toolbar.view(new f.view.Toolbar.Insert.Post({controller:this}))},mainEmbedToolbar:function(){},batchEditToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.insertIntoPost,priority:80,click:function(){var g=this.controller,h=g.state();g.close();h.trigger(&quot;insert&quot;,h.get(&quot;library&quot;));g.reset();g.state(&quot;upload&quot;)}}}}))},batchAddToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.addToBatch,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.get(&quot;batch-edit&quot;);h.get(&quot;library&quot;).add(i.get(&quot;selection&quot;).models);i.trigger(&quot;reset&quot;);g.state(&quot;batch-edit&quot;)}}}}))},galleryEditToolbar:function(){var g=this.state().get(&quot;editing&quot;);this.toolbar.
 view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:g?b.updateGallery:b.insertGallery,priority:80,click:function(){var h=this.controller,i=h.state();h.close();i.trigger(&quot;update&quot;,i.get(&quot;library&quot;));h.reset();h.state(&quot;upload&quot;)}}}}))},galleryAddToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.addToGallery,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.get(&quot;gallery-edit&quot;);h.get(&quot;library&quot;).add(i.get(&quot;selection&quot;).models);i.trigger(&quot;reset&quot;);g.state(&quot;gallery-edit&quot;)}}}}))}});f.view.Modal=Backbone.View.extend({tagName:&quot;div&quot;,template:f.template(&quot;media-modal&quot;),events:{&quot;click .media-modal-backdrop, .media-modal-close&quot;:&quot;closeHandler&quot;},initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{container:document.body,tit
 le:&quot;&quot;})},render:function(){this.options.$content=this.options.$content||e(&quot;&lt;div /&gt;&quot;);this.options.$content.detach();this.$el.html(this.template({title:this.options.title}));this.options.$content.addClass(&quot;media-modal-content&quot;);this.$(&quot;.media-modal&quot;).append(this.options.$content);return this},attach:function(){this.$el.appendTo(this.options.container);this.controller.trigger(&quot;attach&quot;,this.controller);return this},detach:function(){this.$el.detach();this.controller.trigger(&quot;detach&quot;,this.controller);return this},open:function(){this.$el.show();this.controller.trigger(&quot;open&quot;,this.controller);return this},close:function(){this.$el.hide();this.controller.trigger(&quot;close&quot;,this.controller);return this},closeHandler:function(g){g.preventDefault();this.close()},content:function(g){if(this.options.$content){this.options.$content.detach()}this.options.$content=(g instanceof Backbone.View)?g.$el:g;return
  this.render()}});f.view.UploaderWindow=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-window&quot;,template:f.template(&quot;uploader-window&quot;),initialize:function(){var g;this.controller=this.options.controller;this.$browser=e('&lt;a href=&quot;#&quot; class=&quot;browser&quot; /&gt;').hide().appendTo(&quot;body&quot;);g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone){if(!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}g.dropzone.one(&quot;mouseenter dragenter&quot;,_.bind(this.maybeInitUploader,this))}},render:function(){this.maybeInitUploader();this.$el.html(this.template(this.options));return this},refresh:function(){if(this.uploader){this.uploader.refresh()}},maybeInitUploader:function(){var h,g;if(this.uploader||!this.$el.closest(&quot;body&quot;).length){return}h=e(&quot;#post_ID&quot;);if(h.length){this.options.uploader.params.post_id=h.val()}this.uploader=
 new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on(&quot;dropzone:enter&quot;,_.bind(this.show,this));g.on(&quot;dropzone:leave&quot;,_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if(&quot;0&quot;===g.css(&quot;opacity&quot;)){g.hide()}})}});f.view.UploaderInline=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-inline&quot;,template:f.template(&quot;uploader-inline&quot;),initialize:function(){this.controller=this.options.controller;if(!this.options.$browser){this.options.$browser=this.controller.uploader.$browser}wp.Uploader.queue.on(&quot;add remove reset change:percent&quot;,this.renderUploadProgress,this)},destroy:function(){wp.Uploader.queue.off(&quot;add remove reset change:percent&quot;,this.renderUploadProgress,this);this.remove()},render:function(){var g=this.options.$browser,h;this.renderUp
 loadProgress();this.$el.html(this.template(this.options));h=this.$(&quot;.browser&quot;);g.text(h.text());g[0].className=h[0].className;h.replaceWith(g.show());this.$bar=this.$(&quot;.media-progress-bar div&quot;);return this},renderUploadProgress:function(){var g=wp.Uploader.queue;this.$el.toggleClass(&quot;uploading&quot;,!!g.length);if(!this.$bar||!g.length){return}this.$bar.width((g.reduce(function(h,i){if(i.get(&quot;uploading&quot;)){return h+(i.get(&quot;percent&quot;)||0)}else{return h+100}},0)/g.length)+&quot;%&quot;)}});f.view.Toolbar=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-toolbar&quot;,initialize:function(){this.controller=this.options.controller;this._views={};this.$primary=e('&lt;div class=&quot;media-toolbar-primary&quot; /&gt;').prependTo(this.$el);this.$secondary=e('&lt;div class=&quot;media-toolbar-secondary&quot; /&gt;').prependTo(this.$el);if(this.options.items){this.add(this.options.items,{silent:true})}if(!this.options.silent
 ){this.render()}},destroy:function(){this.remove();_.each(this._views,function(g){if(g.destroy){g.destroy()}})},render:function(){var g=_.chain(this._views).sortBy(function(h){return h.options.priority||10}).groupBy(function(h){return(h.options.priority||10)&gt;0?&quot;primary&quot;:&quot;secondary&quot;}).value();e(_.pluck(this._views,&quot;el&quot;)).detach();this.$primary.html(_.pluck(g.primary||[],&quot;el&quot;));this.$secondary.html(_.pluck(g.secondary||[],&quot;el&quot;));this.refresh();return this},add:function(i,g,h){h=h||{};if(_.isObject(i)){_.each(i,function(j,k){this.add(k,j,{silent:true})},this);if(!h.silent){this.render()}return this}if(!(g instanceof Backbone.View)){g.classes=[i].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[i]=g;if(!h.silent){this.render()}return this},get:function(g){return this._views[g]},remove:function(h,g){delete this._views[h];if(!g||!g.silent){this.render()}return this},ref
 resh:function(){}});f.view.Toolbar.Insert=f.view.Toolbar.extend({initialize:function(){var g=this.options.controller,h=g.state().get(&quot;selection&quot;);this.options.items=_.defaults(this.options.items||{},{selection:new f.view.Selection({controller:g,collection:h,priority:-40}).render(),insert:{style:&quot;primary&quot;,priority:80,text:b.insertIntoPost,click:function(){g.close();g.state().trigger(&quot;insert&quot;,h);h.clear()}}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().get(&quot;selection&quot;);this.get(&quot;insert&quot;).model.set(&quot;disabled&quot;,!g.length)}});f.view.Toolbar.Insert.Post=f.view.Toolbar.Insert.extend({initialize:function(){var g=function(i,h){return function(){var j=this.controller,k=j.state().get(&quot;selection&quot;),l=j.get(i),m=h?h(k):k.models;l.set(&quot;library&quot;,new f.model.Selection(m,{props:k.props.toJSON(),multiple:true}));this.controller.state(i)}};this.options.i
 tems=_.defaults(this.options.items||{},{gallery:{text:b.createNewGallery,priority:40,click:g(&quot;gallery-edit&quot;,function(h){return h.where({type:&quot;image&quot;})})},batch:{text:b.batchInsert,priority:60,click:g(&quot;batch-edit&quot;)}});f.view.Toolbar.Insert.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().get(&quot;selection&quot;),h=g.length;f.view.Toolbar.Insert.prototype.refresh.apply(this,arguments);this.get(&quot;gallery&quot;).$el.toggle(h&gt;1&amp;&amp;g.any(function(i){return&quot;image&quot;===i.get(&quot;type&quot;)}));this.get(&quot;batch&quot;).$el.toggle(h&gt;1);this.get(&quot;insert&quot;).$el.toggle(h&lt;=1)}});f.view.Button=Backbone.View.extend({tagName:&quot;a&quot;,className:&quot;media-button&quot;,attributes:{href:&quot;#&quot;},events:{click:&quot;click&quot;},defaults:{text:&quot;&quot;,style:&quot;&quot;,size:&quot;large&quot;,disabled:false},initialize:function(){this.model=new Backbone.Model(this
 .defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);if(this.options.dropdown){this.options.dropdown.addClass(&quot;dropdown&quot;)}this.model.on(&quot;change&quot;,this.render,this)},render:function(){var h=[&quot;button&quot;,this.className],g=this.model.toJSON();if(g.style){h.push(&quot;button-&quot;+g.style)}if(g.size){h.push(&quot;button-&quot;+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(&quot; &quot;);this.$el.attr(&quot;disabled&quot;,g.disabled);if(this.options.dropdown){this.options.dropdown.detach()}this.$el.text(this.model.get(&quot;text&quot;));if(this.options.dropdown){this.$el.append(this.options.dropdown)}return this},click:function(g){if(&quot;#&quot;===this.attributes.href){g.preventDefault()}if(this.options.click&amp;&amp;!this.model.get(&quot;disabled&quot;)){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=Backbone.View
 .extend({tagName:&quot;div&quot;,className:&quot;button-group button-large media-button-group&quot;,initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,&quot;el&quot;)).detach());return this}});f.view.PriorityList=Backbone.View.extend({tagName:&quot;div&quot;,initialize:function(){this.controller=this.options.controller;this._views={};this.add(_.extend({},this.views,this.options.views),{silent:true});delete this.views;delete this.options.views;if(!this.options.silent){this.render()}},destroy:function(){this.remove();_.each(this._views,function(g){if(g.destroy){g.destroy()}})},render:function(){var g=_(this._views).chain().sortBy(function(h){return h.options.priority||10}).pluck(&quot;el&quot;).value();e(g).detach();thi
 s.$el.html(g);return this},add:function(i,g,h){h=h||{};if(_.isObject(i)){_.each(i,function(j,k){this.add(k,j,{silent:true})},this);if(!h.silent){this.render()}return this}if(!(g instanceof Backbone.View)){g=this.toView(g,i,h)}g.controller=g.controller||this.controller;this._views[i]=g;if(!h.silent){this.render()}return this},get:function(g){return this._views[g]},remove:function(h,g){delete this._views[h];if(!g||!g.silent){this.render()}return this},toView:function(g){return new Backbone.View(g)}});f.view.Menu=f.view.PriorityList.extend({tagName:&quot;ul&quot;,className:&quot;media-menu&quot;,toView:function(g,h){g=g||{};g.id=g.id||h;return new f.view.MenuItem(g).render()},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass(&quot;active&quot;)},deselect:function(){this.$el.children().removeClass(&quot;active&quot;)}});f.view.MenuItem=Backbone.View.extend({tagName:&quot;li&quot;,className:&quot;media-menu-item&quot;,events:{click:&quot;click&quot
 ;},click:function(){var g=this.options;if(g.click){g.click.call(this)}else{if(g.id){this.controller.state(g.id)}}},render:function(){var g=this.options;if(g.text){this.$el.text(g.text)}else{if(g.html){this.$el.html(g.html)}}return this}});f.view.Sidebar=f.view.PriorityList.extend({className:&quot;media-sidebar&quot;});f.view.Attachment=Backbone.View.extend({tagName:&quot;li&quot;,className:&quot;attachment&quot;,template:f.template(&quot;attachment&quot;),events:{&quot;mousedown .attachment-preview&quot;:&quot;toggleSelection&quot;,&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;},buttons:{},initialize:function(){this.controller=this.options.controller;this.model.on(&quot;change:sizes change:uploading change:caption change:title&quot;,this.render,this);this.model.on
 (&quot;change:percent&quot;,this.progress,this);this.model.on(&quot;add&quot;,this.select,this);this.model.on(&quot;remove&quot;,this.deselect,this);this.model.on(&quot;selection:single selection:unsingle&quot;,this.details,this);this.details(this.model,this.controller.state().get(&quot;selection&quot;));this.$el.on(&quot;click&quot;,&quot;a&quot;,this.preventDefault)},destroy:function(){this.model.off(null,null,this);this.$el.off(&quot;click&quot;,&quot;a&quot;,this.preventDefault);this.remove()},render:function(){var h=this.model.toJSON(),g=_.defaults(this.model.toJSON(),{orientation:&quot;landscape&quot;,uploading:false,type:&quot;&quot;,subtype:&quot;&quot;,icon:&quot;&quot;,filename:&quot;&quot;,caption:&quot;&quot;,title:&quot;&quot;,dateFormatted:&quot;&quot;,width:&quot;&quot;,height:&quot;&quot;,compat:false,alt:&quot;&quot;});g.buttons=this.buttons;g.describe=this.controller.state().get(&quot;describe&quot;);if(&quot;image&quot;===g.type){_.extend(g,this.imageSize(
 ))}this.$el.html(this.template(g));this.$el.toggleClass(&quot;uploading&quot;,g.uploading);if(g.uploading){this.$bar=this.$(&quot;.media-progress-bar div&quot;)}else{delete this.$bar}if(this.selected()){this.select()}return this},progress:function(){if(this.$bar&amp;&amp;this.$bar.length){this.$bar.width(this.model.get(&quot;percent&quot;)+&quot;%&quot;)}},toggleSelection:function(g){this.controller.state().toggleSelection(this.model)},selected:function(){var g=this.controller.state().get(&quot;selection&quot;);if(g){return g.has(this.model)}},select:function(g,i){var h=this.controller.state().get(&quot;selection&quot;);if(!h||(i&amp;&amp;i!==h)){return}this.$el.addClass(&quot;selected&quot;)},deselect:function(g,i){var h=this.controller.state().get(&quot;selection&quot;);if(!h||(i&amp;&amp;i!==h)){return}this.$el.removeClass(&quot;selected&quot;)},details:function(g,j){var i=this.controller.state().get(&quot;selection&quot;),h;if(i!==j){return}h=i.single();this.$el.toggleCl
 ass(&quot;details&quot;,h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get(&quot;sizes&quot;);g=g||&quot;medium&quot;;if(h&amp;&amp;h[g]){return _.clone(h[g])}else{return{url:this.model.get(&quot;url&quot;),width:this.model.get(&quot;width&quot;),height:this.model.get(&quot;height&quot;),orientation:this.model.get(&quot;orientation&quot;)}}},updateSetting:function(h){var g=e(h.target).closest(&quot;[data-setting]&quot;);if(!g.length){return}this.model.save(g.data(&quot;setting&quot;),h.target.value)}});f.view.Attachment.Library=f.view.Attachment.extend({className:&quot;attachment library&quot;});f.view.Attachment.Gallery=f.view.Attachment.extend({buttons:{close:true},events:(function(){var g=_.clone(f.view.Attachment.prototype.events);g[&quot;click .close&quot;]=&quot;removeFromGallery&quot;;return g}()),removeFromGallery:function(g){g.stopPropagation();this.controller.state().get(&quot;library&quot;).remove(this.model)
 }});f.view.Attachments=Backbone.View.extend({tagName:&quot;ul&quot;,className:&quot;attachments&quot;,template:f.template(&quot;attachments-css&quot;),events:{scroll:&quot;scroll&quot;},initialize:function(){this.controller=this.options.controller;this.el.id=_.uniqueId(&quot;__attachments-view-&quot;);_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false});_.each([&quot;add&quot;,&quot;remove&quot;],function(g){this.collection.on(g,function(j,h,i){this[g](j,i.index)},this)},this);this.collection.on(&quot;reset&quot;,this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();_.bindAll(this,&quot;css&quot;);this.model.on(&quot;change:edge change:gutter&quot;,this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);e(window).on(&quot;resize.attachments&quot;,this._resizeCss);this.css()},destroy:function(){this.coll
 ection.off(&quot;add remove reset&quot;,null,this);this.model.off(&quot;change:edge change:gutter&quot;,this.css,this);e(window).off(&quot;resize.attachments&quot;,this._resizeCss);this.remove()},css:function(){var g=e(&quot;#&quot;+this.el.id+&quot;-css&quot;);if(g.length){g.remove()}f.view.Attachments.$head().append(this.template({id:this.el.id,edge:this.edge(),gutter:this.model.get(&quot;gutter&quot;)}))},edge:function(){var i=this.model.get(&quot;edge&quot;),j,h,g;if(!this.$el.is(&quot;:visible&quot;)){return i}j=this.model.get(&quot;gutter&quot;)*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection,h;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable({disabled:!!g.comparator,containment:this.$el,tolerance:&quot;pointer&quot;,start:function(i,j){h=j.item.index()},update:function(j,k){var i=g.at(h);g.remove(i,{silent:true}).add(i,{at:k.item.index(),silent:true})}});g.props.on(&quot;c
 hange:orderby&quot;,function(){this.$el.sortable(&quot;option&quot;,&quot;disabled&quot;,!!g.comparator)},this)},render:function(){if(!this.collection.length){this.collection.more().done(this.scroll);this.$el.empty();return this}this.$el.html(this.collection.map(function(g){return new this.options.AttachmentView({controller:this.controller,model:g}).render().$el},this));this.scroll();return this},add:function(j,h){var g,i;g=new this.options.AttachmentView({controller:this.controller,model:j}).render();i=this.$el.children();if(i.length&gt;h){i.eq(h).before(g.$el)}else{this.$el.append(g.$el)}},remove:function(i,g){var h=this.$el.children();if(h.length){h.eq(g).detach()}},scroll:function(g){if(!this.$el.is(&quot;:visible&quot;)){return}if(this.el.scrollHeight&lt;this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e(&quot;head&quot;)}}())});f.view.Search=Backbon
 e.View.extend({tagName:&quot;input&quot;,className:&quot;search&quot;,attributes:{type:&quot;search&quot;,placeholder:b.search},events:{keyup:&quot;search&quot;,change:&quot;search&quot;,search:&quot;search&quot;},render:function(){this.el.value=this.model.escape(&quot;search&quot;);return this},search:function(g){if(g.target.value){this.model.set(&quot;search&quot;,g.target.value)}else{this.model.unset(&quot;search&quot;)}}});f.view.AttachmentsBrowser=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;attachments-browser&quot;,initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{search:true,upload:false,total:true,AttachmentView:f.view.Attachment.Library});this.toolbar=new f.view.Toolbar({controller:this.controller});if(this.options.search){this.toolbar.add(&quot;search&quot;,new f.view.Search({controller:this.controller,model:this.collection.props,priority:-60}).render())}if(this.options.sortable){this.toolbar.add(&quot;dragInfo
 &quot;,new Backbone.View({el:e('&lt;div class=&quot;instructions&quot;&gt;'+b.dragInfo+&quot;&lt;/div&gt;&quot;)[0],priority:-40}))}this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,model:this.model,sortable:this.options.sortable,AttachmentView:this.options.AttachmentView})},destroy:function(){this.remove();this.toolbar.destroy();this.attachments.destroy()},render:function(){this.toolbar.$el.detach();this.attachments.$el.detach();this.$el.html([this.toolbar.render().el,this.attachments.render().el]);return this}});f.view.SelectionPreview=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;selection-preview&quot;,template:f.template(&quot;media-selection-preview&quot;),events:{&quot;click .clear-selection&quot;:&quot;clear&quot;},initialize:function(){_.defaults(this.options,{clearable:true});this.controller=this.options.controller;this.collection.on(&quot;add change:url remove&quot;,this.render,this);this.render()},rende
 r:function(){var g=_.clone(this.options),j,i,h;if(!this.collection.length){this.$el.empty();return this}g.count=this.collection.length;j=this.collection.last();i=j.get(&quot;sizes&quot;);if(&quot;image&quot;===j.get(&quot;type&quot;)){g.thumbnail=(i&amp;&amp;i.thumbnail)?i.thumbnail.url:j.get(&quot;url&quot;)}else{g.thumbnail=j.get(&quot;icon&quot;)}this.$el.html(this.template(g));return this},clear:function(g){g.preventDefault();this.collection.clear()}});f.view.Selection=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-selection&quot;,template:f.template(&quot;media-selection&quot;),events:{&quot;click .clear-selection&quot;:&quot;clear&quot;},initialize:function(){_.defaults(this.options,{clearable:true});this.controller=this.options.controller;this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,sortable:true,model:new Backbone.Model({edge:40,gutter:5}),AttachmentView:f.view.Attachment.Selection});this.collecti
 on.on(&quot;add remove reset&quot;,this.refresh,this)},destroy:function(){this.remove();this.collection.off(&quot;add remove reset&quot;,this.refresh,this);this.attachments.destroy()},render:function(){this.attachments.$el.detach();this.attachments.render();this.$el.html(this.template(this.options));this.$(&quot;.selection-view&quot;).replaceWith(this.attachments.$el);this.refresh();return this},refresh:function(){if(!this.$el.children().length){return}this.$el.toggleClass(&quot;empty&quot;,!this.collection.length);this.$(&quot;.count&quot;).text(this.collection.length+&quot; &quot;+b.selected)},clear:function(g){g.preventDefault();this.collection.clear()}});f.view.Attachment.Selection=f.view.Attachment.extend({toggleSelection:function(){this.controller.state().get(&quot;selection&quot;).single(this.model)}});f.view.Settings=Backbone.View.extend({events:{&quot;click button&quot;:&quot;updateHandler&quot;,&quot;change input&quot;:&quot;updateHandler&quot;,&quot;change select&
 quot;:&quot;updateHandler&quot;,&quot;change textarea&quot;:&quot;updateHandler&quot;},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on(&quot;change&quot;,this.updateChanges,this)},destroy:function(){this.model.off(null,null,this)},render:function(){this.$el.html(this.template(_.defaults({model:this.model.toJSON()},this.options)));_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(i){var j=this.model.get(i),h=this.$('[data-setting=&quot;'+i+'&quot;]'),g;if(!h.length){return}if(h.is(&quot;select&quot;)){h.find('[value=&quot;'+j+'&quot;]').attr(&quot;selected&quot;,true)}else{if(h.hasClass(&quot;button-group&quot;)){g=h.find(&quot;button&quot;).removeClass(&quot;active&quot;);g.filter('[value=&quot;'+j+'&quot;]').addClass(&quot;active&quot;)}}},updateHandler:function(i){var h=e(i.target).closest(&quot;[data-setting]&quot;),j=i.target.value,g;i.preventDefault();if(!h.length){return}this.model.set(h.data(&qu
 ot;setting&quot;),j);if(g=h.data(&quot;userSetting&quot;)){setUserSetting(g,j)}},updateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:&quot;attachment-display-settings&quot;,template:f.template(&quot;attachment-display-settings&quot;),initialize:function(){_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on(&quot;change:link&quot;,this.updateCustomLink,this)},render:function(){f.view.Settings.prototype.render.call(this);this.updateCustomLink();return this},updateCustomLink:function(){var g=&quot;custom&quot;===this.model.get(&quot;link&quot;),h=this.$(&quot;.link-to-custom&quot;);if(!g){h.hide();return}h.show();if(!this.model.get(&quot;linkUrl&quot;)){h.val(&quot;http://&quot;)}if(h.is(&quot;:visible&quot;)){h.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:&quot;ga
 llery-settings&quot;,template:f.template(&quot;gallery-settings&quot;)});f.view.Attachment.Details=f.view.Attachment.extend({tagName:&quot;div&quot;,className:&quot;attachment-details&quot;,template:f.template(&quot;attachment-details&quot;),events:{&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;}});f.view.AttachmentCompat=Backbone.View.extend({tagName:&quot;form&quot;,className:&quot;compat-item&quot;,events:{submit:&quot;preventDefault&quot;,&quot;change input&quot;:&quot;save&quot;,&quot;change select&quot;:&quot;save&quot;,&quot;change textarea&quot;:&quot;save&quot;},initialize:function(){this.model.on(&quot;change:compat&quot;,this.render,this)},destroy:function(){this.model.off(null,null,this)},render:function(){var g=this.model.get(&quot;compat&quot;);if(!g
 ||!g.item){return}this.$el.html(g.item);return this},preventDefault:function(g){g.preventDefault()},save:function(g){var h={};g.preventDefault();_.each(this.$el.serializeArray(),function(i){h[i.name]=i.value});this.model.saveCompat(h)}});f.view.Iframe=Backbone.View.extend({className:&quot;media-iframe&quot;,initialize:function(){this.controller=this.options.controller},render:function(){this.$el.html('&lt;iframe src=&quot;'+this.controller.state().get(&quot;src&quot;)+'&quot; /&gt;');return this}})}(jQuery));
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjspluploadwppluploadminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/wp-plupload.min.js (22545 => 22546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/wp-plupload.min.js        2012-11-11 21:51:27 UTC (rev 22545)
+++ trunk/wp-includes/js/plupload/wp-plupload.min.js        2012-11-11 22:58:32 UTC (rev 22546)
</span><span class="lines">@@ -1 +1 @@
</span><del>-window.wp=window.wp||{};(function(a,b){var c;if(typeof _wpPluploadSettings===&quot;undefined&quot;){return}c=function(f){var d=this,h={container:&quot;container&quot;,browser:&quot;browse_button&quot;,dropzone:&quot;drop_element&quot;},g,e;this.supports={upload:c.browser.supported};this.supported=this.supports.upload;if(!this.supported){return}this.plupload=b.extend(true,{multipart_params:{}},c.defaults);this.container=document.body;b.extend(true,this,f);for(g in this){if(b.isFunction(this[g])){this[g]=b.proxy(this[g],this)}}for(g in h){if(!this[g]){continue}this[g]=b(this[g]).first();if(!this[g].length){delete this[g];continue}if(!this[g].prop(&quot;id&quot;)){this[g].prop(&quot;id&quot;,&quot;__wp-uploader-id-&quot;+c.uuid++)}this.plupload[h[g]]=this[g].prop(&quot;id&quot;)}if(!(this.browser&amp;&amp;this.browser.length)&amp;&amp;!(this.dropzone&amp;&amp;this.dropzone.length)){return}this.uploader=new plupload.Uploader(this.plupload);delete this.plupload;this.p
 aram(this.params||{});delete this.params;e=function(j,k,i){if(i.attachment){i.attachment.destroy()}d.error(j,k,i)};this.uploader.init();this.supports.dragdrop=this.uploader.features.dragdrop&amp;&amp;!c.browser.mobile;(function(j,i){var l,k;if(!j){return}j.toggleClass(&quot;supports-drag-drop&quot;,!!i);if(!i){return j.unbind(&quot;.wp-uploader&quot;)}j.bind(&quot;dragover.wp-uploader&quot;,function(){if(l){clearTimeout(l)}if(k){return}j.trigger(&quot;dropzone:enter&quot;).addClass(&quot;drag-over&quot;);k=true});j.bind(&quot;dragleave.wp-uploader, drop.wp-uploader&quot;,function(){l=setTimeout(function(){k=false;j.trigger(&quot;dropzone:leave&quot;).removeClass(&quot;drag-over&quot;)},0)})}(this.dropzone,this.supports.dragdrop));if(this.browser){this.browser.on(&quot;mouseenter&quot;,this.refresh)}else{this.uploader.disableBrowse(true);b(&quot;#&quot;+this.uploader.id+&quot;_html5_container&quot;).hide()}this.uploader.bind(&quot;FilesAdded&quot;,function(i,j){_.each(j,funct
 ion(l){var k,m;k=_.extend({file:l,uploading:true,date:new Date()},_.pick(l,&quot;loaded&quot;,&quot;size&quot;,&quot;percent&quot;));m=/(?:jpe?g|png|gif)$/i.exec(l.name);if(m){k.type=&quot;image&quot;;k.subtype=(&quot;jpg&quot;===m[0])?&quot;jpeg&quot;:m[0]}l.attachment=wp.media.model.Attachment.create(k);c.queue.add(l.attachment);d.added(l.attachment)});i.refresh();i.start()});this.uploader.bind(&quot;UploadProgress&quot;,function(i,j){j.attachment.set(_.pick(j,&quot;loaded&quot;,&quot;percent&quot;));d.progress(j.attachment)});this.uploader.bind(&quot;FileUploaded&quot;,function(i,l,k){var j;try{k=JSON.parse(k.response)}catch(m){return e(pluploadL10n.default_error,m,l)}if(!_.isObject(k)||_.isUndefined(k.success)){return e(pluploadL10n.default_error,null,l)}else{if(!k.success){return e(k.data.message,k.data,l)}}_.each([&quot;file&quot;,&quot;loaded&quot;,&quot;size&quot;,&quot;uploading&quot;,&quot;percent&quot;],function(n){l.attachment.unset(n)});l.attachment.set(k.data);
 wp.media.model.Attachment.get(k.data.id,l.attachment);j=c.queue.all(function(n){return !n.get(&quot;uploading&quot;)});if(j){c.queue.reset()}d.success(l.attachment)});this.uploader.bind(&quot;Error&quot;,function(i,j){var l=pluploadL10n.default_error,k;for(k in c.errorMap){if(j.code===plupload[k]){l=c.errorMap[k];break}}j(l,j,j.file);i.refresh()});this.init()};b.extend(c,_wpPluploadSettings);c.uuid=0;c.errorMap={FAILED:pluploadL10n.upload_failed,FILE_EXTENSION_ERROR:pluploadL10n.invalid_filetype,IMAGE_FORMAT_ERROR:pluploadL10n.not_an_image,IMAGE_MEMORY_ERROR:pluploadL10n.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:pluploadL10n.image_dimensions_exceeded,GENERIC_ERROR:pluploadL10n.upload_failed,IO_ERROR:pluploadL10n.io_error,HTTP_ERROR:pluploadL10n.http_error,SECURITY_ERROR:pluploadL10n.security_error};b.extend(c.prototype,{param:function(d,e){if(arguments.length===1&amp;&amp;typeof d===&quot;string&quot;){return this.uploader.settings.multipart_params[d]}if(arguments.length&
 gt;1){this.uploader.settings.multipart_params[d]=e}else{b.extend(this.uploader.settings.multipart_params,d)}},init:function(){},error:function(){},success:function(){},added:function(){},progress:function(){},complete:function(){},refresh:function(){this.uploader.refresh()}});c.queue=new wp.media.model.Attachments([],{query:false});a.Uploader=c})(wp,jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+window.wp=window.wp||{};(function(a,b){var c;if(typeof _wpPluploadSettings===&quot;undefined&quot;){return}c=function(f){var d=this,h={container:&quot;container&quot;,browser:&quot;browse_button&quot;,dropzone:&quot;drop_element&quot;},g,e;this.supports={upload:c.browser.supported};this.supported=this.supports.upload;if(!this.supported){return}this.plupload=b.extend(true,{multipart_params:{}},c.defaults);this.container=document.body;b.extend(true,this,f);for(g in this){if(b.isFunction(this[g])){this[g]=b.proxy(this[g],this)}}for(g in h){if(!this[g]){continue}this[g]=b(this[g]).first();if(!this[g].length){delete this[g];continue}if(!this[g].prop(&quot;id&quot;)){this[g].prop(&quot;id&quot;,&quot;__wp-uploader-id-&quot;+c.uuid++)}this.plupload[h[g]]=this[g].prop(&quot;id&quot;)}if(!(this.browser&amp;&amp;this.browser.length)&amp;&amp;!(this.dropzone&amp;&amp;this.dropzone.length)){return}this.uploader=new plupload.Uploader(this.plupload);delete this.plupload;this.p
 aram(this.params||{});delete this.params;e=function(j,k,i){if(i.attachment){i.attachment.destroy()}d.error(j,k,i)};this.uploader.init();this.supports.dragdrop=this.uploader.features.dragdrop&amp;&amp;!c.browser.mobile;(function(j,i){var l,k;if(!j){return}j.toggleClass(&quot;supports-drag-drop&quot;,!!i);if(!i){return j.unbind(&quot;.wp-uploader&quot;)}j.bind(&quot;dragover.wp-uploader&quot;,function(){if(l){clearTimeout(l)}if(k){return}j.trigger(&quot;dropzone:enter&quot;).addClass(&quot;drag-over&quot;);k=true});j.bind(&quot;dragleave.wp-uploader, drop.wp-uploader&quot;,function(){l=setTimeout(function(){k=false;j.trigger(&quot;dropzone:leave&quot;).removeClass(&quot;drag-over&quot;)},0)})}(this.dropzone,this.supports.dragdrop));if(this.browser){this.browser.on(&quot;mouseenter&quot;,this.refresh)}else{this.uploader.disableBrowse(true);b(&quot;#&quot;+this.uploader.id+&quot;_html5_container&quot;).hide()}this.uploader.bind(&quot;FilesAdded&quot;,function(i,j){_.each(j,funct
 ion(l){var k,m;k=_.extend({file:l,uploading:true,date:new Date(),filename:l.name},_.pick(l,&quot;loaded&quot;,&quot;size&quot;,&quot;percent&quot;));m=/(?:jpe?g|png|gif)$/i.exec(l.name);if(m){k.type=&quot;image&quot;;k.subtype=(&quot;jpg&quot;===m[0])?&quot;jpeg&quot;:m[0]}l.attachment=wp.media.model.Attachment.create(k);c.queue.add(l.attachment);d.added(l.attachment)});i.refresh();i.start()});this.uploader.bind(&quot;UploadProgress&quot;,function(i,j){j.attachment.set(_.pick(j,&quot;loaded&quot;,&quot;percent&quot;));d.progress(j.attachment)});this.uploader.bind(&quot;FileUploaded&quot;,function(i,l,k){var j;try{k=JSON.parse(k.response)}catch(m){return e(pluploadL10n.default_error,m,l)}if(!_.isObject(k)||_.isUndefined(k.success)){return e(pluploadL10n.default_error,null,l)}else{if(!k.success){return e(k.data.message,k.data,l)}}_.each([&quot;file&quot;,&quot;loaded&quot;,&quot;size&quot;,&quot;uploading&quot;,&quot;percent&quot;],function(n){l.attachment.unset(n)});l.attachm
 ent.set(k.data);wp.media.model.Attachment.get(k.data.id,l.attachment);j=c.queue.all(function(n){return !n.get(&quot;uploading&quot;)});if(j){c.queue.reset()}d.success(l.attachment)});this.uploader.bind(&quot;Error&quot;,function(i,j){var l=pluploadL10n.default_error,k;for(k in c.errorMap){if(j.code===plupload[k]){l=c.errorMap[k];break}}j(l,j,j.file);i.refresh()});this.init()};b.extend(c,_wpPluploadSettings);c.uuid=0;c.errorMap={FAILED:pluploadL10n.upload_failed,FILE_EXTENSION_ERROR:pluploadL10n.invalid_filetype,IMAGE_FORMAT_ERROR:pluploadL10n.not_an_image,IMAGE_MEMORY_ERROR:pluploadL10n.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:pluploadL10n.image_dimensions_exceeded,GENERIC_ERROR:pluploadL10n.upload_failed,IO_ERROR:pluploadL10n.io_error,HTTP_ERROR:pluploadL10n.http_error,SECURITY_ERROR:pluploadL10n.security_error};b.extend(c.prototype,{param:function(d,e){if(arguments.length===1&amp;&amp;typeof d===&quot;string&quot;){return this.uploader.settings.multipart_params[d]}if(a
 rguments.length&gt;1){this.uploader.settings.multipart_params[d]=e}else{b.extend(this.uploader.settings.multipart_params,d)}},init:function(){},error:function(){},success:function(){},added:function(){},progress:function(){},complete:function(){},refresh:function(){this.uploader.refresh()}});c.queue=new wp.media.model.Attachments([],{query:false});a.Uploader=c})(wp,jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (22545 => 22546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2012-11-11 21:51:27 UTC (rev 22545)
+++ trunk/wp-includes/version.php        2012-11-11 22:58:32 UTC (rev 22546)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @global string $wp_version
</span><span class="cx">  */
</span><del>-$wp_version = '3.5-beta2-22540';
</del><ins>+$wp_version = '3.5-beta2-22546';
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
</span></span></pre>
</div>
</div>

</body>
</html>