Commit Graph

188 Commits

Author SHA1 Message Date
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
Andrew Nacin af63ca6803 Check if the object is empty, as objects are always truthy. props koopersmith. see #22593.
git-svn-id: https://develop.svn.wordpress.org/trunk@22892 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 04:41:24 +00:00
Andrew Nacin 0cebbfe3e6 Media: Remove the link to the browser uploader. The only need for it is large files (> 100MB) in certain browsers (IE, Opera), so we will show the link then only. fixes #22604.
git-svn-id: https://develop.svn.wordpress.org/trunk@22889 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 02:28:10 +00:00
Andrew Nacin 99845d0384 Ensure attachment modal details are saved before the attachment details view is destroyed. props koopersmith. fixes #22593.
git-svn-id: https://develop.svn.wordpress.org/trunk@22888 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 02:03:31 +00:00
Andrew Nacin da9ff4451d When editing a plain, legacy [gallery] shortcode, ensure we are sorting its contents using menu_order.
When attachments are sorted, we convert the shortcode to [gallery ids=""], as before.

props koopersmith.
fixes #22608.



git-svn-id: https://develop.svn.wordpress.org/trunk@22882 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 23:20:12 +00:00
Ryan Boren 6a9c14ed5f Add a delete link to the media modal.
Props merty, nacin, koopersmith
fixes #22524


git-svn-id: https://develop.svn.wordpress.org/trunk@22869 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:50:59 +00:00
Ryan Boren 1f4eed3141 Don't use "embed" when referring to inserting from URL.
Props nacin
fixes #22603


git-svn-id: https://develop.svn.wordpress.org/trunk@22868 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:35:36 +00:00
Ryan Boren b1f07f0ae1 Back compat $_REQUEST['post_id'] for media XHR requests.
Props koopersmith, nacin.
fixes #22588


git-svn-id: https://develop.svn.wordpress.org/trunk@22865 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 14:58:08 +00:00
Ryan Boren 9e26663d18 Rename 'id' to 'state' in menu item view.
Props koopersmith
fixes #22594


git-svn-id: https://develop.svn.wordpress.org/trunk@22851 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:49:45 +00:00