* Adds `wp.media.view.Sidebar`, to aid in rendering the sidebar.
* Removes the `directions` from the `Attachments` view and shifts search into a separate view (`wp.mce.view.Search`) that can be relocated at will. This also serves to simplify the `Attachments` view by removing the nested `list` and `$list` parameters.
* Show the toolbar on the featured image workflow, effectively requiring confirmation before closing the dialog.
see #21390, #21776, #21808.
git-svn-id: http://core.svn.wordpress.org/trunk@22321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
git-svn-id: http://core.svn.wordpress.org/trunk@22320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds a `$wrapper` property to MCE views to allow them to manipulate the wrapper on render. This should be used sparingly — only for layout changes that cannot be accomplished through altering the wrapper's children — and likely only for adding/removing classes.
* Uses `wp.html.string()` in `wp.mce.view.toView()`.
see #21390, #21812, #21813.
git-svn-id: http://core.svn.wordpress.org/trunk@22220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* When a MCE view is selected, normal keystrokes (those without command/control) are blocked.
* Backspace/delete will successfully remove the view.
* Arrow handling will be added at a later point.
* When a MCE view is selected and content is pasted or injected (e.g. when an attachment is added), the content is added to the first text node after the view. If the view is at the end of the document or the next element is another view, a text node is injected into the DOM immediately after the selected view.
see #21390, #21812, #21813, #21815.
git-svn-id: http://core.svn.wordpress.org/trunk@22210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These methods should be expanded to prevent content from being inserted into the view by blocking and rerouting keystrokes as appropriate as well as repositioning the caret before content is inserted.
see #21390, #21812, #21813, #21815.
git-svn-id: http://core.svn.wordpress.org/trunk@22208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a bug in featured images where uploading an image would force you to reopen the modal (as the modal would close on upload).
see #21390, #21776.
git-svn-id: http://core.svn.wordpress.org/trunk@22175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds a `describe` option to the workflow controller to support inline caption editing.
* For images, descriptions are mapped to the `caption` attribute.
* For other media items, descriptions are mapped to the `title` attribute.
* Descriptions are saved when the textarea's `change` event fires (i.e. when the textarea is blurred).
fixes#21807, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds `wp.media.string.link( attachment )` for printing attachment links.
* Adds the `link` attribute to `Attachment` models that corresponds to the link to the attachment post.
see #21390, #21836.
git-svn-id: http://core.svn.wordpress.org/trunk@22170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Certain TinyMCE plugins scan for all spans in the document and remove any that do not have classes (or a handful of other attributes). This is quite aggressive, and breaks the regex used to scan for MCE views when transforming them back to plain text. Adding a class ensures that any plugins that do so will not break MCE views.
see #21812, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Also passes all attachment model attributes to the attachment view template by default (instead of selecting specific values).
see #21390, #21836.
git-svn-id: http://core.svn.wordpress.org/trunk@22159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Enables the "Add images from media library" button when editing. The UX has room for improvement, but it's a start.
see #21390, #21809.
git-svn-id: http://core.svn.wordpress.org/trunk@22157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The edit button on gallery MCE views will open a new instance of the media modal. Images can be removed, uploaded, and reordered. However, the "Add images from media library" button is not yet functional.
see #21390, #21809, #21815.
git-svn-id: http://core.svn.wordpress.org/trunk@22155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Attachment views can now inherit from the theme's `editor-style.css` — just have any rules that apply to the `img` tag apply to `.editor-attachment` as well.
Adds a non-functional edit button to gallery views.
see #21390, #21813, #21815.
git-svn-id: http://core.svn.wordpress.org/trunk@22154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Images are auto-cropped, then fit to the preview on hover (with a slight delay). This is an experiment; we'll see how it turns out.
* Various style changes.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
'''Galleries'''
* Gallery insertion from the new media modal (into TinyMCE, the text editor, etc).
* Gallery previews in TinyMCE now use the `wp.mce.views` API.
* Disables the TinyMCE `wpgallery` plugin.
* Gallery previews consist of the first image of the gallery and the appearance of a stack. This will later be fleshed out to include more images/functionality (including editing the gallery, gallery properties, and showing the number of images in the gallery).
* Multiple galleries can be added to a single post.
* The gallery MCE view provides a bridge between the `wp.shortcode` and `Attachments` representation of a gallery, which allows the existing collection to persist when a gallery is initially created (preventing a request to the server for the query).
'''Shortcodes'''
* Renames `wp.shortcode.Match` to `wp.shortcode` to better expose the shortcode constructor.
* The `wp.shortcode` constructor now accepts an object of options instead of a `wp.shortcode.regexp()` match.
* A `wp.shortcode` instance can be created from a `wp.shortcode.regexp()` match by calling `wp.shortcode.fromMatch( match )`.
* Adds `wp.shortcode.string()`, which takes a set of shortcode parameters and converts them into a string.* Renames `wp.shortcode.prototype.text()` to `wp.shortcode.prototype.string()`.
* Adds an additional capture group to `wp.shortcode.regexp()` that records whether or not the shortcode has a closing tag. This allows us to improve the accuracy of the syntax used when transforming a shortcode object back into a string.
'''Media Models'''
* Prevents media `Query` models from observing the central `Attachments.all` object when query args without corresponding filters are set (otherwise, queries quickly amass false positives).
* Adds `post__in`, `post__not_in`, and `post_parent` as acceptable JS attachment `Query` args.
* `Attachments.more()` always returns a `$.promise` object.
see #21390, #21809, #21812, #21815, #21817.
git-svn-id: http://core.svn.wordpress.org/trunk@22120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
An `Attachments` view now accepts a `sortable` property. Manual sorting is only enabled when the corresponding collection doesn't have a comparator.
jQuery UI sortable must be enqueued for sorting to work.
see #21390, #21809.
git-svn-id: http://core.svn.wordpress.org/trunk@22101 1a063a9b-81f0-0310-95a4-ce76da25c4cd