<!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>[27051] trunk/src/wp-includes: For starters, [27050] is rad.</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">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/27051">27051</a></dd>
<dt>Author</dt> <dd>wonderboymusic</dd>
<dt>Date</dt> <dd>2014-01-28 23:20:04 +0000 (Tue, 28 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>For starters, <a href="http://core.trac.wordpress.org/changeset/27050">[27050]</a> is rad. This just cleans up some extra new lines that were littered about, updates *some* of the inline docs (needs more), moves `wp.media.controller.ImageDetails` closer to its parent class, and de-dupes some code in `media-template.php`.

See <a href="http://core.trac.wordpress.org/ticket/24409">#24409</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmediaeditorjs">trunk/src/wp-includes/js/media-editor.js</a></li>
<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="#trunksrcwpincludesjstinymcepluginswpeditimagepluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js</a></li>
<li><a href="#trunksrcwpincludesmediatemplatephp">trunk/src/wp-includes/media-template.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmediaeditorjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-editor.js (27050 => 27051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-editor.js 2014-01-28 21:16:42 UTC (rev 27050)
+++ trunk/src/wp-includes/js/media-editor.js    2014-01-28 23:20:04 UTC (rev 27051)
</span><span class="lines">@@ -447,6 +447,9 @@
</span><span class="cx">                   *
</span><span class="cx">                   * @param {string} content Content that is searched for possible
</span><span class="cx">                   *    shortcode markup matching the passed tag name,
</span><ins>+                        *
+                        * @this wp.media.gallery
+                        *
</ins><span class="cx">                    * @returns {wp.media.view.MediaFrame.Select} A media workflow.
</span><span class="cx">                   */
</span><span class="cx">                  edit: function( content ) {
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediamodelsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-models.js (27050 => 27051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-models.js 2014-01-28 21:16:42 UTC (rev 27050)
+++ trunk/src/wp-includes/js/media-models.js    2014-01-28 23:20:04 UTC (rev 27051)
</span><span class="lines">@@ -342,11 +342,10 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  /**
</span><del>-        * wp.media.model.Attachment
</del><ins>+         * wp.media.model.PostImage
</ins><span class="cx">    *
</span><span class="cx">   * @constructor
</span><span class="cx">   * @augments Backbone.Model
</span><del>-        *
</del><span class="cx">    **/
</span><span class="cx">  PostImage = media.model.PostImage = Backbone.Model.extend({
</span><span class="cx"> 
</span><span class="lines">@@ -354,7 +353,7 @@
</span><span class="cx">                  this.attachment = false;
</span><span class="cx"> 
</span><span class="cx">                  if ( attributes.attachment_id ) {
</span><del>-                               this.attachment = media.model.Attachment.get( attributes.attachment_id );
</del><ins>+                                this.attachment = Attachment.get( attributes.attachment_id );
</ins><span class="cx">                           this.dfd = this.attachment.fetch();
</span><span class="cx">                          this.bindAttachmentListeners();
</span><span class="cx">                  }
</span><span class="lines">@@ -364,7 +363,6 @@
</span><span class="cx">                  this.on( 'change:size', this.updateSize, this );
</span><span class="cx"> 
</span><span class="cx">                  this.setLinkTypeFromUrl();
</span><del>-
</del><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          bindAttachmentListeners: function() {
</span><span class="lines">@@ -411,10 +409,8 @@
</span><span class="cx">                  }
</span><span class="cx"> 
</span><span class="cx">                  this.set( 'link', type );
</span><del>-
</del><span class="cx">           },
</span><span class="cx"> 
</span><del>-
</del><span class="cx">           updateLinkUrl: function() {
</span><span class="cx">                  var link = this.get( 'link' ),
</span><span class="cx">                          url;
</span><span class="lines">@@ -434,9 +430,7 @@
</span><span class="cx">                          case 'none':
</span><span class="cx">                                  this.set( 'linkUrl', '' );
</span><span class="cx">                                  break;
</span><del>-
</del><span class="cx">                   }
</span><del>-
</del><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          updateSize: function() {
</span><span class="lines">@@ -450,10 +444,7 @@
</span><span class="cx">                  this.set( 'url', size.url );
</span><span class="cx">                  this.set( 'width', size.width );
</span><span class="cx">                  this.set( 'height', size.height );
</span><del>-
</del><span class="cx">           }
</span><del>-
-
</del><span class="cx">   });
</span><span class="cx"> 
</span><span class="cx">  /**
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-views.js (27050 => 27051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-views.js  2014-01-28 21:16:42 UTC (rev 27050)
+++ trunk/src/wp-includes/js/media-views.js     2014-01-28 23:20:04 UTC (rev 27051)
</span><span class="lines">@@ -726,6 +726,32 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  /**
</span><ins>+        * wp.media.controller.ImageDetails
+        *
+        * @constructor
+        * @augments wp.media.controller.State
+        * @augments Backbone.Model
+        */
+       media.controller.ImageDetails = media.controller.State.extend({
+               defaults: _.defaults({
+                       id: 'image-details',
+                       toolbar: 'image-details',
+                       title: l10n.imageDetailsTitle,
+                       content: 'image-details',
+                       menu: 'image-details',
+                       router: false,
+                       attachment: false,
+                       priority: 60,
+                       editing: false
+               }, media.controller.Library.prototype.defaults ),
+
+               initialize: function( options ) {
+                       this.image = options.image;
+                       media.controller.State.prototype.initialize.apply( this, arguments );
+               }
+       });
+
+       /**
</ins><span class="cx">    * wp.media.controller.GalleryEdit
</span><span class="cx">   *
</span><span class="cx">   * @constructor
</span><span class="lines">@@ -910,7 +936,6 @@
</span><span class="cx">                  toolbar:    'featured-image',
</span><span class="cx">                  title:      l10n.setFeaturedImageTitle,
</span><span class="cx">                  priority:   60,
</span><del>-
</del><span class="cx">                   syncSelection: false
</span><span class="cx">          }, media.controller.Library.prototype.defaults ),
</span><span class="cx"> 
</span><span class="lines">@@ -980,33 +1005,16 @@
</span><span class="cx">          }
</span><span class="cx">  });
</span><span class="cx"> 
</span><del>-
-       media.controller.ImageDetails = media.controller.State.extend({
-
-               defaults: _.defaults({
-                       id: 'image-details',
-                       toolbar: 'image-details',
-                       title: l10n.imageDetailsTitle,
-                       content: 'image-details',
-                       menu: 'image-details',
-                       router: false,
-                       attachment: false,
-                       priority: 60,
-                       editing: false
-               }, media.controller.Library.prototype.defaults ),
-
-               initialize: function( options ) {
-                       this.image = options.image;
-                       media.controller.State.prototype.initialize.apply( this, arguments );
-               }
-       });
-
</del><span class="cx">   /**
</span><span class="cx">   * wp.media.controller.ReplaceImage
</span><span class="cx">   *
</span><span class="cx">   * Replace a selected single image
</span><span class="cx">   *
</span><del>-        **/
</del><ins>+         * @constructor
+        * @augments wp.media.controller.Library
+        * @augments wp.media.controller.State
+        * @augments Backbone.Model
+        */
</ins><span class="cx">   media.controller.ReplaceImage = media.controller.Library.extend({
</span><span class="cx">          defaults: _.defaults({
</span><span class="cx">                  id:         'replace-image',
</span><span class="lines">@@ -1022,7 +1030,6 @@
</span><span class="cx">                  var library, comparator;
</span><span class="cx"> 
</span><span class="cx">                  this.image = options.image;
</span><del>-
</del><span class="cx">                   // If we haven't been provided a `library`, create a `Selection`.
</span><span class="cx">                  if ( ! this.get('library') ) {
</span><span class="cx">                          this.set( 'library', media.query({ type: 'image' }) );
</span><span class="lines">@@ -1075,10 +1082,7 @@
</span><span class="cx">                          attachment = this.image.attachment;
</span><span class="cx"> 
</span><span class="cx">                  selection.reset( attachment ? [ attachment ] : [] );
</span><del>-
</del><span class="cx">           }
</span><del>-
-
</del><span class="cx">   });
</span><span class="cx"> 
</span><span class="cx">  /**
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpeditimagepluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js (27050 => 27051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js   2014-01-28 21:16:42 UTC (rev 27050)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js      2014-01-28 23:20:04 UTC (rev 27051)
</span><span class="lines">@@ -143,7 +143,6 @@
</span><span class="cx">                  }
</span><span class="cx">          } );
</span><span class="cx"> 
</span><del>-
</del><span class="cx">           // extract caption
</span><span class="cx">          captionBlock = editor.dom.getParents( imageNode, '.wp-caption' );
</span><span class="cx"> 
</span><span class="lines">@@ -172,7 +171,6 @@
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          return metadata;
</span><del>-
</del><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx">  function updateImage( imageNode, imageData ) {
</span><span class="lines">@@ -223,7 +221,6 @@
</span><span class="cx">                  editor.selection.select( editor.dom.select( 'img', node )[0] );
</span><span class="cx">          }
</span><span class="cx">          editor.nodeChanged();
</span><del>-
</del><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx">  function createImageAndLink( imageData, mode ) {
</span><span class="lines">@@ -232,7 +229,6 @@
</span><span class="cx"> 
</span><span class="cx">          mode = mode ? mode : 'node';
</span><span class="cx"> 
</span><del>-
</del><span class="cx">           if ( ! imageData.caption ) {
</span><span class="cx">                  classes.push( 'align' + imageData.align );
</span><span class="cx">          }
</span><span class="lines">@@ -261,13 +257,10 @@
</span><span class="cx">                  } else if ( mode === 'html' ) {
</span><span class="cx">                          return editor.dom.createHTML( 'a', { href: imageData.linkUrl }, editor.dom.createHTML( 'img', props ) );
</span><span class="cx">                  }
</span><del>-               } else {
-                       if ( mode === 'node' ) {
-                               return editor.dom.create( 'img', props );
-                       } else if ( mode === 'html' ) {
-                               return editor.dom.createHTML( 'img', props );
-                       }
-
</del><ins>+                } else if ( mode === 'node' ) {
+                       return editor.dom.create( 'img', props );
+               } else if ( mode === 'html' ) {
+                       return editor.dom.createHTML( 'img', props );
</ins><span class="cx">           }
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -650,8 +643,6 @@
</span><span class="cx">                          frame.state('replace-image').on( 'replace', callback );
</span><span class="cx"> 
</span><span class="cx">                          frame.open();
</span><del>-
-
</del><span class="cx">                   }
</span><span class="cx">          }
</span><span class="cx">  } );
</span></span></pre></div>
<a id="trunksrcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media-template.php (27050 => 27051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media-template.php 2014-01-28 21:16:42 UTC (rev 27050)
+++ trunk/src/wp-includes/media-template.php    2014-01-28 23:20:04 UTC (rev 27051)
</span><span class="lines">@@ -546,30 +546,20 @@
</span><span class="cx">                                  </div>
</span><span class="cx">                          </div>
</span><span class="cx">                          <div class="setting link-to">
</span><del>-                               <span><?php _e('Link To'); ?></span>
-
-                               <# if ( data.attachment ) { #>
</del><ins>+                                        <span><?php _e('Link To'); ?></span>
</ins><span class="cx">                                   <div class="button-group button-large" data-setting="link">
</span><ins>+                                       <# if ( data.attachment ) { #>
</ins><span class="cx">                                           <button class="button" value="file">
</span><span class="cx">                                                  <?php esc_attr_e('Media File'); ?>
</span><span class="cx">                                          </button>
</span><span class="cx">                                          <button class="button" value="post">
</span><span class="cx">                                                  <?php esc_attr_e('Attachment Page'); ?>
</span><span class="cx">                                          </button>
</span><del>-                                               <button class="button" value="custom">
-                                                       <?php esc_attr_e('Custom URL'); ?>
-                                               </button>
-                                               <button class="button active" value="none">
-                                                       <?php esc_attr_e('None'); ?>
-                                               </button>
-                                       </div>
-                                       <input type="text" class="link-to-custom" data-setting="linkUrl" />
-
-                               <# } else { #>
-                                       <div class="button-group button-large" data-setting="link">
</del><ins>+                                        <# } else { #>
</ins><span class="cx">                                           <button class="button" value="file">
</span><span class="cx">                                                  <?php esc_attr_e('Image URL'); ?>
</span><span class="cx">                                          </button>
</span><ins>+                                       <# } #>
</ins><span class="cx">                                           <button class="button" value="custom">
</span><span class="cx">                                                  <?php esc_attr_e('Custom URL'); ?>
</span><span class="cx">                                          </button>
</span><span class="lines">@@ -578,8 +568,6 @@
</span><span class="cx">                                          </button>
</span><span class="cx">                                  </div>
</span><span class="cx">                                  <input type="text" class="link-to-custom" data-setting="linkUrl" />
</span><del>-
-                               <# } #>
</del><span class="cx">                           </div>
</span><span class="cx"> 
</span><span class="cx">                          <# if ( data.attachment ) { #>
</span><span class="lines">@@ -596,8 +584,7 @@
</span><span class="cx">                                                  ) );
</span><span class="cx"> 
</span><span class="cx">                                                  foreach ( $sizes as $value => $name ) : ?>
</span><del>-                                                               <#
-                                                               var size = data.attachment.sizes['<?php echo esc_js( $value ); ?>'];
</del><ins>+                                                                <# var size = data.attachment.sizes['<?php echo esc_js( $value ); ?>'];
</ins><span class="cx">                                                           if ( size ) { #>
</span><span class="cx">                                                                  <button class="button" value="<?php echo esc_attr( $value ); ?>">
</span><span class="cx">                                                                          <?php echo esc_html( $name ); ?>
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media.php (27050 => 27051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media.php  2014-01-28 21:16:42 UTC (rev 27050)
+++ trunk/src/wp-includes/media.php     2014-01-28 23:20:04 UTC (rev 27051)
</span><span class="lines">@@ -2008,7 +2008,6 @@
</span><span class="cx">          'addToGalleryTitle'  => __( 'Add to Gallery' ),
</span><span class="cx">          'reverseOrder'       => __( 'Reverse order' ),
</span><span class="cx"> 
</span><del>-
</del><span class="cx">           // Edit Image
</span><span class="cx">          'imageDetailsTitle'     => __( 'Image Details' ),
</span><span class="cx">          'imageReplaceTitle'     => __( 'Replace Image' ),
</span></span></pre>
</div>
</div>

</body>
</html>