Commit Graph

191 Commits

Author SHA1 Message Date
Andrew Nacin
88f61468b3 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: http://core.svn.wordpress.org/trunk@23076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 19:07:48 +00:00
Andrew Nacin
c42ae7acb6 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: http://core.svn.wordpress.org/trunk@23075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 19:03:38 +00:00
Mark Jaquith
bc8ddb3e64 Intelligently make media fields readonly when the user cannot update or do anything with them. props koopersmith, helenyhou, nacin. fixes #22613
git-svn-id: http://core.svn.wordpress.org/trunk@23072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 10:29:24 +00:00
Mark Jaquith
4d35b3409b Implement tabbing between fields in the media modal. props lessbloat, koopersmith. fixes #22659
git-svn-id: http://core.svn.wordpress.org/trunk@23070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 09:57:58 +00:00
Mark Jaquith
d8d39ff764 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: http://core.svn.wordpress.org/trunk@23069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 09:43:10 +00:00
Mark Jaquith
e84a4a0c89 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: http://core.svn.wordpress.org/trunk@23068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 09:25:17 +00:00
Mark Jaquith
98fb6e45d7 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: http://core.svn.wordpress.org/trunk@23067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 09:04:19 +00:00
Ryan Boren
c4d04dd476 Clear the From URL view in the media modal after inserting an image. Improve button enable checks.
Props koopersmith
fixes #22740


git-svn-id: http://core.svn.wordpress.org/trunk@23065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 04:43:51 +00:00
Mark Jaquith
b6982a0804 Allow a sortable options hash to be passed in, so you can override the defaults. props koopersmith. see #22696
git-svn-id: http://core.svn.wordpress.org/trunk@23064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 04:11:49 +00:00
Andrew Nacin
e1405b6f1d Media: Don't try to resize the bottom selection UI. props koopersmith. fixes #22748.
git-svn-id: http://core.svn.wordpress.org/trunk@23056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 01:38:44 +00:00
Daryl Koopersmith
81d474cda0 Toggle display of plupload overlays when the select files button is hidden. see #22732.
git-svn-id: http://core.svn.wordpress.org/trunk@23053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 00:45:21 +00:00
Andrew Nacin
d720772ef3 Media: Return to the library when the editing a selection and all items get de-selected. props koopersmith. fixes #22715.
git-svn-id: http://core.svn.wordpress.org/trunk@23051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 00:22:11 +00:00
Ryan Boren
51db7de93b 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: http://core.svn.wordpress.org/trunk@23048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 23:07:41 +00:00
Andrew Nacin
d47267224c When adding images to a gallery, use "Images" as the filter name, rather than "All media items". props koopersmith. fixes #22722.
git-svn-id: http://core.svn.wordpress.org/trunk@23041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 20:51:37 +00:00
Andrew Nacin
1c5c724b3a Media: Properly select the select element's option in the attachment display settings. props koopersmith. fixes #22693.
git-svn-id: http://core.svn.wordpress.org/trunk@23037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 19:38:16 +00:00
Ryan Boren
53f5c1cdc7 Better dropdown select handling.
Props cdog, koopersmith
fixes #22693


git-svn-id: http://core.svn.wordpress.org/trunk@23033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 18:50:49 +00:00
Ryan Boren
a200c702e0 Only show Delete in media modal if the user can delete.
Props nacin, koopersmith
fixes #22711


git-svn-id: http://core.svn.wordpress.org/trunk@23032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 18:33:51 +00:00
Ryan Boren
8603ed6082 Media: Hide "Edit" link in the selection view when it doesn't make sense
Props koopersmith, ocean90, nacin
fixes #22713


git-svn-id: http://core.svn.wordpress.org/trunk@23031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 18:23:47 +00:00
Mark Jaquith
bc09152660 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: http://core.svn.wordpress.org/trunk@23029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 17:58:24 +00:00
Mark Jaquith
82d51aeeef Update toolbars for Embed screen. Fixes JS error. props koopersmith. fixes #22714
git-svn-id: http://core.svn.wordpress.org/trunk@23028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 17:45:24 +00:00
Andrew Nacin
d2a9957ad8 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: http://core.svn.wordpress.org/trunk@23024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 16:21:57 +00:00
Mark Jaquith
55ac7a4565 Fix a typo in media-views.js that referenced frame.router.get() instead of frame.router. Fixes #22710
git-svn-id: http://core.svn.wordpress.org/trunk@23015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 05:18:21 +00:00
Andrew Nacin
156c5fef0f 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: http://core.svn.wordpress.org/trunk@23008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 04:04:45 +00:00
Ryan Boren
61a9471024 Final round of media UX improvements.
Props koopersmith
fixes #21390 #22502


git-svn-id: http://core.svn.wordpress.org/trunk@23006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 01:26:03 +00:00
Ryan Boren
63662a9b7b In the QuickPress media modal, use the new post id when a post is published.
Props nacin, koopersmith
fixes #22673


git-svn-id: http://core.svn.wordpress.org/trunk@22994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 07:17:10 +00:00
Ryan Boren
0848a51955 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: http://core.svn.wordpress.org/trunk@22993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 07:04:34 +00:00
Ryan Boren
c06ffe745f Show a spinner when attachment details are saved.
Props koopersmith
see #22613


git-svn-id: http://core.svn.wordpress.org/trunk@22991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 06:37:49 +00:00
Ryan Boren
01adc2740e Show Select Files button the first time the media modal is opened.
Props koopermsith
fixes #22691


git-svn-id: http://core.svn.wordpress.org/trunk@22990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 06:32:25 +00:00
Ryan Boren
23ed804180 Add random and reverse sorting options to gallery settings.
Props koopersmith
fixes #22637


git-svn-id: http://core.svn.wordpress.org/trunk@22987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 05:32:25 +00:00
Andrew Nacin
6d711428b4 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: http://core.svn.wordpress.org/trunk@22985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 04:54:03 +00:00
Ryan Boren
b382901778 Update gallery editing to work with the modal changes. Add nice handling for default states.
Props koopersmith
see #21776


git-svn-id: http://core.svn.wordpress.org/trunk@22984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 04:38:10 +00:00
Andrew Nacin
5d0933d884 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: http://core.svn.wordpress.org/trunk@22979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 02:38:10 +00:00
Andrew Nacin
27bf82201b 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: http://core.svn.wordpress.org/trunk@22967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-02 16:06:31 +00:00
Ryan Boren
ebe9cd7395 In the media modal, show the Link To: url.
Props nacin
fixes #22662


git-svn-id: http://core.svn.wordpress.org/trunk@22965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-02 00:43:08 +00:00
Ryan Boren
af42700ebd Resolve race conditions in Attachments.more().
Props koopersmith
fixes #22656


git-svn-id: http://core.svn.wordpress.org/trunk@22957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 16:45:43 +00:00
Ryan Boren
59456a9cea 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: http://core.svn.wordpress.org/trunk@22956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 16:41:38 +00:00
Ryan Boren
f07c7f5163 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: http://core.svn.wordpress.org/trunk@22952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 15:19:11 +00:00
Ryan Boren
b73c43e0e2 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: http://core.svn.wordpress.org/trunk@22951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 15:11:44 +00:00
Ryan Boren
d4abd95449 Scope button classes so they can be used on the frontend without interfering with theme styles.
Props helenyhou, koopersmith
fixes #22644


git-svn-id: http://core.svn.wordpress.org/trunk@22948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 13:40:59 +00:00
Andrew Nacin
5d9fcc48b6 Pressing escape now closes the media modal. props koopersmith, see #22502.
git-svn-id: http://core.svn.wordpress.org/trunk@22946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 08:37:17 +00:00
Ryan Boren
e656d19a30 Improve switching between browser and upload state.
Props koopersmith
fixes #22628


git-svn-id: http://core.svn.wordpress.org/trunk@22945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 06:01:47 +00:00
Ryan Boren
a986fd1509 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: http://core.svn.wordpress.org/trunk@22938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 01:55:37 +00:00
Ryan Boren
5f7f9c5520 Revert accidental bits from r22919. see #22628
git-svn-id: http://core.svn.wordpress.org/trunk@22923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-29 16:58:08 +00:00
Ryan Boren
7188bff165 Icons for select, deselect, and window close in the media modal.
Props JerrySarcastic, helenyhou, ocean90, lessbloat
fixes #22610


git-svn-id: http://core.svn.wordpress.org/trunk@22919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-29 13:33:57 +00:00
Ryan Boren
a5253fd686 Media modal: Don't fire two AJAX calls on settings update.
Props koopersmith
fixes #22611


git-svn-id: http://core.svn.wordpress.org/trunk@22907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-28 22:27:13 +00:00
Andrew Nacin
bffb901334 Check if the object is empty, as objects are always truthy. props koopersmith. see #22593.
git-svn-id: http://core.svn.wordpress.org/trunk@22892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-28 04:41:24 +00:00
Andrew Nacin
32c57c6b6a 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: http://core.svn.wordpress.org/trunk@22889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-28 02:28:10 +00:00
Andrew Nacin
b70cb2d284 Ensure attachment modal details are saved before the attachment details view is destroyed. props koopersmith. fixes #22593.
git-svn-id: http://core.svn.wordpress.org/trunk@22888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-28 02:03:31 +00:00
Andrew Nacin
dd3cd96bac 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: http://core.svn.wordpress.org/trunk@22882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 23:20:12 +00:00
Ryan Boren
939a47ba48 Add a delete link to the media modal.
Props merty, nacin, koopersmith
fixes #22524


git-svn-id: http://core.svn.wordpress.org/trunk@22869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 15:50:59 +00:00