<!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>[29204] trunk/src/wp-includes: Media Grid Attachment Details modal UI improvements:</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/29204">29204</a></dd>
<dt>Author</dt> <dd>helen</dd>
<dt>Date</dt> <dd>2014-07-17 03:54:44 +0000 (Thu, 17 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Media Grid Attachment Details modal UI improvements:

* Align better visually with the existing media modal and the post image edit modal.
* Add back a link to the full attachment edit screen (post.php).
* Add a title to the modal and move prev/next buttons next to the more-consistent close button.
* Remove mode tabs (metadata vs. image editing) in favor of the Edit Image button.

Still to come: responsive, IE8 testing and targeted CSS (calc() usage), general CSS cleanup.

props ericlewis, helen, melchoyce. see <a href="http://core.trac.wordpress.org/ticket/28844">#28844</a>. fixes <a href="http://core.trac.wordpress.org/ticket/28915">#28915</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludescssmediaviewscss">trunk/src/wp-includes/css/media-views.css</a></li>
<li><a href="#trunksrcwpincludesjsmediagridjs">trunk/src/wp-includes/js/media-grid.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="trunksrcwpincludescssmediaviewscss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/css/media-views.css (29203 => 29204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/css/media-views.css        2014-07-17 00:58:41 UTC (rev 29203)
+++ trunk/src/wp-includes/css/media-views.css   2014-07-17 03:54:44 UTC (rev 29204)
</span><span class="lines">@@ -1525,35 +1525,34 @@
</span><span class="cx">  margin-top: 14px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.media-sidebar .settings-save-status {
-       background: #f5f5f5;
</del><ins>+/**
+ * Attachment Details
+ */
+.attachment-details {
+       position: relative;
+       overflow: auto;
+}
+
+.attachment-details .settings-save-status {
</ins><span class="cx">   float: right;
</span><span class="cx">  text-transform: none;
</span><span class="cx">  z-index: 10;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.media-sidebar .settings-save-status .spinner {
</del><ins>+.attachment-details .settings-save-status .spinner {
</ins><span class="cx">   margin: 0 5px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.media-sidebar .settings-save-status .saved {
</del><ins>+.attachment-details .settings-save-status .saved {
</ins><span class="cx">   float: right;
</span><span class="cx">  display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.media-sidebar .save-waiting .settings-save-status .spinner,
-.media-sidebar .save-complete .settings-save-status .saved {
</del><ins>+.attachment-details.save-waiting .settings-save-status .spinner,
+.attachment-details.save-complete .settings-save-status .saved {
</ins><span class="cx">   display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-/**
- * Attachment Details
- */
-.attachment-details {
-       position: relative;
-       overflow: auto;
-}
-
</del><span class="cx"> .attachment-info {
</span><span class="cx">  overflow: hidden;
</span><span class="cx">  min-height: 60px;
</span><span class="lines">@@ -1645,13 +1644,13 @@
</span><span class="cx">  display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-info .delete-attachment,
-.attachment-info .trash-attachment {
</del><ins>+.media-modal .delete-attachment,
+.media-modal .trash-attachment {
</ins><span class="cx">   color: #bc0b0b;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-info .delete-attachment:hover,
-.attachment-info .trash-attachment:hover {
</del><ins>+.media-modal .delete-attachment:hover,
+.media-modal .trash-attachment:hover {
</ins><span class="cx">   color: red;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2670,19 +2669,59 @@
</span><span class="cx">  *
</span><span class="cx">  * This should be OOCSS'd so both use a shared selector.
</span><span class="cx">  */
</span><ins>+.edit-attachment-frame .edit-media-header {
+       overflow: hidden;
+}
+
+.upload-php .media-modal-close .media-modal-icon:before {
+       content: '\f335';
+       font-size: 30px;
+}
+
+.upload-php .media-modal-close:hover .media-modal-icon:before,
+.upload-php .media-modal-close:focus .media-modal-icon:before {
+       color: #fff;
+}
+
+.upload-php .media-modal-close .media-modal-icon {
+       margin-top: 13px;
+       width: 30px;
+       height: 30px;
+}
+
+.upload-php .media-modal-close,
</ins><span class="cx"> .edit-attachment-frame .edit-media-header .left,
</span><span class="cx"> .edit-attachment-frame .edit-media-header .right {
</span><span class="cx">  cursor: pointer;
</span><span class="cx">  color: #777;
</span><span class="cx">  background-color: transparent;
</span><del>-       height: 48px;
-       width: 54px;
-       float: left;
</del><ins>+        height: 56px;
+       width: 56px;
+       padding: 0;
+       position: absolute;
</ins><span class="cx">   text-align: center;
</span><span class="cx">  border: 0;
</span><del>-       border-right: 1px solid #ddd;
</del><ins>+        border-left: 1px solid #ddd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.upload-php .media-modal-close {
+       top: 0;
+       right: 0;
+}
+
+.edit-attachment-frame .edit-media-header .left {
+       right: 112px;
+}
+
+.edit-attachment-frame .edit-media-header .right {
+       right: 56px;
+}
+
+.edit-attachment-frame .media-frame-title {
+       left: 0;
+       right: 170px; /* leave space for prev/next/close */
+}
+
</ins><span class="cx"> .edit-attachment-frame .edit-media-header .right:before,
</span><span class="cx"> .edit-attachment-frame .edit-media-header .left:before {
</span><span class="cx">  font: normal 20px/50px 'dashicons' !important;
</span><span class="lines">@@ -2711,10 +2750,10 @@
</span><span class="cx">  cursor: inherit;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .edit-media-header .close:hover,
</del><ins>+.upload-php .media-modal-close:hover,
</ins><span class="cx"> .edit-attachment-frame .edit-media-header .right:hover,
</span><span class="cx"> .edit-attachment-frame .edit-media-header .left:hover,
</span><del>-.edit-attachment-frame .edit-media-header .close:focus,
</del><ins>+.upload-php .media-modal-close:focus,
</ins><span class="cx"> .edit-attachment-frame .edit-media-header .right:focus,
</span><span class="cx"> .edit-attachment-frame .edit-media-header .left:focus {
</span><span class="cx">  background: #0074a2;
</span><span class="lines">@@ -2729,6 +2768,7 @@
</span><span class="cx"> .edit-attachment-frame .media-frame-content {
</span><span class="cx">  border-bottom: none;
</span><span class="cx">  bottom: 0;
</span><ins>+       top: 56px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* Hiding this for the moment instead of removing it from the template. */
</span><span class="lines">@@ -2743,94 +2783,100 @@
</span><span class="cx">  bottom: 0;
</span><span class="cx">  right: 0;
</span><span class="cx">  left: 0;
</span><ins>+       -webkit-box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+       box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
</ins><span class="cx"> }
</span><del>-
-.edit-attachment-frame .attachment-info {
-       border-bottom: 0;
-       border-right: 1px solid #ddd;
-       bottom: 0;
-       position: absolute;
-       top: 0;
-       left: 0;
-       right: 50%;
-       margin-bottom: 0;
-       padding: 2% 4% 0;
-       height: 98%; /* 100% - padding percentage above */
</del><ins>+.edit-attachment-frame .attachment-media-view {
+       float: left;
+       width: 65%;
+       height: 100%;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-info .thumbnail {
-       float: none;
-       max-width: none;
-       max-height: 70%;
-       margin-right: 0;
</del><ins>+.edit-attachment-frame .attachment-media-view .thumbnail {
+       -webkit-box-sizing: border-box;
+       -moz-box-sizing: border-box;
+       box-sizing: border-box;
+       padding: 16px;
+       height: 100%;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-info .thumbnail-image img {
-       margin: 0;
-}
-
-.edit-attachment-frame .attachment-info .thumbnail-image:after {
-       -webkit-box-shadow: none;
-               box-shadow: none;
-}
-
-.edit-attachment-frame .attachment-info .thumbnail img {
</del><ins>+.edit-attachment-frame .attachment-media-view img {
+       display: block;
+       margin-bottom: 16px;
</ins><span class="cx">   max-width: 100%;
</span><del>-       max-height: 100%;
</del><ins>+        max-height: -webkit-calc( 100% - 42px );
+       max-height: calc( 100% - 42px ); /* leave space for actions underneath */
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-info .details {
-       float: none;
</del><ins>+.edit-attachment-frame .delete-attachment {
+       float: right;
+       margin-top: 7px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .edit-attachment-frame .wp-media-wrapper {
</span><span class="cx">  margin-bottom: 12px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields {
-       bottom: 0;
-       padding: 2% 4%;
-       position: absolute;
-       top: 0;
-       left: 50%;
-       right: 0;
</del><ins>+.edit-attachment-frame .attachment-info {
+       overflow: auto;
+       -webkit-box-sizing: border-box;
+       -moz-box-sizing: border-box;
+       box-sizing: border-box;
+       margin-bottom: 0;
+       padding: 12px 16px 0;
+       width: 35%;
+       height: 100%;
+       -webkit-box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+       box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+       border-bottom: 0;
+       border-left: 1px solid #ddd;
+       background: #f3f3f3;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting {
</del><ins>+.edit-attachment-frame .attachment-info .details,
+.edit-attachment-frame .attachment-info .settings {
+       overflow: hidden;
+       float: none;
+       margin-bottom: 15px;
+       padding-bottom: 15px;
+       border-bottom: 1px solid #ddd;
+}
+
+.edit-attachment-frame .attachment-info .setting {
</ins><span class="cx">   display: block;
</span><span class="cx">  float: left;
</span><span class="cx">  width: 100%;
</span><span class="cx">  margin: 1px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting label {
</del><ins>+.edit-attachment-frame .attachment-info .setting label {
</ins><span class="cx">   display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting .link-to-custom {
</del><ins>+.edit-attachment-frame .attachment-info .setting .link-to-custom {
</ins><span class="cx">   margin: 3px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting .name {
</del><ins>+.edit-attachment-frame .attachment-info .setting .name {
</ins><span class="cx">   min-width: 30%;
</span><span class="cx">  margin-right: 4%;
</span><span class="cx">  font-size: 12px;
</span><span class="cx">  text-align: right;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting select {
</del><ins>+.edit-attachment-frame .attachment-info .setting select {
</ins><span class="cx">   max-width: 65%;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting input[type="checkbox"],
-.edit-attachment-frame .attachment-fields .field input[type="checkbox"] {
</del><ins>+.edit-attachment-frame .attachment-info .setting input[type="checkbox"],
+.edit-attachment-frame .attachment-info .field input[type="checkbox"] {
</ins><span class="cx">   width: 16px;
</span><span class="cx">  float: none;
</span><span class="cx">  margin: 8px 3px 0;
</span><span class="cx">  padding: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting span {
</del><ins>+.edit-attachment-frame .attachment-info .setting span {
</ins><span class="cx">   float: left;
</span><span class="cx">  min-height: 22px;
</span><span class="cx">  padding-top: 8px;
</span><span class="lines">@@ -2839,14 +2885,14 @@
</span><span class="cx">  color: #666;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting input[type="text"],
-.edit-attachment-frame .attachment-fields .setting input[type="password"],
-.edit-attachment-frame .attachment-fields .setting input[type="number"],
-.edit-attachment-frame .attachment-fields .setting input[type="search"],
-.edit-attachment-frame .attachment-fields .setting input[type="email"],
-.edit-attachment-frame .attachment-fields .setting input[type="url"],
-.edit-attachment-frame .attachment-fields .setting textarea,
-.edit-attachment-frame .attachment-fields .setting .value {
</del><ins>+.edit-attachment-frame .attachment-info .setting input[type="text"],
+.edit-attachment-frame .attachment-info .setting input[type="password"],
+.edit-attachment-frame .attachment-info .setting input[type="number"],
+.edit-attachment-frame .attachment-info .setting input[type="search"],
+.edit-attachment-frame .attachment-info .setting input[type="email"],
+.edit-attachment-frame .attachment-info .setting input[type="url"],
+.edit-attachment-frame .attachment-info .setting textarea,
+.edit-attachment-frame .attachment-info .setting .value {
</ins><span class="cx">   margin: 1px;
</span><span class="cx">  width: 65%;
</span><span class="cx">  float: right;
</span><span class="lines">@@ -2856,12 +2902,12 @@
</span><span class="cx">  box-sizing: border-box;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields .setting textarea {
</del><ins>+.edit-attachment-frame .attachment-info .setting textarea {
</ins><span class="cx">   height: 62px;
</span><span class="cx">  resize: vertical;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.edit-attachment-frame .attachment-fields select {
</del><ins>+.edit-attachment-frame .attachment-info select {
</ins><span class="cx">   margin-top: 3px;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediagridjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-grid.js (29203 => 29204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-grid.js   2014-07-17 00:58:41 UTC (rev 29203)
+++ trunk/src/wp-includes/js/media-grid.js      2014-07-17 03:54:44 UTC (rev 29204)
</span><span class="lines">@@ -11,19 +11,18 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  /**
</span><del>-        * A state for editing (cropping, etc.) an image.
</del><ins>+         * A state for editing an attachment's metadata.
</ins><span class="cx">    *
</span><span class="cx">   * @constructor
</span><span class="cx">   * @augments wp.media.controller.State
</span><span class="cx">   * @augments Backbone.Model
</span><span class="cx">   */
</span><del>-       media.controller.EditImageNoFrame = media.controller.State.extend({
</del><ins>+        media.controller.EditAttachmentMetadata = media.controller.State.extend({
</ins><span class="cx">           defaults: {
</span><span class="cx">                  id:      'edit-attachment',
</span><del>-                       title:   l10n.editImage,
</del><ins>+                        title:   l10n.attachmentDetails,
</ins><span class="cx">                   // Region mode defaults.
</span><span class="cx">                  menu:    false,
</span><del>-                       router:  'edit-metadata',
</del><span class="cx">                   content: 'edit-metadata',
</span><span class="cx"> 
</span><span class="cx">                  url:     ''
</span><span class="lines">@@ -36,30 +35,24 @@
</span><span class="cx">           * include the regions expected there.
</span><span class="cx">           */
</span><span class="cx">          _postActivate: function() {
</span><ins>+                       this.frame.on( 'title:render:default', this._renderTitle, this );
+
+                       this._title();
</ins><span class="cx">                   this._content();
</span><del>-                       this._router();
</del><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          /**
</span><span class="cx">           * @access private
</span><span class="cx">           */
</span><del>-               _router: function() {
-                       var router = this.frame.router,
-                               mode = this.get('router'),
-                               view;
-
-                       this.frame.$el.toggleClass( 'hide-router', ! mode );
-                       if ( ! mode ) {
-                               return;
-                       }
-
-                       this.frame.router.render( mode );
-
-                       view = router.get();
-                       if ( view && view.select ) {
-                               view.select( this.frame.content.mode() );
-                       }
</del><ins>+                _title: function() {
+                       this.frame.title.render( this.get('titleMode') || 'default' );
</ins><span class="cx">           },
</span><ins>+               /**
+                * @access private
+                */
+               _renderTitle: function( view ) {
+                       view.$el.text( this.get('title') || '' );
+               },
</ins><span class="cx"> 
</span><span class="cx">          _content: function() {
</span><span class="cx">                  var mode = this.get( 'content' );
</span><span class="lines">@@ -286,6 +279,18 @@
</span><span class="cx">  media.view.Attachment.Details.TwoColumn = media.view.Attachment.Details.extend({
</span><span class="cx">          template: wp.template( 'attachment-details-two-column' ),
</span><span class="cx"> 
</span><ins>+               events: {
+                       'change [data-setting]':          'updateSetting',
+                       'change [data-setting] input':    'updateSetting',
+                       'change [data-setting] select':   'updateSetting',
+                       'change [data-setting] textarea': 'updateSetting',
+                       'click .delete-attachment':       'deleteAttachment',
+                       'click .trash-attachment':        'trashAttachment',
+                       'click .edit-attachment':         'editAttachment',
+                       'click .refresh-attachment':      'refreshAttachment',
+                       'click .edit-image':              'handleEditImageClick'
+               },
+
</ins><span class="cx">           initialize: function() {
</span><span class="cx">                  if ( ! this.model ) {
</span><span class="cx">                          return;
</span><span class="lines">@@ -322,6 +327,10 @@
</span><span class="cx">                  media.view.Attachment.Details.prototype.deleteAttachment.apply( this, arguments );
</span><span class="cx">          },
</span><span class="cx"> 
</span><ins>+               handleEditImageClick: function() {
+                       this.controller.setState( 'edit-image' );
+               },
+
</ins><span class="cx">           afterDelete: function( model ) {
</span><span class="cx">                  if ( ! model.destroyed ) {
</span><span class="cx">                          return;
</span><span class="lines">@@ -405,11 +414,11 @@
</span><span class="cx">   *
</span><span class="cx">   * Requires an attachment model to be passed in the options hash under `model`.
</span><span class="cx">   */
</span><del>-       media.view.MediaFrame.EditAttachments = media.view.Frame.extend({
</del><ins>+        media.view.MediaFrame.EditAttachments = media.view.MediaFrame.extend({
</ins><span class="cx"> 
</span><span class="cx">          className: 'edit-attachment-frame',
</span><span class="cx">          template: media.template( 'edit-attachment-frame' ),
</span><del>-               regions:   [ 'router', 'content' ],
</del><ins>+                regions:   [ 'title', 'content' ],
</ins><span class="cx"> 
</span><span class="cx">          events: {
</span><span class="cx">                  'click':                    'collapse',
</span><span class="lines">@@ -440,9 +449,11 @@
</span><span class="cx">                  this.on( 'content:render:edit-metadata', this.editMetadataContent, this );
</span><span class="cx">                  this.on( 'content:render:edit-image', this.editImageContentUgh, this );
</span><span class="cx">                  this.on( 'close', this.detach );
</span><del>-                       this.on( 'router:create', this.createRouter, this );
-                       this.on( 'router:render', this.browseRouter, this );
</del><span class="cx"> 
</span><ins>+                       // Bind default title creation.
+                       this.on( 'title:create:default', this.createTitle, this );
+                       this.title.mode('default');
+
</ins><span class="cx">                   this.options.hasPrevious = this.hasPrevious();
</span><span class="cx">                  this.options.hasNext = this.hasNext();
</span><span class="cx"> 
</span><span class="lines">@@ -474,26 +485,19 @@
</span><span class="cx">           * Add the default states to the frame.
</span><span class="cx">           */
</span><span class="cx">          createStates: function() {
</span><ins>+                       var editImageState = new media.controller.EditImage( { model: this.model } );
+                       // Noop some methods.
+                       editImageState._toolbar = function() {};
+                       editImageState._router = function() {};
+                       editImageState._menu = function() {};
</ins><span class="cx">                   this.states.add([
</span><del>-                               new media.controller.EditImageNoFrame( { model: this.model } )
</del><ins>+                                new media.controller.EditAttachmentMetadata( { model: this.model } ),
+                               editImageState
+
</ins><span class="cx">                   ]);
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          /**
</span><del>-                * @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
-                */
-               render: function() {
-                       // Activate the default state if no active state exists.
-                       if ( ! this.state() && this.options.state ) {
-                               this.setState( this.options.state );
-                       }
-                       /**
-                        * call 'render' directly on the parent class
-                        */
-                       return media.view.Frame.prototype.render.apply( this, arguments );
-               },
-
-               /**
</del><span class="cx">            * Content region rendering callback for the `edit-metadata` mode.
</span><span class="cx">           */
</span><span class="cx">          editMetadataContent: function() {
</span><span class="lines">@@ -530,42 +534,6 @@
</span><span class="cx">                  view.loadEditor();
</span><span class="cx">          },
</span><span class="cx"> 
</span><del>-               /**
-                * Create the router view.
-                *
-                * @param {Object} router
-                * @this wp.media.controller.Region
-                */
-               createRouter: function( router ) {
-                       router.view = new media.view.Router({
-                               controller: this
-                       });
-               },
-
-               /**
-                * Router rendering callback.
-                *
-                * @param  media.view.Router view Instantiated in this.createRouter()
-                */
-               browseRouter: function( view ) {
-                       view.set({
-                               'edit-metadata': {
-                                       text:     l10n.editMetadata,
-                                       priority: 20
-                               }
-                       });
-
-                       // Only need a tab to Edit Image for images.
-                       if ( 'undefined' !== typeof this.model && this.model.get( 'type' ) === 'image' ) {
-                               view.set({
-                                       'edit-image': {
-                                               text:     l10n.editImage,
-                                               priority: 40
-                                       }
-                               });
-                       }
-               },
-
</del><span class="cx">           resetContent: function() {
</span><span class="cx">                  this.modal.close();
</span><span class="cx">                  wp.media( {
</span></span></pre></div>
<a id="trunksrcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media-template.php (29203 => 29204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media-template.php 2014-07-17 00:58:41 UTC (rev 29203)
+++ trunk/src/wp-includes/media-template.php    2014-07-17 03:54:44 UTC (rev 29204)
</span><span class="lines">@@ -255,23 +255,18 @@
</span><span class="cx"> 
</span><span class="cx">  <script type="text/html" id="tmpl-edit-attachment-frame">
</span><span class="cx">          <div class="edit-media-header">
</span><del>-                       <button class="left dashicons dashicons-no<# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button>
-                       <button class="right dashicons dashicons-no<# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button>
</del><ins>+                        <button class="left dashicons <# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button>
+                       <button class="right dashicons <# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button>
</ins><span class="cx">           </div>
</span><del>-               <div class="media-frame-router"></div>
</del><ins>+                <div class="media-frame-title"></div>
</ins><span class="cx">           <div class="media-frame-content"></div>
</span><span class="cx">  </script>
</span><span class="cx"> 
</span><span class="cx">  <script type="text/html" id="tmpl-attachment-details-two-column">
</span><span class="cx">          <h3>
</span><span class="cx">                  <?php _e('Attachment Details'); ?>
</span><del>-
-                       <span class="settings-save-status">
-                               <span class="spinner"></span>
-                               <span class="saved"><?php esc_html_e('Saved.'); ?></span>
-                       </span>
</del><span class="cx">           </h3>
</span><del>-               <div class="attachment-info">
</del><ins>+                <div class="attachment-media-view">
</ins><span class="cx">                   <div class="thumbnail thumbnail-{{ data.type }}">
</span><span class="cx">                          <# if ( data.uploading ) { #>
</span><span class="cx">                                  <div class="media-progress-bar"><div></div></div>
</span><span class="lines">@@ -280,22 +275,43 @@
</span><span class="cx">                          <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #>
</span><span class="cx">                                  <img src="{{ data.icon }}" class="icon" draggable="false" />
</span><span class="cx">                          <# } #>
</span><ins>+
+                               <# if ( 'audio' === data.type ) { #>
+                               <div class="wp-media-wrapper">
+                                       <audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none">
+                                               <source type="{{ data.mime }}" src="{{ data.url }}"/>
+                                       </audio>
+                               </div>
+                               <# } else if ( 'video' === data.type ) { #>
+                               <div style="max-width: 100%; width: {{ data.width }}px" class="wp-media-wrapper">
+                                       <video controls class="wp-video-shortcode" preload="metadata"
+                                               width="{{ data.width }}" height="{{ data.height }}"
+                                               <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>>
+                                               <source type="{{ data.mime }}" src="{{ data.url }}"/>
+                                       </video>
+                               </div>
+                               <# } #>
+
+                               <div class="attachment-actions">
+                                       <# if ( 'image' === data.type && ! data.uploading ) { #>
+                                               <a class="button edit-image" href="#"><?php _e( 'Edit Image' ); ?></a>
+                                       <# } #>
+
+                                       <# if ( ! data.uploading && data.can.remove ) { #>
+                                               <?php if ( MEDIA_TRASH ): ?>
+                                                       <a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>
+                                               <?php else: ?>
+                                                       <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
+                                               <?php endif; ?>
+                                       <# } #>
+                               </div>
</ins><span class="cx">                   </div>
</span><del>-                       <# if ( 'audio' === data.type ) { #>
-                       <div class="wp-media-wrapper">
-                               <audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none">
-                                       <source type="{{ data.mime }}" src="{{ data.url }}"/>
-                               </audio>
-                       </div>
-                       <# } else if ( 'video' === data.type ) { #>
-                       <div style="max-width: 100%; width: {{ data.width }}px" class="wp-media-wrapper">
-                               <video controls class="wp-video-shortcode" preload="metadata"
-                                       width="{{ data.width }}" height="{{ data.height }}"
-                                       <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>>
-                                       <source type="{{ data.mime }}" src="{{ data.url }}"/>
-                               </video>
-                       </div>
-                       <# } #>
</del><ins>+                </div>
+               <div class="attachment-info">
+                       <span class="settings-save-status">
+                               <span class="spinner"></span>
+                               <span class="saved"><?php esc_html_e('Saved.'); ?></span>
+                       </span>
</ins><span class="cx">                   <div class="details">
</span><span class="cx">                          <div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div>
</span><span class="cx">                          <div class="filename"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div>
</span><span class="lines">@@ -321,67 +337,62 @@
</span><span class="cx">                                  </div>
</span><span class="cx">                          <# } #>
</span><span class="cx"> 
</span><del>-                               <# if ( ! data.uploading && data.can.remove ) { #>
-                                       <?php if ( MEDIA_TRASH ): ?>
-                                               <a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>
-                                       <?php else: ?>
-                                               <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
-                                       <?php endif; ?>
-                               <# } #>
-
</del><span class="cx">                           <div class="compat-meta">
</span><span class="cx">                                  <# if ( data.compat && data.compat.meta ) { #>
</span><span class="cx">                                          {{{ data.compat.meta }}}
</span><span class="cx">                                  <# } #>
</span><span class="cx">                          </div>
</span><span class="cx">                  </div>
</span><del>-               </div>
-               <div class="attachment-fields">
-                       <label class="setting" data-setting="url">
-                               <span class="name"><?php _e('URL'); ?></span>
-                               <input type="text" value="{{ data.url }}" readonly />
-                       </label>
-                       <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
-                       <label class="setting" data-setting="title">
-                               <span class="name"><?php _e('Title'); ?></span>
-                               <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
-                       </label>
-                       <# if ( 'audio' === data.type ) { #>
-                       <?php foreach ( array(
-                               'artist' => __( 'Artist' ),
-                               'album' => __( 'Album' ),
-                       ) as $key => $label ) : ?>
-                       <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
-                               <span class="name"><?php echo $label ?></span>
-                               <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
-                       </label>
-                       <?php endforeach; ?>
-                       <# } #>
-                       <label class="setting" data-setting="caption">
-                               <span class="name"><?php _e('Caption'); ?></span>
-                               <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>
-                       </label>
-                       <# if ( 'image' === data.type ) { #>
-                               <label class="setting" data-setting="alt">
-                                       <span class="name"><?php _e('Alt Text'); ?></span>
-                                       <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />
</del><ins>+
+                       <div class="settings">
+                               <label class="setting" data-setting="url">
+                                       <span class="name"><?php _e('URL'); ?></span>
+                                       <input type="text" value="{{ data.url }}" readonly />
</ins><span class="cx">                           </label>
</span><del>-                       <# } #>
-                       <label class="setting" data-setting="description">
-                               <span class="name"><?php _e('Description'); ?></span>
-                               <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea>
-                       </label>
-                       <label class="setting">
-                               <span class="name"><?php _e( 'Uploaded By' ); ?></span>
-                               <span class="value">{{ data.authorName }}</span>
-                       </label>
-                       <# if ( data.uploadedTo ) { #>
</del><ins>+                                <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
+                               <label class="setting" data-setting="title">
+                                       <span class="name"><?php _e('Title'); ?></span>
+                                       <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
+                               </label>
+                               <# if ( 'audio' === data.type ) { #>
+                               <?php foreach ( array(
+                                       'artist' => __( 'Artist' ),
+                                       'album' => __( 'Album' ),
+                               ) as $key => $label ) : ?>
+                               <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
+                                       <span class="name"><?php echo $label ?></span>
+                                       <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
+                               </label>
+                               <?php endforeach; ?>
+                               <# } #>
+                               <label class="setting" data-setting="caption">
+                                       <span class="name"><?php _e( 'Caption' ); ?></span>
+                                       <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>
+                               </label>
+                               <# if ( 'image' === data.type ) { #>
+                                       <label class="setting" data-setting="alt">
+                                               <span class="name"><?php _e( 'Alt Text' ); ?></span>
+                                               <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />
+                                       </label>
+                               <# } #>
+                               <label class="setting" data-setting="description">
+                                       <span class="name"><?php _e('Description'); ?></span>
+                                       <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea>
+                               </label>
</ins><span class="cx">                           <label class="setting">
</span><del>-                                       <span class="name"><?php _e('Uploaded To'); ?></span>
-                                       <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
</del><ins>+                                        <span class="name"><?php _e( 'Uploaded By' ); ?></span>
+                                       <span class="value">{{ data.authorName }}</span>
</ins><span class="cx">                           </label>
</span><del>-                       <# } #>
</del><ins>+                                <# if ( data.uploadedTo ) { #>
+                                       <label class="setting">
+                                               <span class="name"><?php _e( 'Uploaded To' ); ?></span>
+                                               <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
+                                       </label>
+                               <# } #>
+                       </div>
</ins><span class="cx"> 
</span><ins>+                       <a href="post.php?post={{ data.id }}&action=edit"><?php _e( 'Edit more details' ); ?></a>
+
</ins><span class="cx">           </div>
</span><span class="cx">  </script>
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media.php (29203 => 29204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media.php  2014-07-17 00:58:41 UTC (rev 29203)
+++ trunk/src/wp-includes/media.php     2014-07-17 03:54:44 UTC (rev 29204)
</span><span class="lines">@@ -2909,6 +2909,9 @@
</span><span class="cx">          'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ),
</span><span class="cx">          'warnDelete' =>      __( "You are about to permanently delete this item.\n  'Cancel' to stop, 'OK' to delete." ),
</span><span class="cx"> 
</span><ins>+               // Library Details
+               'attachmentDetails'  => __( 'Attachment Details' ),
+
</ins><span class="cx">           // From URL
</span><span class="cx">          'insertFromUrlTitle' => __( 'Insert from URL' ),
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>