Commit Graph

366 Commits

Author SHA1 Message Date
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
Scott Taylor 8593f7b5e9 Media Grid: add screen reader text in a subview on the toolbar, a `media.view.Label` instance before `media.view.DateFilter`.
See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:25:16 +00:00
Scott Taylor 3f17e7040e Create a new Backbone view, `media.view.Label`, which can be used as a subview in things like toolbars, which need screen reader text.
Make an initial instance of it for the label for Bulk Actions in Media Grid.

See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:09:17 +00:00
Scott Taylor c5dff42d51 Revert [29428] to avoid errors with Add Media for now.
See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 19:40:15 +00:00
Scott Taylor afb0b3e4ef Media Grid: add screen reader labels with more context to filters and bulk actions. Ditto for list view.
Props afercia.
Fixes #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 05:20:16 +00:00
Scott Taylor 8ed123c97f In `media.view.AttachmentFilters.All`, make `uploaded` conditional upon `media.view.settings.post.id` and include a new filter: `unattached`.
Drop the `mime-types` filter and related class (which was added for Media Grid) and use `all` instead. 

Props ocean90, wonderboymusic.
Fixes #29065.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 04:44:17 +00:00
Scott Taylor 935f10413e Media Grid: expose the `$.Deffered()` object in `media.view.AttachmentsBrowser.updateContent()` so the grid can call `Backbone.history.start()` when models actually exist.
This is a lot better then `_.delay( this.pray, 1000 )`, but needs continued study.

See #29052.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-06 21:44:17 +00:00
Scott Taylor a58a4da852 Media Grid: display upload errors in a dismissable sidebar.
See #29037.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-06 19:13:15 +00:00
Andrew Ozz 8fc01225ac Media modal/grid: get the proper .attachment width in arrow navigation. Props avryl, see #27423.
Built from https://develop.svn.wordpress.org/trunk@29379


git-svn-id: http://core.svn.wordpress.org/trunk@29157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-05 19:37:15 +00:00
Andrew Ozz e6b0d0c9ee Media modal/grid: remove thumbnail resizing from JS, only keep setting number of columns. Props avryl, see #27423.
Built from https://develop.svn.wordpress.org/trunk@29376


git-svn-id: http://core.svn.wordpress.org/trunk@29154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-05 05:20:18 +00:00
Dominik Schilling e6513fe33b Media Modal: Restore uploader view, when no items are found.
see #28963.
Built from https://develop.svn.wordpress.org/trunk@29364


git-svn-id: http://core.svn.wordpress.org/trunk@29140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-02 20:47:16 +00:00
Dominik Schilling fb9084eed3 Disable background page scrolling when modals are open.
props celloexpressions.
fixes #29074.
Built from https://develop.svn.wordpress.org/trunk@29346


git-svn-id: http://core.svn.wordpress.org/trunk@29124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-01 20:15:15 +00:00
Andrew Ozz 4bff4ff2d6 Use node.nodeName instead of tagName for better consistency/compatibility, see #28704.
Built from https://develop.svn.wordpress.org/trunk@29332


git-svn-id: http://core.svn.wordpress.org/trunk@29112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-30 17:49:16 +00:00
Helen Hou-Sandí 2ca11ebf72 Prevent key event handlers from firing when in input areas in the media modal, as people understandably want to type inside said inputs. props kovshenin. fixes #28704.
Built from https://develop.svn.wordpress.org/trunk@29331


git-svn-id: http://core.svn.wordpress.org/trunk@29111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-30 17:39:15 +00:00
Dominik Schilling 7bbbbe44c7 Media Grid: Improve lazy loading.
props kovshenin.
see #24716.
Built from https://develop.svn.wordpress.org/trunk@29312


git-svn-id: http://core.svn.wordpress.org/trunk@29093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-27 17:58:15 +00:00
Scott Taylor 0e4c8b2b0c Media Grid: when closing the modal, automatically focus the proper attachment by reading the model's ID, which is unique.
Props adamsilverstein (for the red), wonderboymusic (for the green).
Fixes #28857.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-25 01:00:16 +00:00
Scott Taylor 27866228af Media Grid: UI improvements to Attachment modal.
Props ryelle.
See #28844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 21:55:17 +00:00
Scott Taylor 9382741cbe Don't render Attachment Display Settings when `display` is set to `false`. Currently, the value for `display` in the `media.view.AttachmentsBrowser` instance in the `media.view.MediaFrame.Select` frame is set to the value for `displaySettings`.
These values do different things, so check for the existence of `display` on the state before arbitrarily setting it to the `displaySettings` value.

Real world: this hides display settings when you select an image while editing a Gallery.

Fixes #28653.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 20:58:16 +00:00
Scott Taylor 5be43cfeb1 Media Grid: Manage focus when toggling between the grid and an edit attachment modal
Props adamsilverstein for the initial patch.
Fixes #28857.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 19:05:15 +00:00
Helen Hou-Sandí 795c97d08b Add support for `attachment_fields_to_edit` in the attachment details modal. props ericlewis. fixes #28991, see #24716.
Built from https://develop.svn.wordpress.org/trunk@29278


git-svn-id: http://core.svn.wordpress.org/trunk@29060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-23 22:09:18 +00:00
Dominik Schilling 270a57075c Media Grid: Add a date filter.
props ericlewis.
fixes #28895.
Built from https://develop.svn.wordpress.org/trunk@29271


git-svn-id: http://core.svn.wordpress.org/trunk@29053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-22 20:47:15 +00:00
Scott Taylor 0702527010 Media Grid: general JS cleanup.
Props ericlewis.
See #28965.


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


git-svn-id: http://core.svn.wordpress.org/trunk@29049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-22 16:21:15 +00:00
Helen Hou-Sandí e8ade6be6e Keyboard accessibility for the media modal:
* Arrow keys navigate between items in the grid.
* Transfer focus into the panel when selecting a tab along the side.
* Transfer focus into the details sidebar when selecting an item and vice versa.
* Set initial focus on the close button so that it is visible.

props celloexpressions, lessbloat, ericlewis. fixes #25100, #25101, #28704. see #23560.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-18 07:57:15 +00:00
Helen Hou-Sandí 5267c64e5f Fix jshint errors introduced in [29212]. see #28842.
Built from https://develop.svn.wordpress.org/trunk@29213


git-svn-id: http://core.svn.wordpress.org/trunk@28997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-17 20:46:14 +00:00
Helen Hou-Sandí 06f5b5a490 Media Grid:
Instead of a separate bulk selection mode, persistently show a checkbox for each item. Restores the more familiar bulk actions dropdown + action button.

props ericlewis. see #28842.


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


git-svn-id: http://core.svn.wordpress.org/trunk@28996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-17 20:42:15 +00:00
Dominik Schilling 448422f8ae Media Grid improvements:
* Remove fixed elements.
* Adjusts toolbar and search, fixes #28833.
* Add link to Add New button, fixes #28825.
* Add "Edit Metadata" tab to all items, "Edit Image" only for images
* Make strings translatable.
* First pass for help tab.

see #28850.
Built from https://develop.svn.wordpress.org/trunk@29136


git-svn-id: http://core.svn.wordpress.org/trunk@28920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-13 16:16:15 +00:00
Scott Taylor ba688f4ff9 In the Post/Select frames, for audio files:
* Show `artist` and `album` fields in the Attachment Details sidebar
* Sync their values on `change`

See #28839.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 21:02:15 +00:00
Scott Taylor 59ffcf668b Media Grid, for audio files:
* Show `artist` and `album` fields in the Edit Attachment modal
* Sync their values on `change`

See #28839.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 20:55:15 +00:00
Scott Taylor c22c49a1ba Media Grid: "Add New" should open and close, not just open.
See #24716.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 05:44:14 +00:00