Make WordPress Core


Ignore:
Timestamp:
10/28/2012 11:29:17 PM (14 years ago)
Author:
koopersmith
Message:

Give media a heart transplant.

Revises the concept of the media controller and workspace views (i.e. two central points of control) to be more granular. The main media object is now the Frame, which is a hybrid view and state machine.

The state machine is a collection of states, which are just generic instances of Backbone.Model. This circumvents the problem of juggling global parameters when changing states. Each state contains its own event loop. All events are also forwarded to the frame itself (as is the case in all model/collection relationships).

The frame view contains several regions, each of which can be overridden without harming or re-rendering the other regions. These work well when used in conjunction with the state machine events.

This removes the upload sidebar (don't worry, visible upload UI will return). Drag and drop uploading still works. The ability to upload has been abstracted into its own view (instead of being attached to the central workspace view).

Editing galleries is temporarily broken — the gallery creation and editing experiences will be unified in a future patch.

Adds events to detect dragging changes in wp.Uploader and adds methods to detect and leverage browser support for CSS3 transitions.

see #21390, #21809.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r22247 r22320  
    13001300                        <h3 class="media-modal-title"><%- title %></h3>
    13011301                        <a class="media-modal-close" href="" title="<?php esc_attr_e('Close'); ?>">&times;</a>
    1302                         <div class="media-modal-content"></div>
    13031302                </div>
    13041303                <div class="media-modal-backdrop"></div>
    13051304        </script>
    13061305
    1307         <script type="text/html" id="tmpl-media-workspace">
    1308                 <div class="upload-attachments">
    1309                         <% if ( selectOne ) { %>
    1310                                 <h3><?php _e( 'Drop a file here' ); ?></h3>
    1311                                 <span><?php _ex( 'or', 'Uploader: Drop a file here - or - Select a File' ); ?></span>
    1312                                 <a href="#" class="button-secondary"><?php _e( 'Select a File' ); ?></a>
    1313                         <% } else { %>
    1314                                 <h3><?php _e( 'Drop files here' ); ?></h3>
    1315                                 <span><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></span>
    1316                                 <a href="#" class="button-secondary"><?php _e( 'Select Files' ); ?></a>
    1317                         <% } %>
    1318 
    1319                         <div class="media-progress-bar"><div></div></div>
     1306        <script type="text/html" id="tmpl-uploader-window">
     1307                <div class="uploader-window-content">
     1308                        <h3><?php _e( 'Drop files here to upload' ); ?></h3>
    13201309                </div>
    13211310        </script>
Note: See TracChangeset for help on using the changeset viewer.