WordPress/wp-includes/js
Daryl Koopersmith 92823b8635 Streamlining media, part I.
The main goal here is to rearrange the media components in a modularized structure to support more linear workflows. This is that structure using the pre-existing workflows, which will be improved over the course of the next few commits.

This leaves a few pieces a bit rough around the edges: namely gallery editing and selecting a featured image.

The fine print follows.

----

'''Styles'''
* Tightened padding around the modal to optimize for a smaller default screen size.
* Added a light dashed line surrounding the modal to provide a subtle cue for the persistent dropzone (which is evolving into a power user feature since we now have a dedicated `upload` state).
* Add a size for `hero` buttons.
* Remove transitions from frame subviews (e.g. menu, content, sidebar, toolbar).

----

'''Code'''

`wp.media.controller.StateManager`
* Don't fire `activate` and `deactivate` if attempting to switch to the current state.

`wp.media.controller.State`
* Add a base state class to bind default methods (as not all states will inherit from the `Library` state).
* On `activate`, fire `activate()`, `menu()`, `content()`, `sidebar()`, and `toolbar()`.
* The menu view is often a shared object (as its most common use case is switching between states). Assign the view to the state's `menu` attribute.
* `menu()` automatically fetches the state's `menu` attribute, attaches the menu view to the frame, and attempts to select a menu item that matches the state's `id`.

`wp.media.controller.Library`
* Now inherits from `wp.media.controller.State`.

`wp.media.controller.Upload`
* A new state to improve the upload experience.
* Displays a large dropzone when empty (a `UploaderInline` view).
* When attachments are uploaded, displays management interface (a `library` state restricted to attachments uploaded during the current session).

`wp.media.view.Frame`
* In `menu()`, `content()`, `sidebar()`, and `toolbar()`, only change the view if it differs from the current view. Also, ensure `hide-*` classes are properly removed.
*

`wp.media.view.PriorityList`
* A new container view used to sort and render child views by the `priority` property.
* Used by `wp.media.view.Sidebar` and `wp.media.view.Menu`.
* Next step: Use two instances to power `wp.media.view.Toolbar`.

`wp.media.view.Menu` and `wp.media.view.MenuItem`
* A new `PriorityList` view that renders a list of views used to switch between states.
* `MenuItem` instances have `id` attributes that are tied directly to states.
* Separators can be added as plain `Backbone.View` instances with the `separator` class.
* Supports any type of `Backbone.View`.

`media.view.Menu.Landing`
* The landing menu for the 'insert media' workflow.
* Includes an inactive link to an "Embed from URL" state.
* Next steps: only use in select cases to allot for other workflows (such as featured images).

`wp.media.view.AttachmentsBrowser`
* A container to render an `Attachments` view with accompanying UI controls (similar to what the `Attachments` view was when it contained the `$list` property).
* Currently only renders a `Search` view as a control.
* Next steps: Add optional view counts (e.g. "21 images"), upload buttons, and collection filter UI.

`wp.media.view.Attachments`
* If the `Attachments` scroll buffer is not filled with `Attachment` views, continue loading more attachments.
* Use `this.model` instead of `this.controller.state()` to allow `Attachments` views to have differing `edge` and `gutter` properties.
* Add `edge()`, a method used to calculate the optimal dimensions for an attachment based on the current width of the `Attachments` container element.
* `edge()` is currently only enabled on resize, as the relative positioning and CSS transforms used to center thumbnails are suboptimal when coupled with frequent resizing.
* Next steps: For infinite scroll performance improvements, look into absolutely positioning attachment views and paging groups of attachment views.

`wp.media.view.UploaderWindow`
* Now generates a `$browser` element as the browse button (instead of a full `UploaderInline` view). Using a portable browse button prevents us from having to create a new `wp.Uploader` instance every time we want access to a browse button.

`wp.media.view.UploaderInline`
* No longer directly linked to the `UploaderWindow` view or its `wp.Uploader` instance.
* Used as the default `upload` state view.

`wp.media.view.Selection`
* An interactive representation of the selected `Attachments`.
* Based on the improved workflows, this is likely overkill. For simplicity's sake, will probably remove this in favor of `SelectionPreview`.

----

see #21390.



git-svn-id: http://core.svn.wordpress.org/trunk@22362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-04 22:59:12 +00:00
..
crop
imgareaselect Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
jcrop Remove Jcrop non-minified files. see #20728. 2012-08-28 18:03:52 +00:00
jquery jQuery UI 1.9.1 2012-11-03 22:51:38 +00:00
plupload Compress scripts/styles: 3.5-beta2-22326. 2012-10-29 22:58:31 +00:00
swfupload Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
thickbox Switch to sans-serif for the font stack in Thickbox as we have done elsewhere. props wet, fixes #20268. 2012-09-13 17:08:01 +00:00
tinymce Compress scripts/styles: 3.5-beta2-22252. TinyMCE updated. 2012-10-16 22:58:39 +00:00
admin-bar.js Make the admin menu and toolbar work well on mobile devices, props georgestephanis, see #20614 2012-10-19 18:31:21 +00:00
admin-bar.min.js Compress scripts/styles: 3.5-beta2-22265. 2012-10-19 22:58:33 +00:00
autosave.js New HiDPI spinner. Uses clean <span class="spinner"></span> markup. 2012-09-26 19:57:44 +00:00
autosave.min.js Compress scripts/styles: 3.5-alpha-22024. 2012-09-26 22:58:46 +00:00
backbone.min.js Please welcome Underscore.js and Backbone.js to core. fixes #21664. 2012-08-22 22:24:20 +00:00
colorpicker.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
colorpicker.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
comment-reply.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
comment-reply.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
customize-base.js Improve the lazy instantiation of the 'wp' JavaScript variable. props evansolomon, fixes #22113. 2012-10-06 00:43:36 +00:00
customize-base.min.js Compress scripts/styles: 3.5-beta1-22128. 2012-10-07 02:27:48 +00:00
customize-loader.js Improve the lazy instantiation of the 'wp' JavaScript variable. props evansolomon, fixes #22113. 2012-10-06 00:43:36 +00:00
customize-loader.min.js Compress scripts/styles: 3.5-beta1-22128. 2012-10-07 02:27:48 +00:00
customize-preview.js Theme Customizer: Correctly update background-attachment property in live preview 2012-10-07 14:46:39 +00:00
customize-preview.min.js Compress scripts/styles: 3.5-beta1-22133. 2012-10-07 22:58:41 +00:00
hoverIntent.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
hoverIntent.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
json2.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
json2.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
mce-view.js Media: Update gallery editing to work with the new frame view. see #21390. 2012-10-31 21:43:59 +00:00
mce-view.min.js Compress scripts/styles: 3.5-beta2-22352. 2012-10-31 22:58:32 +00:00
media-models.js Media JS: Improve handling of single attachments in selections. 2012-10-30 23:15:16 +00:00
media-models.min.js Compress scripts/styles: 3.5-beta2-22352. 2012-10-31 22:58:32 +00:00
media-views.js Streamlining media, part I. 2012-11-04 22:59:12 +00:00
media-views.min.js Compress scripts/styles: 3.5-beta2-22360. 2012-11-02 22:58:37 +00:00
quicktags.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
quicktags.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
shortcode.js Improve the lazy instantiation of the 'wp' JavaScript variable. props evansolomon, fixes #22113. 2012-10-06 00:43:36 +00:00
shortcode.min.js Compress scripts/styles: 3.5-beta1-22128. 2012-10-07 02:27:48 +00:00
swfobject.js Update swfobject 2012-04-17 23:09:29 +00:00
tw-sack.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
tw-sack.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
underscore.min.js Update underscore.js to version 1.4.1. fixes #22081, see #22026. 2012-10-03 00:27:16 +00:00
wp-ajax-response.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
wp-ajax-response.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
wp-list-revisions.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
wp-list-revisions.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
wp-lists.js Fix adding and updating from the Custom Fields meta box. Broken in [21205]. props SergeyBiryukov. see #21829 for trunk. 2012-09-07 15:49:20 +00:00
wp-lists.min.js Compress scripts/styles: 3.5-alpha-21879. TinyMCE updated. 2012-09-17 00:59:40 +00:00
wp-pointer.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
wp-pointer.min.js Switch to .min for compressed JS and CSS files. 2012-08-23 00:04:18 +00:00
wplink.js New HiDPI spinner. Uses clean <span class="spinner"></span> markup. 2012-09-26 19:57:44 +00:00
wplink.min.js Compress scripts/styles: 3.5-alpha-22024. 2012-09-26 22:58:46 +00:00