Commit Graph

46 Commits

Author SHA1 Message Date
Mark Jaquith fb97e258f9 Restore code that returns the existing media object if it already exists.
props programmin, adamsilverstein. fixes #24062

git-svn-id: https://develop.svn.wordpress.org/trunk@24447 602fd350-edb4-49c9-b593-d223f7449a82
2013-06-19 21:55:17 +00:00
Ryan Boren f5c165c23f Respect the link to setting when inserting a gallery.
Props SergeyBiryukov
fixes #23298


git-svn-id: https://develop.svn.wordpress.org/trunk@24161 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-02 22:07:37 +00:00
Mark Jaquith bab5ddd458 Force gallery state for gallery post format.
props lessbloat, wonderboymusic. fixes #24062.

git-svn-id: https://develop.svn.wordpress.org/trunk@24087 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 05:43:14 +00:00
Mark Jaquith e29dc811f7 Use attachment.url only if it is available, else fall back to props.url.
see #24046. see [24009].

git-svn-id: https://develop.svn.wordpress.org/trunk@24017 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 17:57:51 +00:00
Ryan Boren da23d9b7b8 Revert attachment.url back to props.url. Fixes error that prevents inserting media into the editor.
see #24046


git-svn-id: https://develop.svn.wordpress.org/trunk@24009 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 13:50:12 +00:00
Mark Jaquith 793f27f07e New Post Format UI chooser treatment in response to testing.
* Bigger icons
* Format description under each
* UI hides after choice
* Saving without choosing implies "Standard"
* Helpful text, with "Change format" link

see #24046. props lessbloat, wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@24006 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 04:08:46 +00:00
Sergey Biryukov 18d6bf6198 Add missing semicolon. props kovshenin. see #23831.
git-svn-id: https://develop.svn.wordpress.org/trunk@23998 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-15 23:03:13 +00:00
Mark Jaquith 79c4e52ffa Enforce video dimensions.
props wonderboymusic. see #23831.

git-svn-id: https://develop.svn.wordpress.org/trunk@23969 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-11 22:34:05 +00:00
Mark Jaquith 9b90cd1698 Fix some Insert-into-Post for Audio/Video bugs.
props wonderboymusic. see #23831.

git-svn-id: https://develop.svn.wordpress.org/trunk@23870 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 20:35:23 +00:00
Mark Jaquith 0132e8100c Introduce [audio] and [video] shortcodes, and use MediaElement.js to play them.
props wonderboymusic. see #23282.

git-svn-id: https://develop.svn.wordpress.org/trunk@23729 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-16 05:25:44 +00:00
Andrew Ozz 84827c87dc Media: when copying from "caption" (textarea) to "alt" (text input) also remove line breaks, props kovshenin, fixes #23176 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@23298 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-14 17:34:45 +00:00
Andrew Nacin dec369d6c8 Media: Restore 3.4 behavior by consulting the old-school DB options for default align, size, and link properties.
This restores linking to media files as the default, over attachment pages. This 'default' cannot currently be changed by a user setting (per 3.4 behavior), due to the default database schema.

see #22841, for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@23262 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-04 08:02:16 +00:00
Daryl Koopersmith cc68dcede3 Don't include the default columns="3" in a gallery shortcode.
Shortcode attributes are strings; fix a variable type error in wp.media.gallery defaults.
props adamsilverstein.

see #22919.


git-svn-id: https://develop.svn.wordpress.org/trunk@23247 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-03 06:09:09 +00:00
Andrew Nacin 844c3f322d Remove trailing comma from JS. props koopersmith, fixes #22800.
git-svn-id: https://develop.svn.wordpress.org/trunk@23114 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-07 01:13:04 +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
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
Andrew Nacin 426eb50936 Fix inserting of multiple attachments with captions when the first attachment does not have a caption. props azaozz. fixes #22720.
git-svn-id: https://develop.svn.wordpress.org/trunk@23055 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 00:59:25 +00:00
Andrew Nacin d1c428faed Media: When doing a multiple-insert into the editor, separate each inserted item with two line breaks. props tar.gz. see #22720.
git-svn-id: https://develop.svn.wordpress.org/trunk@23042 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 20:52:58 +00:00
Ryan Boren b5ae45fae3 Fix race condition in media insertion where the inserted html is invalid due to output being interleaved.
Props koopermsith
fixes #22696


git-svn-id: https://develop.svn.wordpress.org/trunk@23012 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 04:38:42 +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 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
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 5c611cde9d Use wp.media, not media, in media-editor.js. see #22676.
git-svn-id: https://develop.svn.wordpress.org/trunk@22972 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 16:55:58 +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 870250e617 Correctly insert images at caret position in IE8/7.
Props lessbloat
fixes #22638


git-svn-id: https://develop.svn.wordpress.org/trunk@22943 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 04:54:09 +00:00
Ryan Boren 3c145e0d49 In the add media modal, fallback back to caption if alt is not set. Falback to title if neither caption nor alt are set.
Props koopersmith
see #18984


git-svn-id: https://develop.svn.wordpress.org/trunk@22937 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 01:38:41 +00:00
Andrew Nacin 5c0e068d3f Send the alt attribute when sending attachments to the editor. fixes #22640.
git-svn-id: https://develop.svn.wordpress.org/trunk@22927 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 21:23:55 +00:00
Ryan Boren 5c04a9daef In the gallery editor, don't stomp on custom shortcode attributes.
Props koopersmith
fixes #22627


git-svn-id: https://develop.svn.wordpress.org/trunk@22912 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 01:06:21 +00:00
Andrew Ozz f2c4ad72d6 Media in Internet Explorer: ensure we save the caret bookmark for IE in TinyMCE for the right instance, fixes #22446
git-svn-id: https://develop.svn.wordpress.org/trunk@22905 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 21:45:10 +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 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
Andrew Nacin bccdaa137d Media in Internet Explorer: Properly insert attachments into the editor at the location of the cursor. props azaozz. fixes #22446.
git-svn-id: https://develop.svn.wordpress.org/trunk@22877 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 19:24:56 +00:00
Andrew Nacin 7f34c3e8ec Media: Introduce wp.media.editor.open(editor_id) and leverage it in distraction-free writing (fullscreen). props azaozz, koopersmith. fixes #22541.
git-svn-id: https://develop.svn.wordpress.org/trunk@22875 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 19:09:00 +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 e12621eccb In wp.media.editor:send, revert back to the old field names used by media_upload_form_handler() for easier back compat.
Fix notices in wp_ajax_send_attachment_to_editor().

Props nacin, azaozz, miqrogroove
fixes #22553


git-svn-id: https://develop.svn.wordpress.org/trunk@22847 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:08:50 +00:00
Andrew Nacin a2eb48c7ab Media: When inserting an attachment, if the item is unattached (no post_parent), attach it to the post. fixes #22085.
git-svn-id: https://develop.svn.wordpress.org/trunk@22843 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 16:34:42 +00:00
Andrew Nacin 9774c85abc Media: Include the link URL when inserting non-image attachments. props koopersmith. fixes #22544.
git-svn-id: https://develop.svn.wordpress.org/trunk@22835 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 03:33:30 +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 fb99782dcd Media: Move send_to_editor to wp.media.editor.insert to prevent redeclaration.
Maintains backwards compatibility by delegating to window.send_to_editor and window.tb_remove if they exist.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22774 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 17:01:40 +00:00
Daryl Koopersmith 815ad62697 Media: Remove unused link-formatting function from media-editor.js. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22773 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 16:50:58 +00:00
Daryl Koopersmith 682afd8c19 Media: Remove dead thickbox code from media-editor.js. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22772 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 16:50:13 +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