Commit Graph

337 Commits

Author SHA1 Message Date
Helen Hou-Sandi 15147020c8 Correct phpdoc @since for wp_oembed_remove_provider(). props hebbet. fixes #22788.
git-svn-id: https://develop.svn.wordpress.org/trunk@23186 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-20 15:22:21 +00:00
Ryan Boren 85b8c87a7e Introduce previous_image_link and next_image_link filters. Allows customizing the gallery display order.
Props nacin
fixes #22829 for trunk


git-svn-id: https://develop.svn.wordpress.org/trunk@23139 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-09 19:54:23 +00:00
Andrew Nacin 24027fdcd7 A neditor is a curious multi-celled organism found deep in the Content Management System "WordPress". It generally subsides on good content. It has an obsession with retina-quality graphical elements, and also has a strong affinity for puns. Occasionally, ACCIDENTAL CAPS LOCK occurs. Some organisms carry British accents; these are prone to changing state but then reverting to their previous state soon after. One has shown superior sleuthing abilities, despite having hardly left its Uni laboratory. Organisms from Australia are usually found deeper in the Content Management System, most of its energy spent on locomotion.
The attitude of a neditor is best described as cranky optimism. Younger organisms are more eager, but quickly tire after working on little sleep. They eventually evolve into the cranky optimism stage in a process that generally takes three to five months.



git-svn-id: https://develop.svn.wordpress.org/trunk@23105 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 09:01:11 +00:00
Andrew Nacin b540525589 Break wp_print_media_templates() into wp-includes/media-template.php and lazy-load that file through wp_enqueue_media(). fixes #22778.
git-svn-id: https://develop.svn.wordpress.org/trunk@23101 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 07:10:20 +00:00
Mark Jaquith affd3a9a98 Remove the "Describe this ___" string on captions in the attachment details view. WP <3 patches with net red. props helenyhou. fixes #22777
git-svn-id: https://develop.svn.wordpress.org/trunk@23097 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 06:35:13 +00:00
Mark Jaquith 6247c1289c Present the correct downsized image dimensions in the Media modal when inserting. Introduces a context parameter for image_constrain_size_for_editor() instead of relying on is_admin(). props jond3r, nacin. fixes #22738
git-svn-id: https://develop.svn.wordpress.org/trunk@23096 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 06:25:39 +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
Andrew Nacin dc3a34b19b Restore captions for non-image attachments. see #22759.
git-svn-id: https://develop.svn.wordpress.org/trunk@23087 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:36:17 +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
Andrew Nacin f79847866e Media IE7 fixes. props azaozz, lessbloat. fixes #22732.
git-svn-id: https://develop.svn.wordpress.org/trunk@23061 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 03:15:53 +00:00
Andrew Nacin a033ad1ab2 Image editor doc fixes. props DH-Shredder. see #6821.
git-svn-id: https://develop.svn.wordpress.org/trunk@23038 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 19:42:28 +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
Andrew Nacin dffb1b36d5 Add context to the 'Random' string. It is now used in two places: gallery order and the links widget. props pavelevap, fixes #22724.
git-svn-id: https://develop.svn.wordpress.org/trunk@23021 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 14:49:44 +00:00
Andrew Nacin 3864c9848c Media: Remove four unused strings. props dimadin. fixes #22688.
git-svn-id: https://develop.svn.wordpress.org/trunk@23011 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 04:16:56 +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 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 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 86a0b9ad45 Media: Prevent the compat view from wrapping around the attachment details. Allow the filename to break-word. props koopersmith, SergeyBiryukov. fixes #22667.
git-svn-id: https://develop.svn.wordpress.org/trunk@22983 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 04:15:32 +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
Daryl Koopersmith 8a6d1c5b89 Prevent small thumbnails from being upscaled. props helenyhou. fixes #22681.
git-svn-id: https://develop.svn.wordpress.org/trunk@22978 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 00:42:26 +00:00
Andrew Nacin 8cd2af059b Media templates: Make sure we have a width and height before printing dimensions. We don't calculate dimensions for icons. fixes #22680.
git-svn-id: https://develop.svn.wordpress.org/trunk@22976 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 21:53:45 +00:00
Andrew Nacin 1839a359b9 Add wp_enqueue_media action to the function of the same name. props koopersmith, fixes #22678.
git-svn-id: https://develop.svn.wordpress.org/trunk@22969 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 16:33:20 +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 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
Ryan Boren cdce6a366e Introduce API to add back the description field in the new media popup.
Props nacin
fixes #22642


git-svn-id: https://develop.svn.wordpress.org/trunk@22929 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 23:52:30 +00:00
Ryan Boren 49b230b82a 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@22920 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 14:36:12 +00:00
Ryan Boren bb1760e226 Route uploads through async-upload.php instead of admin-ajax.php.
Props nacin, koopersmith
fixes #22622


git-svn-id: https://develop.svn.wordpress.org/trunk@22902 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 20:17:57 +00:00
Andrew Nacin 2520705252 Media: Rename the dialog to 'Add Media' from 'Insert Media' to match the button. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22895 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 17:18:50 +00:00
Andrew Nacin 82622db77e In the gallery shortcode, handle mapping of "ids" to include and orderby before the post_gallery filter. see #21816. fixes #22617.
git-svn-id: https://develop.svn.wordpress.org/trunk@22891 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 03:51:27 +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 6b911fa633 wp_print_media_templates() does not take an argument.
git-svn-id: https://develop.svn.wordpress.org/trunk@22884 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 23:50:26 +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 d2d01ad797 Always send nocache_headers() for admin-ajax.php. This prevents iOS from caching ajax calls. http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results
Turn off multi selection uploads for mobile devices. Currently Plupload cannot upload multiple files in iOS Safari. Only the first file makes it to the queue. 

Empty wp on unload to work around caching in iOS Safari.

Props azaozz, miqrogroove, nacin

fixes #22552


git-svn-id: https://develop.svn.wordpress.org/trunk@22872 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 16:17:53 +00:00
Ryan Boren e0a32fe27b Fix overflow of long filenames in the media modal.
Props koopersmith, GregLone
fixes #22554


git-svn-id: https://develop.svn.wordpress.org/trunk@22870 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:58:47 +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
Andrew Nacin 929d79714b Remove wp_image_editor_class filter. wp_image_editors is sufficient. props scribu. fixes #22538.
git-svn-id: https://develop.svn.wordpress.org/trunk@22859 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 02:27:11 +00:00
Ryan Boren 283e33bd58 Make wp_prepare_attachment_for_js() compatible with plugins that disable all intermediate image sizes (so no images are created on upload), and then create them on the fly using the image_downsize filter (say, with a URL that can dynamically create images on the fly).
Props nacin
fixes #22598


git-svn-id: https://develop.svn.wordpress.org/trunk@22850 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:46:56 +00:00
Ryan Boren 7ce1968d15 In media_buttons(), consult global post_ID if get_post() comes up with nothing.
Default postID to 0 in wp_enqueue_media().

Props nacin
fixes #22085


git-svn-id: https://develop.svn.wordpress.org/trunk@22846 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:03:37 +00:00
Daryl Koopersmith 383e24fcfe Add print_media_templates action to allow custom templates to be added. props ocean90. fixes #22565, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22832 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-25 21:45:30 +00:00
Ryan Boren 7fbcbebc3d Handle attachments that have an empty mime type or a mime type without a subtype.
Props SergeyBiryukov
fixes #22532


git-svn-id: https://develop.svn.wordpress.org/trunk@22830 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-23 16:32:21 +00:00
Daryl Koopersmith f20573509b Media: Use a full uploader status view in the inline uploader. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22825 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 12:54:49 +00:00
Daryl Koopersmith 2070f5ca49 Media: Add uploader error detection to the inline uploader view as well. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22824 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 12:35:05 +00:00
Daryl Koopersmith 99def3ec51 Media: Make friends with media_upload_form. Adds notices for browser incompatibility, upload limits, maximum file size, and large file issues to the uploader. fixes #22243, see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22821 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 11:46:03 +00:00
Daryl Koopersmith 77ed607d8e Media: Make the pre-upload-ui hooks share an element with the post-upload-ui hooks. see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22819 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 10:57:43 +00:00
Daryl Koopersmith b007f89d0d Media: Display WordPress and plupload error messages whenever an upload fails. see #22243, #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22818 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 10:56:10 +00:00
Andrew Nacin f44d1d009e WP_Image_Editor: the last stand.
* Have wp_get_image_editor() rather than WP_Image_Editor::get_instance(). Having static factory methods would be less confusing if there weren't also static methods tied to individual editor implementations.
 * Lazy-load the WP_Image_Editor base class and editor implementations.
 * Have WP_Image_Editor_GD::supports_mime_type() actually check which types it supports.
 * Deprecate gd_edit_image_support() in favor of wp_image_editor_supports().

props DH-Shredder, scribu, markoheijnen. fixes #22356. see #6821.



git-svn-id: https://develop.svn.wordpress.org/trunk@22817 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 09:52:16 +00:00
Daryl Koopersmith ff6ae18d2d Media: Add global upload progress to the sidebar. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22816 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 09:32:21 +00:00
Daryl Koopersmith 4a99fa363e Media: Move sidebar from the frame view to the attachment browser view. Prevents juggling sidebar visibility state, and makes managing sidebar contents more reasonable. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22809 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 06:30:25 +00:00
Daryl Koopersmith bf42e8a402 Media: Make the window-wide uploader a subview of the frame view.
Allows the uploader to leverage the ready event to know when it has been attached to the page.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22790 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 20:27:49 +00:00
Andrew Nacin e4759d815d Support attachment_fields_to_save and attachment_fields_to_edit for attachments going through post.php. see #22186. see #21391.
git-svn-id: https://develop.svn.wordpress.org/trunk@22783 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 18:53:00 +00:00
Daryl Koopersmith 8ce1f39c6c Media: Move the new sections of media-upload.js to media-editor.js to allow the media modal to be used on the front end and prevent dependency conflicts with older themes and plugins. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22770 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 16:46:32 +00:00
Daryl Koopersmith 9a2033cabc Media: Backwards compatibility for the many send_to_editor filters. props nacin. see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22768 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 16:02:20 +00:00
Daryl Koopersmith 493572fd09 Media: Backwards compatibility for the disable_captions filter. see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22761 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 14:27:22 +00:00
Andrew Nacin 59be9048dd Stop inserting title attributes for images inserted into the editor by modifying get_image_send_to_editor(), not the generic get_image_tag().
see #18984, [22409].



git-svn-id: https://develop.svn.wordpress.org/trunk@22747 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 11:50:30 +00:00
Daryl Koopersmith 8e6aa60fa4 Media: Dynamically generate attachment filters using get_post_mime_types().
Moves `get_post_mime_types()` from `wp-admin/includes/post.php` to `wp-includes/post.php`.

fixes #22514, see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22743 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 10:18:59 +00:00
Andrew Nacin db7dc96921 Media: For pages, use 'Insert into page' rather than 'Insert into post'.
Custom post types can use the media_view_strings filter. No new post type "labels" for now.

see #22712. see #21092 (and #19696).



git-svn-id: https://develop.svn.wordpress.org/trunk@22735 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-20 23:22:03 +00:00
Daryl Koopersmith 76c67989a7 Media: Add filters to the media library. fixes #22514, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22712 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-20 13:49:35 +00:00
Daryl Koopersmith ce06a037dd Media: Attachment checkboxes now function as such. fixes #22462, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22706 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-20 11:10:04 +00:00
Andrew Nacin 1f5e71fd3a Add media_view_settings and media_view_strings hooks. fixes #21092 for 3.5. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22702 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-20 02:58:33 +00:00
Andrew Nacin 870d1d05db Revert [22675]. wp_mime_type_icon() is more accurate when given a post ID, rather than a mime type. The "speed" mostly comes down to the ordering of cache hits, rather than any performance issues like #22503. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22677 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 08:44:37 +00:00
Andrew Nacin 68a3e80d4d wp_mime_type_icon() is faster when given a mime type, rather than a post ID. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22675 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 08:39:14 +00:00
Daryl Koopersmith 893c538066 Media: Only show the alignment setting when viewing an image. fixes #21836, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22671 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 07:24:47 +00:00
Daryl Koopersmith 2411401f1b Media: Remove unused batch edit states and strings. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22658 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 03:11:48 +00:00
Daryl Koopersmith 101c5a5371 Media: Add a base view class.
* Centralizes view and subview management, unifying several disjointed constructs.
* Utilizes the `dispose` functionality found in Backbone master, providing a standard method for memory management.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22648 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 00:36:47 +00:00
Daryl Koopersmith 7ce0c04466 Media: Wrap the embed screen's alignment setting in a div instead of a label to avoid default browser selection behavior. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22608 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-16 01:49:11 +00:00
Daryl Koopersmith ee694739ec Media: Update in-grid captions.
* Use input fields instead of textboxes (which provide better handling for smaller attachments).
* Provide `data-setting` properties to properly sync the changes.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22603 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-15 23:53:06 +00:00
Daryl Koopersmith bf105feb4e Media: Enter batch insert workflow by editing the selection instead of having an explicit button. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22594 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-15 02:36:06 +00:00
Daryl Koopersmith 55a3f09ec4 Media: Improve image size-related UI and code.
* Add dimensions to the "sizes" dropdown.
* Ensure a `full` size is generated in `wp_prepare_attachment_for_js()`.
* Print the dimensions for the full size in the attachment summary (instead of those for the current size).
* When generating the attachment view's template, map `imageSize()` to the `size` property instead of overriding the default data.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22580 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-14 22:08:02 +00:00
Daryl Koopersmith 57e98a72d2 Media: Convert templates to use a data variable instead of with statements. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22578 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-14 21:51:41 +00:00
Daryl Koopersmith f684d6abc2 Media: Make edit gallery button use new media. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22568 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-14 09:06:10 +00:00
Daryl Koopersmith 9fb6e29102 Media: Add support for applicable *-upload-ui hooks.
Supports pre-upload-ui, pre-plupload-upload-ui, post-plupload-upload-ui, post-upload-ui.

see #22186, #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22557 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-13 01:50:08 +00:00
Daryl Koopersmith e0df0a74ca Media: Improve backwards compatibility for image_size_names_choose filter. see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22556 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-13 01:23:18 +00:00
Daryl Koopersmith 4ee51a98cb Media: Add an "upload more files" button to upload states. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22552 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-12 23:52:17 +00:00
Daryl Koopersmith f6a737ed34 Media: Add Embed from URL tab.
Note: There is a bug that currently blocks adding several successive embeds.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22547 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-12 05:57:12 +00:00
Daryl Koopersmith 9cd3c458c7 Media: Ensure variables in the attachment details template have defined defaults.
* Adds styling to the upload progress bar in the attachment details template.
* Defines the `filename` attribute when Plupload creates the client-side `Attachment` model.

fixes #22410, see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22543 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-11 05:16:41 +00:00
Daryl Koopersmith 57b09463e6 Media: Add backwards compatibility for attachment_fields_to_edit and attachment_fields_to_save. see #22186.
git-svn-id: https://develop.svn.wordpress.org/trunk@22541 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-11 01:26:42 +00:00
Daryl Koopersmith 5096f387d1 Media: Add custom URL as an option to attachment display properties. see #21390, #22206.
git-svn-id: https://develop.svn.wordpress.org/trunk@22537 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 20:36:46 +00:00
Daryl Koopersmith 62fe5ba600 Media: Add title, caption, and alt text, and attachment info to sidebar.
* Improve sidebar styles.
* Separate the hybrid title/caption field.
* Improve the sidebar image thumbnail.
* Remove filenames from inside the non-image icon thumbnail.
* Properly sync title/caption/alt.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22532 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 18:25:04 +00:00
Daryl Koopersmith fefaea2cf1 Media: Add instructions to drag and drop to reorder images on gallery and batch edit pages.
Removes search boxes from these pages as well.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22529 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 09:11:33 +00:00
Andrew Nacin e6fcf3b013 Don't unnecessarily translate media upload tab strings. see #22186.
git-svn-id: https://develop.svn.wordpress.org/trunk@22524 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 07:56:17 +00:00
Daryl Koopersmith 847a00f84b Media: Backwards compatibility for media_upload_tabs.
* Adds `createIframeStates()` to the `MediaFrame` view. It creates states and bindings for the `media_upload_tabs` output, and is included on `MediaFrame.Post` by default.
* Hijacks `tb_remove()` when the media modal is open to ensure the modal closes correctly.
* Adds a `chromeless` parameter to thickbox media tab URLs to render the UI without the old row of tabs.

see #22186, #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22523 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 07:51:37 +00:00
Daryl Koopersmith f8002c7752 Media: Relocate localization to wp_enqueue_media(). see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22516 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 00:37:13 +00:00
Daryl Koopersmith b06d75f58b Media: Add size dropdown to attachment display settings in the media modal. fixes #22206, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22493 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-09 06:15:25 +00:00
Daryl Koopersmith 2189575beb Media: Add wp_enqueue_media to easily include all media dependencies.
Also, media templates now print on `wp_footer`.

props sushkov. fixes #22060, see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22489 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-09 04:57:25 +00:00
Andrew Nacin 97490d8911 Allow wp_plupload_default_settings() to be called multiple times without doubling up the output. see #22060.
git-svn-id: https://develop.svn.wordpress.org/trunk@22488 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-09 04:51:25 +00:00
Daryl Koopersmith 68d143d20d Media: Improve sidebar handling and make attachment display properties attachment-specific.
`wp.mce.media`
* Watch all workflows for the `insert` event and attempt to insert the current state's `selection` if it exists.
* Fetch and pass attachment display properties through to `wp.media.string.image()`.

`wp.media.controller.Region`
* Separate the concept of events and modes.
* All events triggered on a `Region` trigger both `event` and `event:mode` callbacks.
* When a mode is deactivated, `deactivate` and `deactivate:mode` events are fired.
* When a mode is activated, `activate` and `activate:mode` events are fired.

`wp.media.controller.Library`
* Remove the `details()`, `buildDetails()`, and `clearDetails()` methods that juggled sidebar views. Instead, handle the sidebar views using modes.

`wp.media.controller.Gallery`
* Shift the overloaded `sidebar()` method to use modes.

`wp.media.view.MediaFrame.Post`
* Declare `activate:mode` event bindings using an nested object to reduce repetition.
* Update sidebar activation callbacks.

`wp.media.view.Settings`
* Refactor to leverage HTML data attributes and implicit values (instead of setting the fallback whenever an object was created). This has the additional benefit that gallery shortcode parameters are not output when the user has left them set to the default.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22466 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-08 14:15:09 +00:00
Daryl Koopersmith b636e94e47 Media: Integrate the gallery workflow with the media menu.
`wp.media.model.Query.more()`
* If a request has already been sent out for more attachments, return that request object instead of creating another.

`wp.media.controller.Region`
* A region allows views to be swapped in and out of a section of the page without either view having to know about the other.
* Application components can use the same callbacks and resources by leveraging `Region.mode()`, which triggers a set of callbacks to create or transform the current view, but only if necessary.

`wp.media.view.Frame`
* Leverage `Region` controllers instead of forcing states to swap view objects, which causes states to fit more comfortably in the controller-camp.
* Add `previous()`, a method to fetch the previous state `id`.
* Separate out the default settings over several objects (so blank frames can be instantiated).

`wp.media.view.MediaFrame`
* The base `Frame` used for media management: handles integration with the `Modal` and `UploaderWindow` views.

`wp.media.view.MediaFrame.Post`
* Includes all default media states and callbacks necessary for inserting media into a post.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22437 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-07 20:14:41 +00:00
Daryl Koopersmith c0ab768faa Use Mustache-insipired template tags.
Underscore's default ERB-style templates are incompatible with PHP when asp_tags is enabled. As a result, we've settled on an alternative syntax that should be familiar to devs: Mustache-inspired for interpolating and escaping content, and ERB-inspired for execution.

	`{{{a}}}` - interpolating
	`{{ a }}` - escaping
	`<# a #>` - execution

props rmccue. fixes #22344, see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22415 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-07 08:41:17 +00:00
Andrew Nacin 8d1e29d8b6 Stop adding title attributes to images (in the old media uploader). props martythornley. fixes #18984.
git-svn-id: https://develop.svn.wordpress.org/trunk@22409 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-06 23:23:03 +00:00
Daryl Koopersmith 737ed62a1c Streamlining media, part I.
The main goal here is to rearrange the media components in a modularized structure to support more linear workflows. This is that structure using the pre-existing workflows, which will be improved over the course of the next few commits.

This leaves a few pieces a bit rough around the edges: namely gallery editing and selecting a featured image.

The fine print follows.

----

'''Styles'''
* Tightened padding around the modal to optimize for a smaller default screen size.
* Added a light dashed line surrounding the modal to provide a subtle cue for the persistent dropzone (which is evolving into a power user feature since we now have a dedicated `upload` state).
* Add a size for `hero` buttons.
* Remove transitions from frame subviews (e.g. menu, content, sidebar, toolbar).

----

'''Code'''

`wp.media.controller.StateManager`
* Don't fire `activate` and `deactivate` if attempting to switch to the current state.

`wp.media.controller.State`
* Add a base state class to bind default methods (as not all states will inherit from the `Library` state).
* On `activate`, fire `activate()`, `menu()`, `content()`, `sidebar()`, and `toolbar()`.
* The menu view is often a shared object (as its most common use case is switching between states). Assign the view to the state's `menu` attribute.
* `menu()` automatically fetches the state's `menu` attribute, attaches the menu view to the frame, and attempts to select a menu item that matches the state's `id`.

`wp.media.controller.Library`
* Now inherits from `wp.media.controller.State`.

`wp.media.controller.Upload`
* A new state to improve the upload experience.
* Displays a large dropzone when empty (a `UploaderInline` view).
* When attachments are uploaded, displays management interface (a `library` state restricted to attachments uploaded during the current session).

`wp.media.view.Frame`
* In `menu()`, `content()`, `sidebar()`, and `toolbar()`, only change the view if it differs from the current view. Also, ensure `hide-*` classes are properly removed.
*

`wp.media.view.PriorityList`
* A new container view used to sort and render child views by the `priority` property.
* Used by `wp.media.view.Sidebar` and `wp.media.view.Menu`.
* Next step: Use two instances to power `wp.media.view.Toolbar`.

`wp.media.view.Menu` and `wp.media.view.MenuItem`
* A new `PriorityList` view that renders a list of views used to switch between states.
* `MenuItem` instances have `id` attributes that are tied directly to states.
* Separators can be added as plain `Backbone.View` instances with the `separator` class.
* Supports any type of `Backbone.View`.

`media.view.Menu.Landing`
* The landing menu for the 'insert media' workflow.
* Includes an inactive link to an "Embed from URL" state.
* Next steps: only use in select cases to allot for other workflows (such as featured images).

`wp.media.view.AttachmentsBrowser`
* A container to render an `Attachments` view with accompanying UI controls (similar to what the `Attachments` view was when it contained the `$list` property).
* Currently only renders a `Search` view as a control.
* Next steps: Add optional view counts (e.g. "21 images"), upload buttons, and collection filter UI.

`wp.media.view.Attachments`
* If the `Attachments` scroll buffer is not filled with `Attachment` views, continue loading more attachments.
* Use `this.model` instead of `this.controller.state()` to allow `Attachments` views to have differing `edge` and `gutter` properties.
* Add `edge()`, a method used to calculate the optimal dimensions for an attachment based on the current width of the `Attachments` container element.
* `edge()` is currently only enabled on resize, as the relative positioning and CSS transforms used to center thumbnails are suboptimal when coupled with frequent resizing.
* Next steps: For infinite scroll performance improvements, look into absolutely positioning attachment views and paging groups of attachment views.

`wp.media.view.UploaderWindow`
* Now generates a `$browser` element as the browse button (instead of a full `UploaderInline` view). Using a portable browse button prevents us from having to create a new `wp.Uploader` instance every time we want access to a browse button.

`wp.media.view.UploaderInline`
* No longer directly linked to the `UploaderWindow` view or its `wp.Uploader` instance.
* Used as the default `upload` state view.

`wp.media.view.Selection`
* An interactive representation of the selected `Attachments`.
* Based on the improved workflows, this is likely overkill. For simplicity's sake, will probably remove this in favor of `SelectionPreview`.

----

see #21390.



git-svn-id: https://develop.svn.wordpress.org/trunk@22362 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-04 22:59:12 +00:00
Daryl Koopersmith 18723b0970 Media: Reduce button size for the link gallery setting. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22345 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 21:03:27 +00:00
Daryl Koopersmith 80cd7ad468 Fix positioning of attachment thumbnail overlays.
Prevents the overlay from blocking buttons inside the attachment preview, such as the remove button in the gallery editor.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22343 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 20:34:50 +00:00
Daryl Koopersmith 3a64c92cf1 Add gallery settings to the media modal.
* Abstracts `wp.media.view.AttachmentDisplaySettings` into `wp.media.view.Settings` for managing lists of settings with button groups and select boxes. Settings can optionally be tied to a user setting (i.e. using `getUserSetting`).
* Adds `wp.media.view.Settings.AttachmentDisplay`.
* Adds `wp.media.view.Settings.Gallery`.

see #21390, #21815.


git-svn-id: https://develop.svn.wordpress.org/trunk@22340 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 19:22:25 +00:00
Daryl Koopersmith 3ca8808c3b Add dynamic attachment view sizing. Removes the attachment view zooming in the process. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22324 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-29 18:05:03 +00:00