* Add an Attachments collection filter for uploadedTo (post_parent).
* Correct an erroneous map from the non-existent parent prop to post_parent.
* Define default menuOrder and uploadedTo props for uploading attachments.
* Unify filterable props into a single method (improving validation performance for calls to set with multiple properties).
Props koopersmith
fixes#22654
git-svn-id: http://core.svn.wordpress.org/trunk@22951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When attachments are sorted, we convert the shortcode to [gallery ids=""], as before.
props koopersmith.
fixes#22608.
git-svn-id: http://core.svn.wordpress.org/trunk@22882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes issue where pasting a URL in 'From URL' (via the context menu) did not
enable the insert button, as the event was not yet fired.
props koopersmith.
fixes#22545.
git-svn-id: http://core.svn.wordpress.org/trunk@22836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Allows the uploader to leverage the ready event to know when it has been attached to the page.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Make the composite gallery library use `mirror` instead of `observe`, as one method now invokes the other. Also, make `mirror` return the attachment collection for chaining.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Use default `render` method in the `Frame` view.
* Rename `Views.attach` to `Views.insert`.
* Add `Views.all` to retrieve all subviews.
* Add `Views.detach` to detach all subviews.
* Detect whether views are going to be reused in `View.set` and `detach` them instead of calling `dispose`.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Merge `Composite` model with general `Attachments` model, as `Attachments.validate` and `Composite.evaluate` were functionally equivalent.
* Queries should only watch `wp.Uploader.queue`, as watching `Attachments.all` results in queries attempting to add attachments before their properties are set (which then results a few too many irrelevant adds/removes). `Attachments.all` should potentially be removed or rethought.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Centralizes view and subview management, unifying several disjointed constructs.
* Utilizes the `dispose` functionality found in Backbone master, providing a standard method for memory management.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Revert [22611] in favor of using plupload's `container` setting. Turns out, plupload's flash shim is forced to the exact same index as the admin bar, so balancing the two is better solved by nesting the shim.
see #22441, #22446, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Add dimensions to the "sizes" dropdown.
* Ensure a `full` size is generated in `wp_prepare_attachment_for_js()`.
* Print the dimensions for the full size in the attachment summary (instead of those for the current size).
* When generating the attachment view's template, map `imageSize()` to the `size` property instead of overriding the default data.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds styling to the upload progress bar in the attachment details template.
* Defines the `filename` attribute when Plupload creates the client-side `Attachment` model.
fixes#22410, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Also changes the rules for when the "new gallery" button shows:
* More than two items must be selected.
* At least one of them must be an image.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds `createIframeStates()` to the `MediaFrame` view. It creates states and bindings for the `media_upload_tabs` output, and is included on `MediaFrame.Post` by default.
* Hijacks `tb_remove()` when the media modal is open to ensure the modal closes correctly.
* Adds a `chromeless` parameter to thickbox media tab URLs to render the UI without the old row of tabs.
see #22186, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`media.view.MediaFrame.Select` is a frame class with a handful of sensible defaults to handle selecting and uploading items in the media library.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Also switches search box to use `<input type="search" />` to take advantage of browser UI to clear the field.
fixes#22315, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`wp.mce.media`
* Watch all workflows for the `insert` event and attempt to insert the current state's `selection` if it exists.
* Fetch and pass attachment display properties through to `wp.media.string.image()`.
`wp.media.controller.Region`
* Separate the concept of events and modes.
* All events triggered on a `Region` trigger both `event` and `event:mode` callbacks.
* When a mode is deactivated, `deactivate` and `deactivate:mode` events are fired.
* When a mode is activated, `activate` and `activate:mode` events are fired.
`wp.media.controller.Library`
* Remove the `details()`, `buildDetails()`, and `clearDetails()` methods that juggled sidebar views. Instead, handle the sidebar views using modes.
`wp.media.controller.Gallery`
* Shift the overloaded `sidebar()` method to use modes.
`wp.media.view.MediaFrame.Post`
* Declare `activate:mode` event bindings using an nested object to reduce repetition.
* Update sidebar activation callbacks.
`wp.media.view.Settings`
* Refactor to leverage HTML data attributes and implicit values (instead of setting the fallback whenever an object was created). This has the additional benefit that gallery shortcode parameters are not output when the user has left them set to the default.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`wp.media.model.Query.more()`
* If a request has already been sent out for more attachments, return that request object instead of creating another.
`wp.media.controller.Region`
* A region allows views to be swapped in and out of a section of the page without either view having to know about the other.
* Application components can use the same callbacks and resources by leveraging `Region.mode()`, which triggers a set of callbacks to create or transform the current view, but only if necessary.
`wp.media.view.Frame`
* Leverage `Region` controllers instead of forcing states to swap view objects, which causes states to fit more comfortably in the controller-camp.
* Add `previous()`, a method to fetch the previous state `id`.
* Separate out the default settings over several objects (so blank frames can be instantiated).
`wp.media.view.MediaFrame`
* The base `Frame` used for media management: handles integration with the `Modal` and `UploaderWindow` views.
`wp.media.view.MediaFrame.Post`
* Includes all default media states and callbacks necessary for inserting media into a post.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Merges most of `wp.media.controller.Upload` into `wp.media.controller.Library`, so we always create an inline uploader instead of an attachments browser if the state's `library` is empty.
props rzen, fixes#22323, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22363 1a063a9b-81f0-0310-95a4-ce76da25c4cd