Add attachment details to the media sidebar.

* Also moves most of the `Frame` view's `createSelection` method to a real `Selection` model (which inherits from the `Attachments` model).
* Properly assigns the library within the `Gallery` state, allowing for the `Gallery` state to inherit from the `Library` state.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22323 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-10-29 15:13:02 +00:00
parent 6e387bb2db
commit bc29728df2
4 changed files with 276 additions and 123 deletions
+34 -1
View File
@@ -1305,7 +1305,7 @@ function wp_print_media_templates( $attachment ) {
<script type="text/html" id="tmpl-uploader-window">
<div class="uploader-window-content">
<h3><?php _e( 'Drop files here to upload' ); ?></h3>
<h3><?php _e( 'Drop files to upload' ); ?></h3>
</div>
</script>
@@ -1358,6 +1358,39 @@ function wp_print_media_templates( $attachment ) {
<% } %>
</script>
<script type="text/html" id="tmpl-attachment-details">
<div class="attachment-preview attachment-details-preview type-<%- type %> subtype-<%- subtype %> <%- orientation %>">
<% if ( uploading ) { %>
<div class="media-progress-bar"><div></div></div>
<% } else if ( 'image' === type ) { %>
<div class="thumbnail">
<img src="<%- url %>" draggable="false" />
</div>
<% } else { %>
<div class="icon-thumbnail">
<img src="<%- icon %>" class="icon" draggable="false" />
<div class="filename"><%- filename %></div>
</div>
<% } %>
</div>
<% if ( 'image' === type ) { %>
<textarea class="describe"
placeholder="<?php esc_attr_e('Describe this image&hellip;'); ?>"
><%- caption %></textarea>
<% } else { %>
<textarea class="describe"
<% if ( 'video' === type ) { %>
placeholder="<?php esc_attr_e('Describe this video&hellip;'); ?>"
<% } else if ( 'audio' === type ) { %>
placeholder="<?php esc_attr_e('Describe this audio file&hellip;'); ?>"
<% } else { %>
placeholder="<?php esc_attr_e('Describe this media file&hellip;'); ?>"
<% } %>
><%- title %></textarea>
<% } %>
</script>
<script type="text/html" id="tmpl-media-selection-preview">
<div class="selected-img selected-count-<%- count %>">
<% if ( thumbnail ) { %>