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

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsmediaviewsminjs">trunk/wp-includes/js/media-views.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="trunkwpincludesjsmediaviewsminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.min.js (22359 => 22360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.min.js        2012-11-02 16:52:53 UTC (rev 22359)
+++ trunk/wp-includes/js/media-views.min.js        2012-11-02 22:58:37 UTC (rev 22360)
</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;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.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,{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){if(g=this.state()){g.trigger(&quot;deactivate&quot;)}this._state=h;return this.state().trigger(&quot;activate&quot;)}if(this._state){return this.get(this._state)}}});_.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.Library=Backbone.Model.extend({defaults:{id:&quot;library&quot;,multiple:false,describe:false,title:b.mediaLibraryTitle},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(!this.get(&quot;gutter&quot;)){this.set(&quot;gutter&quot;,8)}this.on(&quot;activate&quot
 ;,this.activate,this);this.on(&quot;deactivate&quot;,this.deactivate,this)},activate:function(){this.toolbar();this.sidebar();this.content();if(this.get(&quot;multiple&quot;)){wp.Uploader.queue.on(&quot;add&quot;,this.selectUpload,this)}this.get(&quot;selection&quot;).on(&quot;selection:single&quot;,this.buildDetails,this);this.get(&quot;selection&quot;).on(&quot;selection:unsingle&quot;,this.clearDetails,this)},deactivate:function(){var g=this._postLibraryToolbar;if(g){this.get(&quot;selection&quot;).off(&quot;add remove&quot;,g.visibility,g)}wp.Uploader.queue.off(&quot;add&quot;,this.selectUpload,this);this.get(&quot;selection&quot;).off(&quot;selection:single&quot;,this.buildDetails,this);this.get(&quot;selection&quot;).off(&quot;selection:unsingle&quot;,this.clearDetails,this)},toolbar:function(){var h=this.frame,g;g=this._postLibraryToolbar=new f.view.Toolbar.PostLibrary({controller:h,state:this});h.toolbar(g);this.get(&quot;selection&quot;).on(&quot;add remove&quot;,g.
 visibility,g)},sidebar:function(){var g=this.frame;g.sidebar(new f.view.Sidebar({controller:g}));this.details();g.sidebar().add({search:new f.view.Search({controller:g,model:this.get(&quot;library&quot;).props,priority:20}),selection:new f.view.SelectionPreview({controller:g,collection:this.get(&quot;selection&quot;),priority:40})})},content:function(){var g=this.frame;g.content(new f.view.Attachments({controller:g,collection:this.get(&quot;library&quot;),AttachmentView:f.view.Attachment.Library}).render())},selectUpload:function(g){this.get(&quot;selection&quot;).add(g)},details:function(){var g=this.get(&quot;selection&quot;).single();this[g?&quot;buildDetails&quot;:&quot;clearDetails&quot;](g)},buildDetails:function(g){this.frame.sidebar().add(&quot;details&quot;,new f.view.Attachment.Details({controller:this.frame,model:g,priority:80}).render());return this},clearDetails:function(g){if(this.get(&quot;selection&quot;).single()){return this}this.frame.sidebar().add(&quot;d
 etails&quot;,new Backbone.View({priority:80}).render());return this},toggleSelection:function(g){var h=this.get(&quot;selection&quot;);if(h.has(g)){h[h.single()===g?&quot;remove&quot;:&quot;single&quot;](g)}else{h.add(g).single()}return this}});f.controller.Gallery=f.controller.Library.extend({defaults:{id:&quot;gallery&quot;,multiple:false,describe:true,title:b.createGalleryTitle,edge:199,editing:false},toolbar:function(){this.frame.toolbar(new f.view.Toolbar.Gallery({controller:this.frame,state:this}))},sidebar:function(){var g=this.frame;g.sidebar(new f.view.Sidebar({controller:g}));this.details();g.sidebar().add({settings:new f.view.Settings.Gallery({controller:g,model:this.get(&quot;library&quot;).props,priority:40}).render()})},content:function(){this.frame.content(new f.view.Attachments({controller:this.frame,collection:this.get(&quot;library&quot;),sortable:true,AttachmentView:f.view.Attachment.Gallery}).render())}});f.view.Frame=Backbone.View.extend({tagName:&quot;d
 iv&quot;,className:&quot;media-frame&quot;,template:f.template(&quot;media-frame&quot;),initialize:function(){_.defaults(this.options,{state:&quot;library&quot;,title:&quot;&quot;,selection:[],library:{},modal:true,multiple:false,uploader:true,editing:false});this.createSelection();this.createSubviews();this.createStates()},render:function(){var g=[this.toolbar().el,this.sidebar().el,this.content().el];if(this.modal){this.modal.render()}this.$el.children().filter(g).detach();this.$el.empty().append(g);if(this.uploader){this.uploader.render().$el.appendTo(this.$el)}return this},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)){h=this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}},createStates:function(){var g=this.options;this.states=new Backbone.Collection();this.states.on(&quot;add&quot;,function(h){h.frame=this},this);this.states.add([new f.controller.Library({selection:g.selection,library:f.
 query(g.library),multiple:this.options.multiple}),new f.controller.Gallery({library:g.selection,editing:g.editing})]);this.state(g.state)},createSubviews:function(){_.each([&quot;toolbar&quot;,&quot;sidebar&quot;,&quot;content&quot;],function(g){this[&quot;_&quot;+g]=new Backbone.View({tagName:&quot;div&quot;,className:&quot;media-&quot;+g})},this);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}})}}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);_.each([&quot;toolbar&quot;,&quot;sidebar&quot;,&quot;content&quot;],function(g){f.view.Frame.prototype[g]=function(h){var i=this[&quot;_&quot;+g];if(!h){return i}h.$el.addClass(&quot;media-&quot;+g);if(i.destroy){i.destroy()}i.undelegateEvents();i.$el.replaceWith(h.$el);this[&quot;_&quot;+g]=h}});_.each([&quot;open&quot;,&quo
 t;close&quot;,&quot;attach&quot;,&quot;detach&quot;],function(g){f.view.Frame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});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.$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.det
 ach();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.inline=new f.view.UploaderInline({controller:this.controller,uploaderWindow:this}).render();this.inline.$el.appendTo(&quot;body&quot;);g=this.options.uploader=_.defaults(this.options.uploader||{},{container:this.inline.$el,dropzone:this.$el,browser:this.in
 line.$(&quot;.browser&quot;),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=Back
 bone.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;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)},render:function(){this.renderUploadProgress();this.$el.html(this.template(this.options));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()}},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;));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.co
 ntroller=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}});f.view.Toolbar.PostLibrary=f.view.Toolbar.extend({initialize:function(){var i=this.options.state,h=i.get(&quot;selection&quot;),g=this.options.controller;this.options.items={&quot;create-new-gallery&quot;:{style:&quot;primary&quot;,text:b.createNewGallery,priority:40,click:function(){this.controller.state(&quot;gallery&quot;)}},&quot;insert-into-post&quot;:new f.view.ButtonGroup({priority:30,classes:&quot;dropdown-flip-x&quot;,buttons:[{text:b.insertIntoPost,click:function(){g.close();i.trigger(&quot;insert&quot;,h);h.clear()}},{classes:[&quot;down-arrow&quot;],dropdown:new f.view.Settings.AttachmentDisplay().render().$el,click:function(k){var j=this.$el;if(!e(k.target).closest(&quot;.dropdown&quot;).length){j.toggleClass(&quot;active&quot;)}k.stopPropa
 gation();if(j.is(&quot;:visible&quot;)){e(document.body).one(&quot;click&quot;,function(){j.removeClass(&quot;active&quot;)})}}}]}).render(),&quot;add-to-gallery&quot;:{text:b.addToGallery,priority:20}};f.view.Toolbar.prototype.initialize.apply(this,arguments);this.visibility()},visibility:function(){var k=this.options.state,h=k.get(&quot;selection&quot;),g=this.options.controller,j=h.length,i;i=j&gt;1&amp;&amp;h.all(function(l){return&quot;image&quot;===l.get(&quot;type&quot;)});this.get(&quot;create-new-gallery&quot;).$el.toggle(i);insert=this.get(&quot;insert-into-post&quot;);_.each(insert.buttons,function(l){l.model.set(&quot;style&quot;,i?&quot;&quot;:&quot;primary&quot;)});_.first(insert.buttons).model.set(&quot;disabled&quot;,!j)}});f.view.Toolbar.Gallery=f.view.Toolbar.extend({initialize:function(){var j=this.options.state,h=j.get(&quot;editing&quot;),i=j.get(&quot;library&quot;),g=this.options.controller;this.options.items={update:{style:&quot;primary&quot;,text:h?b
 .updateGallery:b.insertGallery,priority:40,click:function(){g.close();j.trigger(&quot;update&quot;,i);i.clear();g.state(&quot;library&quot;)}},cancel:{text:b.cancel,priority:-60,click:function(){if(h){g.close()}else{g.state(&quot;library&quot;)}}}};f.view.Toolbar.prototype.initialize.apply(this,arguments)}});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){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;e
 l&quot;)).detach());return this}});f.view.Sidebar=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-sidebar&quot;,template:f.template(&quot;sidebar&quot;),initialize:function(){this.controller=this.options.controller;this._views={};if(this.options.views){this.add(this.options.views,{silent:true})}if(!this.options.silent){this.render()}},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(this.template({title:this.controller.state().get(&quot;title&quot;)||&quot;&quot;,uploader:this.controller.options.uploader}));this.$(&quot;.sidebar-content&quot;).html(g);if(this.controller.uploader){this.$el.append(this.controller.uploader.inline.$el);this.controller.uploader.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}g.controller=g.controller||thi
 s.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}});f.view.Attachment=Backbone.View.extend({tagName:&quot;li&quot;,className:&quot;attachment&quot;,template:f.template(&quot;attachment&quot;),events:{&quot;click .attachment-preview&quot;:&quot;toggleSelection&quot;,&quot;change .describe&quot;:&quot;describe&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)},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.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.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;)}}},describe:function(g){if(&quot;image&quot;===this.model.get(&quot;type&quot;)){this.model.save(&quot;caption&quot;,g.target.value)}else{this.model.save(&quot;title&quot;
 ,g.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)},thi
 s);this.collection.on(&quot;reset&quot;,this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();this.controller.state().on(&quot;change:edge change:gutter&quot;,this.css,this);this.css()},destroy:function(){this.collection.off(&quot;add remove reset&quot;,null,this);this.controller.state().off(&quot;change:edge change:gutter&quot;,this.css,this)},css:function(){var g=e(&quot;#&quot;+this.el.id+&quot;-css&quot;),h=this.controller.state();if(g.length){g.remove()}f.view.Attachments.$head().append(this.template({id:this.el.id,edge:h.get(&quot;edge&quot;),gutter:h.get(&quot;gutter&quot;)}))},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(),sil
 ent: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();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()}}},{$head:(function(){var g;return function(){return g=g||e(&quot;head&quot;)}}())});f.view.Search=Backbone.Vi
 ew.extend({tagName:&quot;input&quot;,className:&quot;search&quot;,attributes:{type:&quot;text&quot;,placeholder:b.search},events:{keyup:&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.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(&q
 uot;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.Settings=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;attachment-display-settings&quot;,template:f.template(&quot;attachment-display-settings&quot;),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;},settings:{},initialize:function(){var g=this.settings;this.model=this.model||new Backbone.Model();_.each(g,function(i,h){if(i.name){this.model.set(h,getUserSetting(i.name,i.fallback))}else{this.model.set(h,this.model.get(h)||i.fallback)}},this);this.model.validate=function(h){return _.any(h,function(j,i){return !g[i]||!_.contain
 s(g[i].accepts,j)})};this.model.on(&quot;change&quot;,function(i,h){if(!h.changes){return}_.each(_.keys(h.changes),function(j){if(g[j]&amp;&amp;g[j].name){setUserSetting(g[j].name,i.get(j))}})},this);this.model.on(&quot;change&quot;,this.updateChanges,this)},render:function(){this.$el.html(this.template(this.model.toJSON()));_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(i){var j=this.settings[i],h=this.$('[data-setting=&quot;'+i+'&quot;]'),g;if(!j){return}if(&quot;select&quot;===j.type){h.find('[value=&quot;'+this.model.get(i)+'&quot;]').attr(&quot;selected&quot;,true)}else{g=h.find(&quot;button&quot;).removeClass(&quot;active&quot;);g.filter('[value=&quot;'+this.model.get(i)+'&quot;]').addClass(&quot;active&quot;)}},updateHandler:function(h){var g=e(h.target).closest(&quot;[data-setting]&quot;);h.preventDefault();if(g.length){this.model.set(g.data(&quot;setting&quot;),h.target.value)}},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;),settings:{align:{accepts:[&quot;left&quot;,&quot;center&quot;,&quot;right&quot;,&quot;none&quot;],name:&quot;align&quot;,fallback:&quot;none&quot;},link:{accepts:[&quot;post&quot;,&quot;file&quot;,&quot;none&quot;],name:&quot;urlbutton&quot;,fallback:&quot;post&quot;},size:{accepts:[&quot;thumbnail&quot;,&quot;medium&quot;,&quot;large&quot;,&quot;full&quot;],name:&quot;imgsize&quot;,fallback:&quot;medium&quot;}}});f.view.Settings.Gallery=f.view.Settings.extend({className:&quot;gallery-settings&quot;,template:f.template(&quot;gallery-settings&quot;),settings:{columns:{accepts:_.invoke(_.range(1,10),&quot;toString&quot;),fallback:&quot;3&quot;,type:&quot;select&quot;},link:{accepts:[&quot;post&quot;,&quot;file&quot;],fallback:&quot;post&quot;}}});f.view.Atta
 chment.Details=f.view.Attachment.extend({tagName:&quot;div&quot;,className:&quot;attachment-details&quot;,template:f.template(&quot;attachment-details&quot;),events:{&quot;change .describe&quot;:&quot;describe&quot;}})}(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;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.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,{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){if(g=this.state()){g.trigger(&quot;deactivate&quot;)}this._state=h;return this.state().trigger(&quot;activate&quot;)}if(this._state){return this.get(this._state)}}});_.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.Library=Backbone.Model.extend({defaults:{id:&quot;library&quot;,multiple:false,describe:false,title:b.mediaLibraryTitle},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(!this.get(&quot;gutter&quot;)){this.set(&quot;gutter&quot;,8)}this.on(&quot;activate&quot
 ;,this.activate,this);this.on(&quot;deactivate&quot;,this.deactivate,this)},activate:function(){this.toolbar();this.sidebar();this.content();if(this.get(&quot;multiple&quot;)){wp.Uploader.queue.on(&quot;add&quot;,this.selectUpload,this)}this.get(&quot;selection&quot;).on(&quot;selection:single&quot;,this.buildDetails,this);this.get(&quot;selection&quot;).on(&quot;selection:unsingle&quot;,this.clearDetails,this)},deactivate:function(){var g=this._postLibraryToolbar;if(g){this.get(&quot;selection&quot;).off(&quot;add remove&quot;,g.visibility,g)}wp.Uploader.queue.off(&quot;add&quot;,this.selectUpload,this);this.get(&quot;selection&quot;).off(&quot;selection:single&quot;,this.buildDetails,this);this.get(&quot;selection&quot;).off(&quot;selection:unsingle&quot;,this.clearDetails,this)},toolbar:function(){var h=this.frame,g;g=this._postLibraryToolbar=new f.view.Toolbar.PostLibrary({controller:h,state:this});h.toolbar(g);this.get(&quot;selection&quot;).on(&quot;add remove&quot;,g.
 visibility,g)},sidebar:function(){var g=this.frame;g.sidebar(new f.view.Sidebar({controller:g}));this.details();g.sidebar().add({search:new f.view.Search({controller:g,model:this.get(&quot;library&quot;).props,priority:20}),selection:new f.view.SelectionPreview({controller:g,collection:this.get(&quot;selection&quot;),priority:40})})},content:function(){var g=this.frame;g.content(new f.view.Attachments({controller:g,collection:this.get(&quot;library&quot;),AttachmentView:f.view.Attachment.Library}).render())},selectUpload:function(g){this.get(&quot;selection&quot;).add(g)},details:function(){var g=this.get(&quot;selection&quot;).single();this[g?&quot;buildDetails&quot;:&quot;clearDetails&quot;](g)},buildDetails:function(g){this.frame.sidebar().add(&quot;details&quot;,new f.view.Attachment.Details({controller:this.frame,model:g,priority:80}).render());return this},clearDetails:function(g){if(this.get(&quot;selection&quot;).single()){return this}this.frame.sidebar().add(&quot;d
 etails&quot;,new Backbone.View({priority:80}).render());return this},toggleSelection:function(g){var h=this.get(&quot;selection&quot;);if(h.has(g)){h[h.single()===g?&quot;remove&quot;:&quot;single&quot;](g)}else{h.add(g).single()}return this}});f.controller.Gallery=f.controller.Library.extend({defaults:{id:&quot;gallery&quot;,multiple:false,describe:true,title:b.createGalleryTitle,edge:199,editing:false},toolbar:function(){this.frame.toolbar(new f.view.Toolbar.Gallery({controller:this.frame,state:this}))},sidebar:function(){var g=this.frame;g.sidebar(new f.view.Sidebar({controller:g}));this.details();g.sidebar().add({settings:new f.view.Settings.Gallery({controller:g,model:this.get(&quot;library&quot;).props,priority:40}).render()})},content:function(){this.frame.content(new f.view.Attachments({controller:this.frame,collection:this.get(&quot;library&quot;),sortable:true,AttachmentView:f.view.Attachment.Gallery}).render())}});f.controller.GalleryAddImages=f.controller.Library
 .extend({defaults:{id:&quot;gallery:add&quot;,multiple:true,title:b.createGalleryTitle},initialize:function(){if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query({type:&quot;image&quot;}))}return f.controller.Library.prototype.initialize.apply(this,arguments)},toolbar:function(){var g=this.frame;g.toolbar(new f.view.Toolbar.GalleryAddImages({controller:g,state:this}))},sidebar:function(){}});f.view.Frame=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-frame&quot;,template:f.template(&quot;media-frame&quot;),initialize:function(){_.defaults(this.options,{state:&quot;library&quot;,title:&quot;&quot;,selection:[],library:{},modal:true,multiple:false,uploader:true,editing:false});this.createSelection();this.createSubviews();this.createStates()},render:function(){var g=[this.toolbar().el,this.sidebar().el,this.content().el];if(this.modal){this.modal.render()}this.$el.children().filter(g).detach();this.$el.empty().append(g);if(this.uploader)
 {this.uploader.render().$el.appendTo(this.$el)}return this},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)){h=this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}},createStates:function(){var g=this.options;this.states=new Backbone.Collection();this.states.on(&quot;add&quot;,function(h){h.frame=this},this);this.states.add([new f.controller.Library({selection:g.selection,library:f.query(g.library),multiple:this.options.multiple}),new f.controller.Gallery({library:g.selection,editing:g.editing}),new f.controller.GalleryAddImages()]);this.state(g.state)},createSubviews:function(){_.each([&quot;toolbar&quot;,&quot;sidebar&quot;,&quot;content&quot;],function(g){this[&quot;_&quot;+g]=new Backbone.View({tagName:&quot;div&quot;,className:&quot;media-&quot;+g})},this);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}})}}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);_.each([&quot;toolbar&quot;,&quot;sidebar&quot;,&quot;content&quot;],function(g){f.view.Frame.prototype[g]=function(h){var i=this[&quot;_&quot;+g];if(!h){return i}h.$el.addClass(&quot;media-&quot;+g);if(i.destroy){i.destroy()}i.undelegateEvents();i.$el.replaceWith(h.$el);this[&quot;_&quot;+g]=h}});_.each([&quot;open&quot;,&quot;close&quot;,&quot;attach&quot;,&quot;detach&quot;],function(g){f.view.Frame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});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,titl
 e:&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.inline=new f.view.UploaderInline({controller:this.controller,uploaderWindow:this}).render();this.inline.$el.appendTo(&quot;body&quot;);g=this.options.uploader=_.defaults(this.options.uploader||{},{container:this.inline.$el,dropzone:this.$el,browser:this.inline.$(&quot;.browser&quot;),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&qu
 ot;);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;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)},render:function(){this.renderUploadProgress();this.$el.html(this.template(this.op
 tions));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()}},render:function(){var g=_.chain(this._views).sortBy(function(h){return h.options.priority||10}).groupBy(function(h){return(h.options.p
 riority||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;));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}});f.view.Toolbar.PostLibrary=f.view.Toolbar.extend({initialize:function(){var i=this.options.state,h=i.get(&quot;selection&quot;),g=this.options.controller;this.options.items={&quot;create-new-gallery&quot;:{style:&quot;primary&quot;,text:b.createNewGallery,priori
 ty:40,click:function(){this.controller.state(&quot;gallery&quot;)}},&quot;insert-into-post&quot;:new f.view.ButtonGroup({priority:30,classes:&quot;dropdown-flip-x&quot;,buttons:[{text:b.insertIntoPost,click:function(){g.close();i.trigger(&quot;insert&quot;,h);h.clear()}},{classes:[&quot;down-arrow&quot;],dropdown:new f.view.Settings.AttachmentDisplay().render().$el,click:function(k){var j=this.$el;if(!e(k.target).closest(&quot;.dropdown&quot;).length){j.toggleClass(&quot;active&quot;)}k.stopPropagation();if(j.is(&quot;:visible&quot;)){e(document.body).one(&quot;click&quot;,function(){j.removeClass(&quot;active&quot;)})}}}]}).render(),&quot;add-to-gallery&quot;:{text:b.addToGallery,priority:20}};f.view.Toolbar.prototype.initialize.apply(this,arguments);this.visibility()},visibility:function(){var k=this.options.state,h=k.get(&quot;selection&quot;),g=this.options.controller,j=h.length,i;i=j&gt;1&amp;&amp;h.all(function(l){return&quot;image&quot;===l.get(&quot;type&quot;)});thi
 s.get(&quot;create-new-gallery&quot;).$el.toggle(i);insert=this.get(&quot;insert-into-post&quot;);_.each(insert.buttons,function(l){l.model.set(&quot;style&quot;,i?&quot;&quot;:&quot;primary&quot;)});_.first(insert.buttons).model.set(&quot;disabled&quot;,!j)}});f.view.Toolbar.Gallery=f.view.Toolbar.extend({initialize:function(){var j=this.options.state,h=j.get(&quot;editing&quot;),i=j.get(&quot;library&quot;),g=this.options.controller;this.options.items={update:{style:&quot;primary&quot;,text:h?b.updateGallery:b.insertGallery,priority:40,click:function(){g.close();j.trigger(&quot;update&quot;,i);g.get(&quot;library&quot;).get(&quot;selection&quot;).clear();g.state(&quot;library&quot;)}},addImages:{text:b.addImages,priority:-40,click:function(){g.get(&quot;gallery:add&quot;).set(&quot;selection&quot;,new f.model.Selection(i.models,{props:i.props.toJSON(),multiple:true}));g.state(&quot;gallery:add&quot;)}},cancel:{text:b.cancel,priority:-60,click:function(){if(h){g.close()}els
 e{g.state(&quot;library&quot;)}}}};f.view.Toolbar.prototype.initialize.apply(this,arguments)}});f.view.Toolbar.GalleryAddImages=f.view.Toolbar.extend({initialize:function(){var j=this.options.state,h=j.get(&quot;editing&quot;),i=j.get(&quot;library&quot;),g=this.options.controller;this.options.items={update:{style:&quot;primary&quot;,text:b.continueEditing,priority:40,click:function(){g.get(&quot;gallery&quot;).set(&quot;library&quot;,j.get(&quot;selection&quot;));g.state(&quot;gallery&quot;)}},cancel:{text:b.cancel,priority:-60,click:function(){g.state(&quot;gallery&quot;)}}};f.view.Toolbar.prototype.initialize.apply(this,arguments)}});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){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-butt
 on-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.Sidebar=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;media-sidebar&quot;,template:f.template(&quot;sidebar&quot;),initialize:function(){this.controller=this.options.controller;this._views={};if(this.options.views){this.add(this.options.views,{silent:true})}if(!this.options.silent){this.render()}},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(this.template({title:this.controller.state().get(&quot;title&quot;)||&quot;&quot;,uploader:this.controller.options.uploader}));this.$(&quot;.
 sidebar-content&quot;).html(g);if(this.controller.uploader){this.$el.append(this.controller.uploader.inline.$el);this.controller.uploader.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}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}});f.view.Attachment=Backbone.View.extend({tagName:&quot;li&quot;,className:&quot;attachment&quot;,template:f.template(&quot;attachment&quot;),events:{&quot;click .attachment-preview&quot;:&quot;toggleSelection&quot;,&quot;change .describe&quot;:&quot;describe&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)},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},pro
 gress: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.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:th
 is.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;)}}},describe:function(g){if(&quot;image&quot;===this.model.get(&quot;type&quot;)){this.model.save(&quot;caption&quot;,g.target.value)}else{this.model.save(&quot;title&quot;,g.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();this.controller.state().on(&quot;change:edge change:gutter&quot;,this.css,this);this.css()},destroy:function(){this.collection.off(&quot;add remove reset&quot;,null,this);this.controller.state().off(&quot;change:edge change:gutter&quot;,this.css,this)},css:function(){var g=e(&quot;#&quot;+this.el.id+&quot;-css&quot;),h=this.controller.state();if(g.length){g.remove()}f.view.Attachments.$head().append(this.template({id:this.el.id,edge:h.get(&quot;edge&quot;),gutter:h.get(&quot;gu
 tter&quot;)}))},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();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.child
 ren();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()}}},{$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;text&quot;,placeholder:b.search},events:{keyup:&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.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,{clear
 able: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.Settings=Backbone.View.extend({tagName:&quot;div&quot;,className:&quot;attachment-display-settings&quot;,template:f.template(&quot;attachment-display-settings&quot;),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&qu
 ot;},settings:{},initialize:function(){var g=this.settings;this.model=this.model||new Backbone.Model();_.each(g,function(i,h){if(i.name){this.model.set(h,getUserSetting(i.name,i.fallback))}else{this.model.set(h,this.model.get(h)||i.fallback)}},this);this.model.validate=function(h){return _.any(h,function(j,i){return !g[i]||!_.contains(g[i].accepts,j)})};this.model.on(&quot;change&quot;,function(i,h){if(!h.changes){return}_.each(_.keys(h.changes),function(j){if(g[j]&amp;&amp;g[j].name){setUserSetting(g[j].name,i.get(j))}})},this);this.model.on(&quot;change&quot;,this.updateChanges,this)},render:function(){this.$el.html(this.template(this.model.toJSON()));_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(i){var j=this.settings[i],h=this.$('[data-setting=&quot;'+i+'&quot;]'),g;if(!j){return}if(&quot;select&quot;===j.type){h.find('[value=&quot;'+this.model.get(i)+'&quot;]').attr(&quot;selected&quot;,true)}else{g=h.find(&quot;button&quot;
 ).removeClass(&quot;active&quot;);g.filter('[value=&quot;'+this.model.get(i)+'&quot;]').addClass(&quot;active&quot;)}},updateHandler:function(h){var g=e(h.target).closest(&quot;[data-setting]&quot;);h.preventDefault();if(g.length){this.model.set(g.data(&quot;setting&quot;),h.target.value)}},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;),settings:{align:{accepts:[&quot;left&quot;,&quot;center&quot;,&quot;right&quot;,&quot;none&quot;],name:&quot;align&quot;,fallback:&quot;none&quot;},link:{accepts:[&quot;post&quot;,&quot;file&quot;,&quot;none&quot;],name:&quot;urlbutton&quot;,fallback:&quot;post&quot;},size:{accepts:[&quot;thumbnail&quot;,&quot;medium&quot;,&quot;large&quot;,&quot;full&quot;],name:&quot;imgsize&quot;,fallback:&quot;medium&quot;}}});f.view.Settin
 gs.Gallery=f.view.Settings.extend({className:&quot;gallery-settings&quot;,template:f.template(&quot;gallery-settings&quot;),settings:{columns:{accepts:_.invoke(_.range(1,10),&quot;toString&quot;),fallback:&quot;3&quot;,type:&quot;select&quot;},link:{accepts:[&quot;post&quot;,&quot;file&quot;],fallback:&quot;post&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 .describe&quot;:&quot;describe&quot;}})}(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 (22359 => 22360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2012-11-02 16:52:53 UTC (rev 22359)
+++ trunk/wp-includes/version.php        2012-11-02 22:58:37 UTC (rev 22360)
</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-22352';
</del><ins>+$wp_version = '3.5-beta2-22360';
</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>