Commit Graph

196 Commits

Author SHA1 Message Date
Andrew Nacin b186d63721 Media: When the attachment details view changes to another view or attachment, save compat fields on destroy. (We already do this for non-compat fields.) props koopersmith. fixes #22776.
git-svn-id: https://develop.svn.wordpress.org/trunk@23098 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 06:56:06 +00:00
Mark Jaquith e0f5f47c57 Add the ability to click "Edit" and kick out to the advanced image editor from within the Media modal. New window, with "Refresh" offered on your return. fixes #22743. props koopersmith, nacin, helenyhou.
git-svn-id: https://develop.svn.wordpress.org/trunk@23095 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 05:52:19 +00:00
Mark Jaquith d801545ff6 New method of managing media selections. There is now a "master" selection in the background. props koopersmith. fixes #22725
* This especially helps when you switch between insert/gallery and have non-images selected (as galleries don't support non-images).
* The views now act as filters on the "master" selection, instead of having their own selections that get passed around.

git-svn-id: https://develop.svn.wordpress.org/trunk@23089 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:55:37 +00:00
Daryl Koopersmith 977deb7d63 Do not alter the body's overflow attribute when the media modal is opened. Fix image insertion in the visual editor in Firefox. props azaozz. fixes #22765.
git-svn-id: https://develop.svn.wordpress.org/trunk@23085 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:15:39 +00:00
Andrew Nacin 1cc12103f5 Restore the Description field to the media UI in 3.5.
We tried in vain -- a noble but ultimately failed effort -- to reduce the number of fields for attachments from four (title, caption, alt, description) to one (caption for images, title otherwise). Alternative text needed to stay for accessibility reasons, of course.

Eventually title returned due to heavy plugin reliance. Description is too used by too many plugins (often times incorrectly -- the caption is more likely the proper field), hence its less-than-triumphant return today.

Version 3.5 has tried to streamline media in a number of ways. Removing fields may have been too much at once, as it forced not only a user interface change, but a paradigm change as well.

Finally, on upload we populate the description field with IPTC/EXIF captions, rather than the caption field. See #22768, this should be fixed. For now, Description stays.

This commit also restores 'Title' attribute editing to the main tab of the Edit Image dialog. The "Title" field no longer populates title attributes for <img> tags by design (for accessibility and other purposes, see #18984). So, here is a more obvious 'workaround' for the tooltip community.

Finally, this:
 * Cleans up the post.php attachment editor, including by showing a prettier form of the mime type.
 * Enables plugins to specifically hide attachment_fields_to_edit from either post.php (where you can create meta boxes) or the modal (which you may not want to clutter), for compatibility reasons.
 * Hides the 'Describe this file...' placeholder when a field is read-only in the modal.

props nacin, helenyhou.
fixes #22759.



git-svn-id: https://develop.svn.wordpress.org/trunk@23083 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 00:41:06 +00:00
Andrew Nacin 0d7c64c9fd Media: Final names for the actions in the dialog sidebar: "Insert from URL" and "Set Featured Image" to go with "Insert Media" and "Create Gallery".
Longer strings (such as a translation) looks excellent when it wraps to another line.

props markjaquith, fixes #22753.



git-svn-id: https://develop.svn.wordpress.org/trunk@23076 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 19:07:48 +00:00
Andrew Nacin bdba526d83 Media: Use '%d selected' for the selection string, and offer a comment to translators to help them find a workable solution with this would-be plural string. fixes #22749. see #22229.
git-svn-id: https://develop.svn.wordpress.org/trunk@23075 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 19:03:38 +00:00
Mark Jaquith 92793b6ec2 Intelligently make media fields readonly when the user cannot update or do anything with them. props koopersmith, helenyhou, nacin. fixes #22613
git-svn-id: https://develop.svn.wordpress.org/trunk@23072 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 10:29:24 +00:00
Mark Jaquith d767e74ae9 Implement tabbing between fields in the media modal. props lessbloat, koopersmith. fixes #22659
git-svn-id: https://develop.svn.wordpress.org/trunk@23070 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 09:57:58 +00:00
Mark Jaquith 81bdf1b5d1 When setting the featured image from the dedicated meta box, only show the featured image section in the media chooser. props koopersmith. fixes #22731
* Less distracting
* Some of these sections won't apply for CPTs without an editor

git-svn-id: https://develop.svn.wordpress.org/trunk@23069 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 09:43:10 +00:00
Mark Jaquith 189d4da5de Fix the "Uploaded to this post" filter in the "Add to gallery" state. fixes #22723
Also, use "images" wording instead of generic "media items" when in a gallery (images-only) context. fixes #22722

Both are props koopersmith

git-svn-id: https://develop.svn.wordpress.org/trunk@23068 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 09:25:17 +00:00
Mark Jaquith aabaa0fb8e Use data on the ui.item to transport the original Sortable index for the update() function. This way extensions can set/access this info in their own custom Sortable functions. see #22696
git-svn-id: https://develop.svn.wordpress.org/trunk@23067 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 09:04:19 +00:00
Ryan Boren 86203fa6bf Clear the From URL view in the media modal after inserting an image. Improve button enable checks.
Props koopersmith
fixes #22740


git-svn-id: https://develop.svn.wordpress.org/trunk@23065 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 04:43:51 +00:00
Mark Jaquith 4413c9514b Allow a sortable options hash to be passed in, so you can override the defaults. props koopersmith. see #22696
git-svn-id: https://develop.svn.wordpress.org/trunk@23064 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 04:11:49 +00:00
Andrew Nacin 01e7e10bf7 Media: Don't try to resize the bottom selection UI. props koopersmith. fixes #22748.
git-svn-id: https://develop.svn.wordpress.org/trunk@23056 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 01:38:44 +00:00
Daryl Koopersmith eae68af55c Toggle display of plupload overlays when the select files button is hidden. see #22732.
git-svn-id: https://develop.svn.wordpress.org/trunk@23053 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 00:45:21 +00:00
Andrew Nacin 3fd91ed4cf Media: Return to the library when the editing a selection and all items get de-selected. props koopersmith. fixes #22715.
git-svn-id: https://develop.svn.wordpress.org/trunk@23051 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 00:22:11 +00:00
Ryan Boren e13e333569 When inserting an image From URL, show the fields only if it looks like we have a valid image.
Props koopersmith
fixes #22740


git-svn-id: https://develop.svn.wordpress.org/trunk@23048 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 23:07:41 +00:00
Andrew Nacin 6d580e34db When adding images to a gallery, use "Images" as the filter name, rather than "All media items". props koopersmith. fixes #22722.
git-svn-id: https://develop.svn.wordpress.org/trunk@23041 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 20:51:37 +00:00
Andrew Nacin 0fa07588c5 Media: Properly select the select element's option in the attachment display settings. props koopersmith. fixes #22693.
git-svn-id: https://develop.svn.wordpress.org/trunk@23037 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 19:38:16 +00:00
Ryan Boren 7e2df6dc07 Better dropdown select handling.
Props cdog, koopersmith
fixes #22693


git-svn-id: https://develop.svn.wordpress.org/trunk@23033 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 18:50:49 +00:00
Ryan Boren fa4b718809 Only show Delete in media modal if the user can delete.
Props nacin, koopersmith
fixes #22711


git-svn-id: https://develop.svn.wordpress.org/trunk@23032 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 18:33:51 +00:00
Ryan Boren eb3dc78a61 Media: Hide "Edit" link in the selection view when it doesn't make sense
Props koopersmith, ocean90, nacin
fixes #22713


git-svn-id: https://develop.svn.wordpress.org/trunk@23031 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 18:23:47 +00:00
Mark Jaquith 0f3c162db6 Fix a Firefox "scroll to bottom" bug when launching the media modal.
* Records main document scroll position when launching media modal.
* Restores position when media modal is closed.
* Also locks background document scrolling while media modal is open, preventing inadvertent scrolling there.

props koopersmith. fixes #22716

git-svn-id: https://develop.svn.wordpress.org/trunk@23029 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 17:58:24 +00:00
Mark Jaquith 4241d42dbe Update toolbars for Embed screen. Fixes JS error. props koopersmith. fixes #22714
git-svn-id: https://develop.svn.wordpress.org/trunk@23028 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 17:45:24 +00:00
Andrew Nacin e961de8af5 Media: Disable 'Insert gallery' and 'Set featured image' if nothing is queued. Converts selection toolbars to use the newer view manager. props koopersmith, fixes #22714.
git-svn-id: https://develop.svn.wordpress.org/trunk@23024 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 16:21:57 +00:00
Mark Jaquith 3c992973bb Fix a typo in media-views.js that referenced frame.router.get() instead of frame.router. Fixes #22710
git-svn-id: https://develop.svn.wordpress.org/trunk@23015 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 05:18:21 +00:00
Andrew Nacin 63aa98ed0c Media: When an image does not have all image sizes available, make sure we insert the requested size into the editor. props koopersmith. fixes #22693.
git-svn-id: https://develop.svn.wordpress.org/trunk@23008 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 04:04:45 +00:00
Ryan Boren 00e20a52dc Final round of media UX improvements.
Props koopersmith
fixes #21390 #22502


git-svn-id: https://develop.svn.wordpress.org/trunk@23006 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 01:26:03 +00:00
Ryan Boren 71d333f660 In the QuickPress media modal, use the new post id when a post is published.
Props nacin, koopersmith
fixes #22673


git-svn-id: https://develop.svn.wordpress.org/trunk@22994 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 07:17:10 +00:00
Ryan Boren 594bbe90df When settting a featured image, move the currently selected image to the beginning of the library if it doesn't exist within the attachments loaded so far.
Props koopersmith
fixes #22494


git-svn-id: https://develop.svn.wordpress.org/trunk@22993 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 07:04:34 +00:00
Ryan Boren 7ad3d2410c Show a spinner when attachment details are saved.
Props koopersmith
see #22613


git-svn-id: https://develop.svn.wordpress.org/trunk@22991 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 06:37:49 +00:00
Ryan Boren c21e4809c3 Show Select Files button the first time the media modal is opened.
Props koopermsith
fixes #22691


git-svn-id: https://develop.svn.wordpress.org/trunk@22990 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 06:32:25 +00:00
Ryan Boren 9cdc4de444 Add random and reverse sorting options to gallery settings.
Props koopersmith
fixes #22637


git-svn-id: https://develop.svn.wordpress.org/trunk@22987 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 05:32:25 +00:00
Andrew Nacin 6b0e365fc0 Media: Don't add menu_order to newly uploaded attachments, to match 3.4 behavior. Reverts a bit of [22967]. props koopersmith. fixes #22607.
git-svn-id: https://develop.svn.wordpress.org/trunk@22985 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 04:54:03 +00:00
Ryan Boren 558d134c6b Update gallery editing to work with the modal changes. Add nice handling for default states.
Props koopersmith
see #21776


git-svn-id: https://develop.svn.wordpress.org/trunk@22984 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 04:38:10 +00:00
Andrew Nacin f88b538001 Bring Featured Images back into the main media dialog.
Most users don't realize that the Featured Image meta box exists; if they do, few use it.

Restores the old meta box UI, including the admin_post_thumbnail_html filter. If a plugin is using _wp_post_thumbnail_html() in conjunction with Thickbox elsewhere, it will also magically still work.

Specific underlying changes:
 * Converts the modal view to use the view manager, which means that a call to open() will automatically call render and attach if necessary.
 * Doesn't automatically set a state in wp.media, to allow code to customize the states to be added before activation.

props koopersmith.
fixes #21776.



git-svn-id: https://develop.svn.wordpress.org/trunk@22979 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 02:38:10 +00:00
Andrew Nacin d8e714d6e3 Allow the 'Uploaded to this post' view to be sorted, saving the resulting order as menu_order.
This functionality is designed to be backwards compatible with manual querying for attachments by menu_order.

props koopersmith.
see #22607.



git-svn-id: https://develop.svn.wordpress.org/trunk@22967 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 16:06:31 +00:00
Ryan Boren 14bd848ee5 In the media modal, show the Link To: url.
Props nacin
fixes #22662


git-svn-id: https://develop.svn.wordpress.org/trunk@22965 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 00:43:08 +00:00
Ryan Boren 0996e3d153 Resolve race conditions in Attachments.more().
Props koopersmith
fixes #22656


git-svn-id: https://develop.svn.wordpress.org/trunk@22957 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 16:45:43 +00:00
Ryan Boren 303f2bd2ff Resolve race conditions in Attachments.more(). Provides for smoother refreshes when searching and properly cleans out content components.
Props koopersmith
fixes #22656


git-svn-id: https://develop.svn.wordpress.org/trunk@22956 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 16:41:38 +00:00
Ryan Boren 06b9663f58 Refine media state machine methods.
* state( id ) becomes setState( id )
* get( id ) becomes state( id )
* state() stays the same
* previous() becomes lastState()

Props koopersmith
fixes #22652


git-svn-id: https://develop.svn.wordpress.org/trunk@22952 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 15:19:11 +00:00
Ryan Boren d7ec10376b Update the "Uploaded to this post" filter view when uploading new files.
* 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: https://develop.svn.wordpress.org/trunk@22951 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 15:11:44 +00:00
Ryan Boren c53137f535 Scope button classes so they can be used on the frontend without interfering with theme styles.
Props helenyhou, koopersmith
fixes #22644


git-svn-id: https://develop.svn.wordpress.org/trunk@22948 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 13:40:59 +00:00
Andrew Nacin be096cf4a5 Pressing escape now closes the media modal. props koopersmith, see #22502.
git-svn-id: https://develop.svn.wordpress.org/trunk@22946 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 08:37:17 +00:00
Ryan Boren 17622c2daa Improve switching between browser and upload state.
Props koopersmith
fixes #22628


git-svn-id: https://develop.svn.wordpress.org/trunk@22945 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 06:01:47 +00:00
Ryan Boren 6b972a4c53 In the media modal, ensure modal events are always fired on its frame. This ensures restoreThickbox() and thus tbRemove() are called properly when clicking the close button of the modal.
Props koopersmith
fixes #22632


git-svn-id: https://develop.svn.wordpress.org/trunk@22938 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 01:55:37 +00:00
Ryan Boren 6fbf7fcfbf Revert accidental bits from r22919. see #22628
git-svn-id: https://develop.svn.wordpress.org/trunk@22923 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 16:58:08 +00:00
Ryan Boren 3ad110f078 Icons for select, deselect, and window close in the media modal.
Props JerrySarcastic, helenyhou, ocean90, lessbloat
fixes #22610


git-svn-id: https://develop.svn.wordpress.org/trunk@22919 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 13:33:57 +00:00
Ryan Boren 4e51b43ad3 Media modal: Don't fire two AJAX calls on settings update.
Props koopersmith
fixes #22611


git-svn-id: https://develop.svn.wordpress.org/trunk@22907 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 22:27:13 +00:00