Commit Graph

394 Commits

Author SHA1 Message Date
Scott Taylor fb019893f9 In `wp.Uploader`, when `uploader:ready` is triggered, set `ready` to `true` on the instance. This allows media workflows to check for an existing uploaded instance when opening.
Without this check, workflows might wait for `uploader:ready`, which could already have been fired. This would result in an unresponsive editor dropzone.

Fixes #29689.

Built from https://develop.svn.wordpress.org/trunk@29917


git-svn-id: http://core.svn.wordpress.org/trunk@29669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-16 05:54:18 +00:00
Andrew Ozz 7f2f3dcb5d Media modal: fix reordering of the thumbnails while creating or editing a gallery, props avryl, fixes #29606 for trunk.
Built from https://develop.svn.wordpress.org/trunk@29876


git-svn-id: http://core.svn.wordpress.org/trunk@29633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-11 23:24:23 +00:00
Scott Taylor 821f9f40ec For `attachment-compat` fields, show a spinner while `wp.media.model.Attachment.saveCompat()` is firing.
Fixes #27028.

Built from https://develop.svn.wordpress.org/trunk@29831


git-svn-id: http://core.svn.wordpress.org/trunk@29595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-03 18:43:20 +00:00
Scott Taylor d8c913b3f9 Add the `date` filter from media grid to the media modal.
Props janhenckens, wonderboymusic.
Fixes #28990.

Built from https://develop.svn.wordpress.org/trunk@29813


git-svn-id: http://core.svn.wordpress.org/trunk@29579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-02 04:32:16 +00:00
Scott Taylor 202ede7696 After [29811], combine 2 `if` statements.
Built from https://develop.svn.wordpress.org/trunk@29812


git-svn-id: http://core.svn.wordpress.org/trunk@29578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-02 04:16:17 +00:00
Scott Taylor b885885b67 Media Grid/List Table parity: when `MEDIA_TRASH` is `true` and `trash` is the current filter for the grid, add a second bulk action button: "Delete Selected"
Fixes #29742.

Built from https://develop.svn.wordpress.org/trunk@29811


git-svn-id: http://core.svn.wordpress.org/trunk@29577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-02 04:13:16 +00:00
Scott Taylor f30266acb9 Media Grid:
* In Bulk Edit mode, don't attempt to delete or trash an attachment that doesn't have a `delete` nonce. The subsequent `_requery()` will then properly display the attachment still present in the library.
* Remove all updated models from the selection at the same time to avoid async race conditions. The selection is reset when the grid's `select` mode is deactivated, but this allows this view instance to be more portable.

This fix allows users to set caps on individual attachments without confusing the grid's library. This issue was present for bulk actions in general, had nothing to do with `MEDIA_TRASH` specifically.

Fixes #29597.

Built from https://develop.svn.wordpress.org/trunk@29755


git-svn-id: http://core.svn.wordpress.org/trunk@29527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-21 18:52:16 +00:00
Sergey Biryukov 9f066b2a1d Correct some @since values added in [29739].
see #28459.
Built from https://develop.svn.wordpress.org/trunk@29743


git-svn-id: http://core.svn.wordpress.org/trunk@29517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-13 12:18:18 +00:00
Scott Taylor 836e0f8cd5 Add some `@since` annotations to `media-views.js`.
Props DrewAPicture.
See #28459.

Built from https://develop.svn.wordpress.org/trunk@29739


git-svn-id: http://core.svn.wordpress.org/trunk@29513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-12 03:36:16 +00:00
Sergey Biryukov 39b859c21e Add 'Unattached' filter for galleries.
props pento.
fixes #29329.
Built from https://develop.svn.wordpress.org/trunk@29722


git-svn-id: http://core.svn.wordpress.org/trunk@29496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-09 07:14:16 +00:00
Andrew Nacin b0f6b888b9 Media: Avoid repeated thumbnail resizing.
props avryl, wonderboymusic, azaozz.
fixes #27423.

Built from https://develop.svn.wordpress.org/trunk@29686


git-svn-id: http://core.svn.wordpress.org/trunk@29461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-03 06:10:19 +00:00
Andrew Nacin 4cfdb9851f Media Modal: Fix 'Insert from URL' oEmbed previews.
props johnbillion, azaozz.
fixes #29473.

Built from https://develop.svn.wordpress.org/trunk@29680


git-svn-id: http://core.svn.wordpress.org/trunk@29455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-03 00:37:16 +00:00
Helen Hou-Sandí 7586e15e0d Media: only apply `wp-filter` class to the grid view toolbar.
props gcorne.
fixes #29381.

Built from https://develop.svn.wordpress.org/trunk@29629


git-svn-id: http://core.svn.wordpress.org/trunk@29403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-26 19:06:15 +00:00
Helen Hou-Sandí 9e8b9a78ca Media library: Unify headers between view modes.
Includes back compat for `views_upload` links. These look a little awkward, but do not appear to be commonly used. Also prevents the view mode links from being dropped on smaller screens so a user doesn't get "stuck" in the list view.

This is different from other list tables, but aligns well with other uploaded content management screens (themes, plugins).

props pento, helen.
fixes #28946.

Built from https://develop.svn.wordpress.org/trunk@29625


git-svn-id: http://core.svn.wordpress.org/trunk@29399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-26 15:58:15 +00:00
Dominik Schilling 32030a073f RTL: Fix modal alignments.
* Prevent horizontal scrollbars in Chrome.
* URL fields should be always LTR.
* Force the plugin details to be LTR for all screens, see #19778.

fixes #29352.
Built from https://develop.svn.wordpress.org/trunk@29623


git-svn-id: http://core.svn.wordpress.org/trunk@29397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-26 12:55:16 +00:00
Scott Taylor 80bda02c0f Media Modal:
* the Image Details frame does not have a menu, indicate that by setting `menu: false` when adding states.
* mimic the default router rendering by toggling a `hide-menu` class on the frame when the region for menu is `null`
* remove the dead render code for the Image Details frame

See #29339.

Built from https://develop.svn.wordpress.org/trunk@29613


git-svn-id: http://core.svn.wordpress.org/trunk@29387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-26 04:22:16 +00:00
Helen Hou-Sandí 60c6399d1c Media Grid: Show upload errors above the grid rather than as a popup.
props pento, stephdau, helen. fixes #29141.

Built from https://develop.svn.wordpress.org/trunk@29612


git-svn-id: http://core.svn.wordpress.org/trunk@29386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-26 04:18:17 +00:00
Andrew Ozz 04e28b468c Media modal: fix the progress bar in the attachment thumbnail. Props gcorne, fixes #29367
Built from https://develop.svn.wordpress.org/trunk@29609


git-svn-id: http://core.svn.wordpress.org/trunk@29383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-25 22:45:16 +00:00
Scott Taylor d869fe0603 Media: cleanup recent changes to `media.view.FocusManager`.
* Adjusts the focus method to target the menu for the current modal
* Refactor the FocusManager so that the method names and the functionality matches more closely with how it currently works. The changes in 4.0 to the FocusManager change the purpose of the focus manager entirely — instead of being a way to save and restore focus state, the new FocusManager is about constraining keyboard navigation via the tab key to inside the modal. 

Props gcorne.
See #23560.

Built from https://develop.svn.wordpress.org/trunk@29602


git-svn-id: http://core.svn.wordpress.org/trunk@29376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-25 18:23:16 +00:00
Scott Taylor db0b4c5b4d Media: when activating a mode after [29056], don't trigger the `{mode}:activate` event twice in a row.
See #29366.

Built from https://develop.svn.wordpress.org/trunk@29601


git-svn-id: http://core.svn.wordpress.org/trunk@29375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-25 18:07:15 +00:00
Scott Taylor 1335ff3e40 Media Grid: Don't make checkboxes tabbable when in bulk select media grid mode, fixes tabbing in bulk select mode.
Props adamsilverstein.
See #28822.

Built from https://develop.svn.wordpress.org/trunk@29585


git-svn-id: http://core.svn.wordpress.org/trunk@29359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-24 16:55:15 +00:00
Scott Taylor d5d0b37c35 Media Grid: restore focus to the selected item when shift-tab away from the attachment details sidebar.
Fixes #29303.

Built from https://develop.svn.wordpress.org/trunk@29584


git-svn-id: http://core.svn.wordpress.org/trunk@29358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-24 16:43:16 +00:00
Helen Hou-Sandí 8a545bf05e Media: Only fire keyboard events for the Attachments view once.
Firing them twice was breaking arrow key navigation in media attachment grids.

props gcorne.
fixes #29304.

Built from https://develop.svn.wordpress.org/trunk@29582


git-svn-id: http://core.svn.wordpress.org/trunk@29356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-24 16:17:16 +00:00
Scott Taylor 31e599943d Media Grid: after [29566], account for Trash and Delete.
See #28842.

Built from https://develop.svn.wordpress.org/trunk@29568


git-svn-id: http://core.svn.wordpress.org/trunk@29342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-21 04:42:16 +00:00
Scott Taylor 7029af94e7 Media Grid: after completing a Bulk action, switch from `select` to `edit` mode.
Fixes #28842.

Built from https://develop.svn.wordpress.org/trunk@29566


git-svn-id: http://core.svn.wordpress.org/trunk@29340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-21 04:20:16 +00:00
Scott Taylor ca180e2544 Media Grid: don't auto-select attachments upon upload.
Props ocean90.
See #28842.

Built from https://develop.svn.wordpress.org/trunk@29565


git-svn-id: http://core.svn.wordpress.org/trunk@29339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-21 03:54:14 +00:00
Scott Taylor 8f810cbaa4 `media.view.Attachment`: set all of the view attributes in the same hash.
See [29299], #23560.

Built from https://develop.svn.wordpress.org/trunk@29562


git-svn-id: http://core.svn.wordpress.org/trunk@29337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-21 02:53:14 +00:00
Scott Taylor 6352d703a0 Media Grid/Modal Keyboard navigation improvements:
* Add focus to arrows on Next/Previous in the grid's modal on left/right keypress, and add the necessary CSS for `:focus`
* When in a disabled input in the grid modal, allow the left/right keys to work
* Make the image editor return a `$.Deferred` so that there isn't a race condition with UI loading. 
* Assign focus when the edit image mode is rendered so that the modal can be closed on Esc press

Props wonderboymusic, adamsilverstein (for the initial patch).
See #23560.

Built from https://develop.svn.wordpress.org/trunk@29560


git-svn-id: http://core.svn.wordpress.org/trunk@29335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-21 02:35:17 +00:00
Scott Taylor 557861446f Cleanup after [29220]:
`media.controller.Library` is State/Backbone Model and should not touch views.

See #23560.

Built from https://develop.svn.wordpress.org/trunk@29558


git-svn-id: http://core.svn.wordpress.org/trunk@29333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-20 20:00:16 +00:00
Scott Taylor a43cfb4f96 Cleanup after [29220]:
* `media.view.Attachment` should not reach outside itself with global jQuery selectors
* `media.view.Attachment.Details` will re-render when `media.view.Attachment`'s single status changes. Add a `ready` callback to apply initial input focus

See #23560.

Built from https://develop.svn.wordpress.org/trunk@29556


git-svn-id: http://core.svn.wordpress.org/trunk@29331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-20 19:29:17 +00:00
Scott Taylor 31bb46d0fc Initial cleanup after [29220]:
* Alter/remove some jQuery global selectors, views should only manage themselves
* Trigger an event for attachments when arrow keys are pressed: `attachment:keydown:arrow`
* `media.view.Attachments` should listen for `attachment:keydown:arrow`
* Favor scoped selectors over globals

See #23560.

Built from https://develop.svn.wordpress.org/trunk@29555


git-svn-id: http://core.svn.wordpress.org/trunk@29330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-20 19:14:15 +00:00
Dominik Schilling 9f91625fb6 Insert Media: Don't select a model if it's already selected.
props avryl, adamsilverstein.
fixes #29152.

Built from https://develop.svn.wordpress.org/trunk@29553


git-svn-id: http://core.svn.wordpress.org/trunk@29328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-20 17:20:15 +00:00
Dominik Schilling 6e0ab38b9e Media Library: Set max value of columns to 12.
fixes #29275.
Built from https://develop.svn.wordpress.org/trunk@29547


git-svn-id: http://core.svn.wordpress.org/trunk@29323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-20 16:17:19 +00:00
Dominik Schilling a28bc71819 Media Modal: Restore to the previous filter and search error message.
fixes #28963.
Built from https://develop.svn.wordpress.org/trunk@29532


git-svn-id: http://core.svn.wordpress.org/trunk@29308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-18 16:28:19 +00:00
Scott Taylor 29a73daa74 Media Grid: Don't show attachment details in the "sidebar" for errors.
Props ocean90.
Fixes #29037.

Built from https://develop.svn.wordpress.org/trunk@29527


git-svn-id: http://core.svn.wordpress.org/trunk@29303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-18 02:26:16 +00:00
Scott Taylor 4d20246173 Media Grid: `$.when` expects a splat. Disambiguation: change `cache` to `refresh` as the arg name for `_requery()`.
See [29490], #29145.

Built from https://develop.svn.wordpress.org/trunk@29507


git-svn-id: http://core.svn.wordpress.org/trunk@29284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-15 19:00:16 +00:00
Andrew Ozz 81815c4d03 Some pre-commit cleanup of media-grid.js and media-views.js
Built from https://develop.svn.wordpress.org/trunk@29494


git-svn-id: http://core.svn.wordpress.org/trunk@29272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-15 01:13:16 +00:00
Scott Taylor b0c782bf08 Media Grid, support `MEDIA_TRASH`: add AYS to bulk actions.
See #29145.

Built from https://develop.svn.wordpress.org/trunk@29492


git-svn-id: http://core.svn.wordpress.org/trunk@29270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 19:08:14 +00:00
Scott Taylor df4cc86671 Media Grid, support `MEDIA_TRASH`:
* Only use the special `trashAttachment` logic when in `edit-metadata` mode.
* Don't support the `trash` filter in the Add Media modal for now.
* Properly toggle trash/untrash logic in the Attachment Details sidebar

See #29145.

Built from https://develop.svn.wordpress.org/trunk@29491


git-svn-id: http://core.svn.wordpress.org/trunk@29269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 18:51:19 +00:00
Scott Taylor 571111022e Media Grid, support `MEDIA_TRASH`:
* Add a setting to `_wpMediaViewsL10n.settings`: `mediaTrash`
* In the attachment edit modal, properly toggle between Trash/Untrash
* In `media.view.Attachment`, add a method for `untrashAttachment`
* When creating the grid toolbar, switch the setting order of subviews so that `media.view.DeleteSelectedButton` can listen to the instance of `media.view.AttachmentFilters.All` to update the text in its UI.
* Add a new filter to `media.view.AttachmentFilters.All`, `trash`, when `settings.mediaTrash` is true
* Allow the cached queries in `Query.get()` to be flushed when race conditions exist and collections need to be refreshed. This is currently only being used when `MEDIA_TRASH` is set, to refresh the filtered/mirrored collections related to `all`, `trash`, and any already queried filter.
* Cleanup the bootstrapping of `media.view.MediaFrame.Manage`
* Allow `wp_ajax_query_attachments()` to return items from the trash when `MEDIA_TRASH` is `true`
* Allow `wp_ajax_save_attachment()` to set `post_status` when `MEDIA_TRASH` is `true`. It allows `wp_delete_post()` to be called, which will trash the attachment instead of deleting when the flag is set.

Props koop for the knowledge sharing and thought partnership.
See #29145.

Built from https://develop.svn.wordpress.org/trunk@29490


git-svn-id: http://core.svn.wordpress.org/trunk@29268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 18:31:19 +00:00
Scott Taylor 9c08ad236a Media Grid: add Bulk Selection mode for deleting attachments.
* Toolbar is sticky when `select` mode is active
* Selection is toggled when clicking an attachment preview
* Unselected attachments fade out, selected fade in.

See #28842.

Built from https://develop.svn.wordpress.org/trunk@29484


git-svn-id: http://core.svn.wordpress.org/trunk@29262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-13 22:45:15 +00:00
Drew Jaynes d33c807723 Fix some documentation typos in various core files.
Props vlajos.
Fixes #29199.

Built from https://develop.svn.wordpress.org/trunk@29479


git-svn-id: http://core.svn.wordpress.org/trunk@29257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-13 03:56:17 +00:00
Andrew Ozz ce14155edf Media modal: make sure the Close button is focused after attempting to close the onscreen keyboard on touch devices. Props celloexpressions, fixes #29166.
Built from https://develop.svn.wordpress.org/trunk@29473


git-svn-id: http://core.svn.wordpress.org/trunk@29251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-12 21:58:15 +00:00
Andrew Ozz 2f4bd918b2 TinyMCE: fix the 'editimage' plugin for touch devices. Better attempt to hide the onscreen keyboard when the media modal opens and TinyMCE is in focus. See #28595, #29166
Built from https://develop.svn.wordpress.org/trunk@29471


git-svn-id: http://core.svn.wordpress.org/trunk@29249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-12 04:27:18 +00:00
Andrew Ozz d11bb9bc50 Media at small screens:
- Show the image details/settings as an overlay.
- Better styling for the frame drop-down.
- Remove the multi-select by default on the Insert frame.
See #27423
Built from https://develop.svn.wordpress.org/trunk@29452


git-svn-id: http://core.svn.wordpress.org/trunk@29230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-09 05:09:16 +00:00
Andrew Ozz b8198ecf64 Media: improve the media modal at small screen sizes and make it usable on phones, first run. Part-props gcorne, see #27423.
Built from https://develop.svn.wordpress.org/trunk@29446


git-svn-id: http://core.svn.wordpress.org/trunk@29224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-08 03:46:17 +00:00
Scott Taylor 34e3377d42 JSHint after [29437].
Built from https://develop.svn.wordpress.org/trunk@29439


git-svn-id: http://core.svn.wordpress.org/trunk@29217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 21:21:16 +00:00
Scott Taylor 8c96874742 Media Grid:
* Use a `media.view.Label` instance in the toolbar for the screen reader text for the "all" dropdown.
* Adjust the spinner's priority.

Fixes #29026.

Built from https://develop.svn.wordpress.org/trunk@29438


git-svn-id: http://core.svn.wordpress.org/trunk@29216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 21:01:15 +00:00
Scott Taylor ccd0499d96 Media Grid: use a `media.view.Label` instance in the toolbar for the screen reader text for Search.
See #29026.

Built from https://develop.svn.wordpress.org/trunk@29437


git-svn-id: http://core.svn.wordpress.org/trunk@29215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:54:15 +00:00
Helen Hou-Sandí 485229bc64 Revert styling changes to the Attachment Details modal from [29289]. fixes #28844.
Built from https://develop.svn.wordpress.org/trunk@29436


git-svn-id: http://core.svn.wordpress.org/trunk@29214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:32:16 +00:00