<!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>[30245] trunk/src/wp-includes/js: Improve `wp.media` documentation.</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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/30245">30245</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/30245","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-11-05 19:38:20 +0000 (Wed, 05 Nov 2014)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Improve `wp.media` documentation.

Props ericlewis.
See <a href="https://core.trac.wordpress.org/ticket/28459">#28459</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmediamodelsjs">trunk/src/wp-includes/js/media-models.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsjs">trunk/src/wp-includes/js/media-views.js</a></li>
<li><a href="#trunksrcwpincludesjswputiljs">trunk/src/wp-includes/js/wp-util.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmediamodelsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media-models.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media-models.js  2014-11-05 19:36:27 UTC (rev 30244)
+++ trunk/src/wp-includes/js/media-models.js    2014-11-05 19:38:20 UTC (rev 30245)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,8 +65,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * A basic comparator.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * A basic equality comparator for Backbone models.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
+        *
</ins><span class="cx" style="display: block; padding: 0 10px">          * @param  {mixed}  a  The primary parameter to compare.
</span><span class="cx" style="display: block; padding: 0 10px">         * @param  {mixed}  b  The primary parameter to compare.
</span><span class="cx" style="display: block; padding: 0 10px">         * @param  {string} ac The fallback parameter to compare, a's cid.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +89,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><span class="cx" style="display: block; padding: 0 10px">                 * media.template( id )
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Fetches a template by id.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Fetch a JavaScript template for an id, and return a templating function for it.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * See wp.template() in `wp-includes/js/wp-util.js`.
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><span class="cx" style="display: block; padding: 0 10px">                 * @borrows wp.template as template
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,7 +200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.media.model.Attachment
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @constructor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @class
</ins><span class="cx" style="display: block; padding: 0 10px">          * @augments Backbone.Model
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        Attachment = media.model.Attachment = Backbone.Model.extend({
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -329,7 +332,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }, {
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Add a model to the end of the static 'all' collection and return it.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Create a new model on the static 'all' attachments collection and return it.
</ins><span class="cx" style="display: block; padding: 0 10px">                  *
</span><span class="cx" style="display: block; padding: 0 10px">                 * @static
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Object} attrs
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,8 +342,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return Attachments.all.push( attrs );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Retrieve a model, or add it to the end of the static 'all' collection before returning it.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Create a new model on the static 'all' attachments collection and return it.
</ins><span class="cx" style="display: block; padding: 0 10px">                  *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * If this function has already been called for the id,
+                * it returns the specified attachment.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @static
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {string} id A string used to identify a model.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Backbone.Model|undefined} attachment
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,8 +360,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.media.model.PostImage
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @constructor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * An instance of an image that's been embedded into a post.
+        *
+        * Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails.
+        *
+        * @class
</ins><span class="cx" style="display: block; padding: 0 10px">          * @augments Backbone.Model
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         *
+        * @param {int} [attributes]               Initial model attributes.
+        * @param {int} [attributes.attachment_id] ID of the attachment.
</ins><span class="cx" style="display: block; padding: 0 10px">          **/
</span><span class="cx" style="display: block; padding: 0 10px">        PostImage = media.model.PostImage = Backbone.Model.extend({
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -497,8 +510,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.media.model.Attachments
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @constructor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * A collection of attachments.
+        *
+        * This collection has no persistence with the server without supplying
+        * 'options.props.query = true', which will mirror the collection
+        * to an Attachments Query collection - @see wp.media.model.Attachments.mirror().
+        *
+        * @class
</ins><span class="cx" style="display: block; padding: 0 10px">          * @augments Backbone.Collection
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         *
+        * @param {array}  [models]                Models to initialize with the collection.
+        * @param {object} [options]               Options hash for the collection.
+        * @param {string} [options.props]         Options hash for the initial query properties.
+        * @param {string} [options.props.order]   Initial order (ASC or DESC) for the collection.
+        * @param {string} [options.props.orderby] Initial attribute key to order the collection by.
+        * @param {string} [options.props.query]   Whether the collection is linked to an attachments query.
+        * @param {string} [options.observe]
+        * @param {string} [options.filters]
+        *
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        Attachments = media.model.Attachments = Backbone.Collection.extend({
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,16 +551,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        this.props.on( 'change:orderby', this._changeOrderby, this );
</span><span class="cx" style="display: block; padding: 0 10px">                        this.props.on( 'change:query',   this._changeQuery,   this );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Set the `props` model and fill the default property values.
</del><span class="cx" style="display: block; padding: 0 10px">                         this.props.set( _.defaults( options.props || {} ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Observe another `Attachments` collection if one is provided.
</del><span class="cx" style="display: block; padding: 0 10px">                         if ( options.observe ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                this.observe( options.observe );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Automatically sort the collection when the order changes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Sort the collection when the order attribute changes.
</ins><span class="cx" style="display: block; padding: 0 10px">                  *
</span><span class="cx" style="display: block; padding: 0 10px">                 * @access private
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -625,6 +652,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                validateDestroyed: false,
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * Checks whether an attachment is valid.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @param {wp.media.model.Attachment} attachment
</span><span class="cx" style="display: block; padding: 0 10px">                 * @returns {Boolean}
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -637,6 +666,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }, this );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * Add or remove an attachment to the collection depending on its validity.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @param {wp.media.model.Attachment} attachment
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Object} options
</span><span class="cx" style="display: block; padding: 0 10px">                 * @returns {wp.media.model.Attachments} Returns itself to allow chaining
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -655,6 +686,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * Add or remove all attachments from another collection depending on each one's validity.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @param {wp.media.model.Attachments} attachments
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {object} [options={}]
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -675,8 +708,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return this;
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @param {wp.media.model.Attachments} attachments
-                * @returns {wp.media.model.Attachments} Returns itself to allow chaining
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Start observing another attachments collection change events
+                * and replicate them on this collection.
+                *
+                * @param {wp.media.model.Attachments} The attachments collection to observe.
+                * @returns {wp.media.model.Attachments} Returns itself to allow chaining.
</ins><span class="cx" style="display: block; padding: 0 10px">                  */
</span><span class="cx" style="display: block; padding: 0 10px">                observe: function( attachments ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        this.observers = this.observers || [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -688,7 +724,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return this;
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @param {wp.media.model.Attachments} attachments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Stop replicating collection change events from another attachments collection.
+                *
+                * @param {wp.media.model.Attachments} The attachments collection to stop observing.
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @returns {wp.media.model.Attachments} Returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                unobserve: function( attachments ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -734,7 +772,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return this.validateAll( attachments, options );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @param {wp.media.model.Attachments} attachments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Start mirroring another attachments collection, clearing out any models already
+                * in the collection.
+                *
+                * @param {wp.media.model.Attachments} The attachments collection to mirror.
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @returns {wp.media.model.Attachments} Returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                mirror: function( attachments ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -752,6 +793,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        return this;
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                /**
+                * Stop mirroring another attachments collection.
+                */
</ins><span class="cx" style="display: block; padding: 0 10px">                 unmirror: function() {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! this.mirroring ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -761,7 +805,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        delete this.mirroring;
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @param {Object} options
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Retrive more attachments from the server for the collection.
+                *
+                * Only works if the collection is mirroring a Query Attachments collection,
+                * and forwards to its `more` method. This collection class doesn't have
+                * server persistence by itself.
+                *
+                * @param {object} options
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @returns {Promise}
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                more: function( options ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -784,14 +834,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return deferred.promise();
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @returns {Boolean}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Whether there are more attachments that haven't been sync'd from the server
+                * that match the collection's query.
+                *
+                * Only works if the collection is mirroring a Query Attachments collection,
+                * and forwards to its `hasMore` method. This collection class doesn't have
+                * server persistence by itself.
+                *
+                * @returns {boolean}
</ins><span class="cx" style="display: block; padding: 0 10px">                  */
</span><span class="cx" style="display: block; padding: 0 10px">                hasMore: function() {
</span><span class="cx" style="display: block; padding: 0 10px">                        return this.mirroring ? this.mirroring.hasMore() : false;
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Overrides Backbone.Collection.parse
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * A custom AJAX-response parser.
</ins><span class="cx" style="display: block; padding: 0 10px">                  *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * See trac ticket #24753
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @param {Object|Array} resp The raw response Object/Array.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Object} xhr
</span><span class="cx" style="display: block; padding: 0 10px">                 * @returns {Array} The array of model attributes to be added to the collection
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -822,6 +881,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * If the collection is a query, create and mirror an Attachments Query collection.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @access private
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                _requery: function( refresh ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -867,8 +928,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }, {
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * A function to compare two attachment models in an attachments collection.
+                *
+                * Used as the default comparator for instances of wp.media.model.Attachments
+                * and its subclasses. @see wp.media.model.Attachments._changeOrderby().
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @static
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Overrides Backbone.Collection.comparator
</del><span class="cx" style="display: block; padding: 0 10px">                  *
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Backbone.Model} a
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Backbone.Model} b
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -971,6 +1036,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        });
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * A collection of all attachments that have been fetched from the server.
+        *
</ins><span class="cx" style="display: block; padding: 0 10px">          * @static
</span><span class="cx" style="display: block; padding: 0 10px">         * @member {wp.media.model.Attachments}
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -979,7 +1046,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.media.query
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @static
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Shorthand for creating a new Attachments Query.
+        *
+        * @param {object} [props]
</ins><span class="cx" style="display: block; padding: 0 10px">          * @returns {wp.media.model.Attachments}
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        media.query = function( props ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -991,22 +1060,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.media.model.Query
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * A set of attachments that corresponds to a set of consecutively paged
-        * queries on the server.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * A collection of attachments that match the supplied query arguments.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * Note: Do NOT change this.args after the query has been initialized.
</span><span class="cx" style="display: block; padding: 0 10px">         *       Things will break.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @constructor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @class
</ins><span class="cx" style="display: block; padding: 0 10px">          * @augments wp.media.model.Attachments
</span><span class="cx" style="display: block; padding: 0 10px">         * @augments Backbone.Collection
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         *
+        * @param {array}  [models]                      Models to initialize with the collection.
+        * @param {object} [options]                     Options hash.
+        * @param {object} [options.args]                Attachments query arguments.
+        * @param {object} [options.args.posts_per_page]
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        Query = media.model.Query = Attachments.extend({
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><span class="cx" style="display: block; padding: 0 10px">                 * @global wp.Uploader
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @param {Array} [models=[]] Array of models used to populate the collection.
-                * @param {Object} [options={}]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * @param {array}  [models=[]]  Array of initial models to populate the collection.
+                * @param {object} [options={}]
</ins><span class="cx" style="display: block; padding: 0 10px">                  */
</span><span class="cx" style="display: block; padding: 0 10px">                initialize: function( models, options ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        var allowed;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1060,18 +1133,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @returns {Boolean}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Whether there are more attachments that haven't been sync'd from the server
+                * that match the collection's query.
+                *
+                * @returns {boolean}
</ins><span class="cx" style="display: block; padding: 0 10px">                  */
</span><span class="cx" style="display: block; padding: 0 10px">                hasMore: function() {
</span><span class="cx" style="display: block; padding: 0 10px">                        return this._hasMore;
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @param {Object} [options={}]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Fetch more attachments from the server for the collection.
+                *
+                * @param   {object}  [options={}]
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @returns {Promise}
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                more: function( options ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        var query = this;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        // If there is already a request pending, return early with the Deferred object.
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( this._more && 'pending' === this._more.state() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                return this._more;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1149,6 +1228,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                orderby: {
</span><span class="cx" style="display: block; padding: 0 10px">                        allowed:  [ 'name', 'author', 'date', 'title', 'modified', 'uploadedTo', 'id', 'post__in', 'menuOrder' ],
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        /**
+                        * A map of JavaScript orderby values to their WP_Query equivalents.
+                        * @type {Object}
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         valuemap: {
</span><span class="cx" style="display: block; padding: 0 10px">                                'id':         'ID',
</span><span class="cx" style="display: block; padding: 0 10px">                                'uploadedTo': 'parent',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1156,6 +1239,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * A map of JavaScript query properties to their WP_Query equivalents.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @readonly
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                propmap: {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1169,12 +1254,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'exclude':    'post__not_in'
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * Creates and returns an Attachments Query collection given the properties.
+                *
+                * Caches query objects and reuses where possible.
+                *
</ins><span class="cx" style="display: block; padding: 0 10px">                  * @static
</span><span class="cx" style="display: block; padding: 0 10px">                 * @method
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * @returns {wp.media.model.Query} A new query.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * @param {object} [props]
+                * @param {Object} [props.cache=true]   Whether to use the query cache or not.
+                * @param {Object} [props.order]
+                * @param {Object} [props.orderby]
+                * @param {Object} [props.include]
+                * @param {Object} [props.exclude]
+                * @param {Object} [props.s]
+                * @param {Object} [props.post_mime_type]
+                * @param {Object} [props.posts_per_page]
+                * @param {Object} [props.menu_order]
+                * @param {Object} [props.post_parent]
+                * @param {Object} [props.post_status]
+                * @param {Object} [options]
+                *
+                * @returns {wp.media.model.Query} A new Attachments Query collection.
</ins><span class="cx" style="display: block; padding: 0 10px">                  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Caches query objects so queries can be easily reused.
</del><span class="cx" style="display: block; padding: 0 10px">                 get: (function(){
</span><span class="cx" style="display: block; padding: 0 10px">                        /**
</span><span class="cx" style="display: block; padding: 0 10px">                         * @static
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1183,8 +1285,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        var queries = [];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                         * @param {Object} props
-                        * @param {Object} options
</del><span class="cx" style="display: block; padding: 0 10px">                          * @returns {Query}
</span><span class="cx" style="display: block; padding: 0 10px">                         */
</span><span class="cx" style="display: block; padding: 0 10px">                        return function( props, options ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1236,7 +1336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                // Substitute exceptions specified in orderby.keymap.
</span><span class="cx" style="display: block; padding: 0 10px">                                args.orderby = orderby.valuemap[ props.orderby ] || props.orderby;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Search the query cache for matches.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         // Search the query cache for a matching query.
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ( cache ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        query = _.find( queries, function( query ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                return _.isEqual( query.args, args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1262,9 +1362,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.media.model.Selection
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Used to manage a selection of attachments in the views.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * A selection of attachments.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @constructor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @class
</ins><span class="cx" style="display: block; padding: 0 10px">          * @augments wp.media.model.Attachments
</span><span class="cx" style="display: block; padding: 0 10px">         * @augments Backbone.Collection
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1288,13 +1388,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Override the selection's add method.
-                * If the workflow does not support multiple
-                * selected attachments, reset the selection.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * If the workflow does not support multi-select, clear out the selection
+                * before adding a new attachment to it.
</ins><span class="cx" style="display: block; padding: 0 10px">                  *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Overrides Backbone.Collection.add
-                * Overrides wp.media.model.Attachments.add
-                *
</del><span class="cx" style="display: block; padding: 0 10px">                  * @param {Array} models
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {Object} options
</span><span class="cx" style="display: block; padding: 0 10px">                 * @returns {wp.media.model.Attachment[]}
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1310,7 +1406,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * Triggered when toggling (clicking on) an attachment in the modal
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * Fired when toggling (clicking on) an attachment in the modal.
</ins><span class="cx" style="display: block; padding: 0 10px">                  *
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param {undefined|boolean|wp.media.model.Attachment} model
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media-views.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media-views.js   2014-11-05 19:36:27 UTC (rev 30244)
+++ trunk/src/wp-includes/js/media-views.js     2014-11-05 19:38:20 UTC (rev 30245)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,25 +679,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @augments Backbone.Model
</span><span class="cx" style="display: block; padding: 0 10px">         * @mixes media.selectionSync
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @param {object}                     [attributes]                         The attributes hash passed to the state.
-        * @param {string}                     [attributes.id=library]              Unique identifier.
-        * @param {string}                     [attributes.title=Media library]     Title for the state. Displays in the media menu and the frame's title region.
-        * @param {wp.media.model.Attachments} [attributes.library]                 The attachments collection to browse.
-        *                                                                          If one is not supplied, a collection of all attachments will be created.
-        * @param {boolean}                    [attributes.multiple=false]          Whether multi-select is enabled.
-        * @param {string}                     [attributes.content=upload]          Initial mode for the content region.
-        *                                                                          Overridden by persistent user setting if 'contentUserSetting' is true.
-        * @param {string}                     [attributes.menu=default]            Initial mode for the menu region.
-        * @param {string}                     [attributes.router=browse]           Initial mode for the router region.
-        * @param {string}                     [attributes.toolbar=select]          Initial mode for the toolbar region.
-        * @param {boolean}                    [attributes.searchable=true]         Whether the library is searchable.
-        * @param {boolean|string}             [attributes.filterable=false]        Whether the library is filterable, and if so what filters should be shown.
-        *                                                                          Accepts 'all', 'uploaded', or 'unattached'.
-        * @param {boolean}                    [attributes.sortable=true]           Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
-        * @param {boolean}                    [attributes.autoSelect=true]         Whether an uploaded attachment should be automatically added to the selection.
-        * @param {boolean}                    [attributes.describe=false]          Whether to offer UI to describe attachments - e.g. captioning images in a gallery.
-        * @param {boolean}                    [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
-        * @param {boolean}                    [attributes.syncSelection=true]      Whether the Attachments selection should be persisted from the last state.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @param {object}                          [attributes]                         The attributes hash passed to the state.
+        * @param {string}                          [attributes.id=library]              Unique identifier.
+        * @param {string}                          [attributes.title=Media library]     Title for the state. Displays in the media menu and the frame's title region.
+        * @param {wp.media.model.Attachments}      [attributes.library]                 The attachments collection to browse.
+        *                                                                               If one is not supplied, a collection of all attachments will be created.
+        * @param {wp.media.model.Selection|object} [attributes.selection]               A collection to contain attachment selections within the state.
+        *                                                                               If the 'selection' attribute is a plain JS object,
+        *                                                                               a Selection will be created using its values as the selection instance's `props` model.
+        *                                                                               Otherwise, it will copy the library's `props` model.
+        * @param {boolean}                         [attributes.multiple=false]          Whether multi-select is enabled.
+        * @param {string}                          [attributes.content=upload]          Initial mode for the content region.
+        *                                                                               Overridden by persistent user setting if 'contentUserSetting' is true.
+        * @param {string}                          [attributes.menu=default]            Initial mode for the menu region.
+        * @param {string}                          [attributes.router=browse]           Initial mode for the router region.
+        * @param {string}                          [attributes.toolbar=select]          Initial mode for the toolbar region.
+        * @param {boolean}                         [attributes.searchable=true]         Whether the library is searchable.
+        * @param {boolean|string}                  [attributes.filterable=false]        Whether the library is filterable, and if so what filters should be shown.
+        *                                                                               Accepts 'all', 'uploaded', or 'unattached'.
+        * @param {boolean}                         [attributes.sortable=true]           Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
+        * @param {boolean}                         [attributes.autoSelect=true]         Whether an uploaded attachment should be automatically added to the selection.
+        * @param {boolean}                         [attributes.describe=false]          Whether to offer UI to describe attachments - e.g. captioning images in a gallery.
+        * @param {boolean}                         [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
+        * @param {boolean}                         [attributes.syncSelection=true]      Whether the Attachments selection should be persisted from the last state.
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        media.controller.Library = media.controller.State.extend({
</span><span class="cx" style="display: block; padding: 0 10px">                defaults: {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -739,10 +743,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        props = _.omit( props, 'orderby', 'query' );
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // If the `selection` attribute is set to an object,
-                               // it will use those values as the selection instance's
-                               // `props` model. Otherwise, it will copy the library's
-                               // `props` model.
</del><span class="cx" style="display: block; padding: 0 10px">                                 this.set( 'selection', new media.model.Selection( null, {
</span><span class="cx" style="display: block; padding: 0 10px">                                        multiple: this.get('multiple'),
</span><span class="cx" style="display: block; padding: 0 10px">                                        props: props
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2482,9 +2482,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        media.view.MediaFrame.Select = media.view.MediaFrame.extend({
</span><span class="cx" style="display: block; padding: 0 10px">                initialize: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.MediaFrame.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        _.defaults( this.options, {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2664,9 +2662,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                state:    'insert',
</span><span class="cx" style="display: block; padding: 0 10px">                                metadata:  {}
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.MediaFrame.Select.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                        this.createIframeStates();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4553,9 +4550,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        requires: options.requires
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.Toolbar.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4597,9 +4592,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                text: l10n.insertIntoPost,
</span><span class="cx" style="display: block; padding: 0 10px">                                requires: false
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.Toolbar.Select.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5046,9 +5039,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                initialize: function() {
</span><span class="cx" style="display: block; padding: 0 10px">                        this.controller.on( 'content:render', this.update, this );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.Menu.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6013,8 +6004,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                 * When the selection changes, set the Query properties
-                * accordingly for the selected filter.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          * When the selected filter changes, update the Attachment Query properties to match.
</ins><span class="cx" style="display: block; padding: 0 10px">                  */
</span><span class="cx" style="display: block; padding: 0 10px">                change: function() {
</span><span class="cx" style="display: block; padding: 0 10px">                        var filter = this.filters[ this.el.value ];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6221,6 +6211,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @augments wp.media.View
</span><span class="cx" style="display: block; padding: 0 10px">         * @augments wp.Backbone.View
</span><span class="cx" style="display: block; padding: 0 10px">         * @augments Backbone.View
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         *
+        * @param {object}      options
+        * @param {object}      [options.filters=false] Which filters to show in the browser's toolbar.
+        *                                              Accepts 'uploaded' and 'all'.
+        * @param {object}      [options.search=true]   Whether to show the search interface in the
+        *                                              browser's toolbar.
+        * @param {object}      [options.display=false] Whether to show the attachments display settings
+        *                                              view in the sidebar.
+        * @param {bool|string} [options.sidebar=true]  Whether to create a sidebar for the browser.
+        *                                              Accepts true, false, and 'errors'.
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        media.view.AttachmentsBrowser = media.View.extend({
</span><span class="cx" style="display: block; padding: 0 10px">                tagName:   'div',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6747,9 +6747,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                // The single `Attachment` view to be used in the `Attachments` view.
</span><span class="cx" style="display: block; padding: 0 10px">                                AttachmentView: media.view.Attachment.Selection
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         return media.view.Attachments.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6904,9 +6902,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        _.defaults( this.options, {
</span><span class="cx" style="display: block; padding: 0 10px">                                userSettings: false
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.Settings.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                        this.model.on( 'change:link', this.updateLinkTo, this );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7036,9 +7032,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        this.on( 'ready', this.initialFocus );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        /**
-                        * call 'initialize' directly on the parent class
-                        */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Call 'initialize' directly on the parent class.
</ins><span class="cx" style="display: block; padding: 0 10px">                         media.view.Attachment.prototype.initialize.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpincludesjswputiljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/wp-util.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/wp-util.js       2014-11-05 19:36:27 UTC (rev 30244)
+++ trunk/src/wp-includes/js/wp-util.js 2014-11-05 19:38:20 UTC (rev 30245)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * wp.template( id )
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Fetches a template by id.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Fetch a JavaScript template for an id, and return a templating function for it.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-".
</span><span class="cx" style="display: block; padding: 0 10px">         *                       For example, "attachment" maps to "tmpl-attachment".
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,6 +16,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        wp.template = _.memoize(function ( id ) {
</span><span class="cx" style="display: block; padding: 0 10px">                var compiled,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        /*
+                        * Underscore's default ERB-style templates are incompatible with PHP
+                        * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
+                        *
+                        * @see trac ticket #22344.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         options = {
</span><span class="cx" style="display: block; padding: 0 10px">                                evaluate:    /<#([\s\S]+?)#>/g,
</span><span class="cx" style="display: block; padding: 0 10px">                                interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
</span></span></pre>
</div>
</div>

</body>
</html>