Commit Graph

262 Commits

Author SHA1 Message Date
Andrew Nacin
2c67dea9bc Media: Add awareness to Attachment Display Settings that audio and video can be embedded.
Also:
 * Add file length metadata to Attachment Details.
 * Round the kb/s bitrate on post.php.

fixes #24449.



git-svn-id: http://core.svn.wordpress.org/trunk@24777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-23 05:39:08 +00:00
Daryl Koopersmith
452c0f4166 Add Backbone property to the wp-backbone namespace. See #24424.
git-svn-id: http://core.svn.wordpress.org/trunk@24367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-26 06:34:33 +00:00
Daryl Koopersmith
b8ce442044 Update the subview controller for the patterns found in Backbone 1.0.
Fixes #24424.


git-svn-id: http://core.svn.wordpress.org/trunk@24361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-25 21:38:12 +00:00
Daryl Koopersmith
56a6cac328 Extract the base views from media.
See #24424.


git-svn-id: http://core.svn.wordpress.org/trunk@24360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-25 21:03:04 +00:00
Mark Jaquith
262b3bd9b1 Don't allow images to be set as featured image until they have been processed.
props kadamwhite. fixes #23317.

git-svn-id: http://core.svn.wordpress.org/trunk@23956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-10 22:26:55 +00:00
Daryl Koopersmith
2798e396e3 Media: Reset modal after gallery insertion.
Removes hardcoded (and vestigial) 'upload' states in favor of using the default modal state.
When a media toolbar action is triggered, reset the modal after switching to the new state (as opposed to beforehand).

fixes #23675.


git-svn-id: http://core.svn.wordpress.org/trunk@23590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-03 07:36:21 +00:00
Daryl Koopersmith
00d88af87a Update Backbone to 0.9.10. Update media to handle breaking changes.
* When overriding `Backbone.sync()`, ensure the `sync` and `error` events fire consistently.

* `Model#make()` has been removed. Use `$` instead, and be sure to grab the DOM node where necessary (using `[0]`).

* `Collection#get()` now accepts `cid`s. `Collection#getByCid()` has been removed.

* When overriding the `State` constructor, bind `change` callbacks after the default `Model` constructor is called, because the `Model` constructor no longer passes the `silent` flag when calling `set()` for the default attributes.

* In 'change' events, `options.changes` was removed. It can now be accessed through `model.changed`. Check if any attributes have changed by calling `model.hasChanged()`. Also, don't mess with `model.changed`; it persists beyond the scope of a single event.

* `options.index` is no longer be set in the `add` event callback. Use `collection.indexOf(model)` can be used to retrieve the index of a model instead.

props gcorne. fixes #23262.


git-svn-id: http://core.svn.wordpress.org/trunk@23589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-03 07:04:06 +00:00
Andrew Nacin
9a7814c1a0 Don't unnecessarily re-render the attachment details view when editing the title and caption. Re-rendering causes issues with tabbing and focus, and is only necessary for other views (such as "Caption this image..." when editing a gallery).
props koopersmith.
fixes #23054.
for trunk.



git-svn-id: http://core.svn.wordpress.org/trunk@23283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 23:29:20 +00:00
Daryl Koopersmith
a84cef4556 Media: Properly reset the "add to gallery" library to ensure it accurately reflects the current gallery. see #22815.
git-svn-id: http://core.svn.wordpress.org/trunk@23263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 08:28:12 +00:00
Andrew Nacin
c95ff91fe7 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: http://core.svn.wordpress.org/trunk@23262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 08:02:16 +00:00
Daryl Koopersmith
da06cf3e2d Media: Do not update attachment display user settings when a single attachment is inserted.
This is consistent with 3.4 behavior.

see #22841.


git-svn-id: http://core.svn.wordpress.org/trunk@23261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 08:01:19 +00:00
Daryl Koopersmith
774df9900e Media: Check that a router region exists before attempting to access its child views. Add relevant documentation. see #22930.
git-svn-id: http://core.svn.wordpress.org/trunk@23260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 07:08:37 +00:00
Daryl Koopersmith
1132f798f7 Media: Automatically select uploading attachments in single-select workflows.
The code now automatically selects uploading attachments in all workflows. In a workflow that selects multiple attachments, all attachments added to the upload queue are selected. In a workflow that selects a single attachment (e.g. selecting a featured image), the last attachment added to the upload queue is selected.

see #22817.


git-svn-id: http://core.svn.wordpress.org/trunk@23259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 06:44:21 +00:00
Andrew Nacin
94b3fbc8dd Makes sure attachment sizes are correctly deselected in IE. Fixes size selections on insert in IE9. props koopersmith. fixes #22851.
git-svn-id: http://core.svn.wordpress.org/trunk@23163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-10 23:15:53 +00:00
Daryl Koopersmith
c08b897b89 Trailing commas make IE7 cry. fixes #22819.
git-svn-id: http://core.svn.wordpress.org/trunk@23124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-07 20:42:10 +00:00
Ryan Boren
eaefa67006 When inserting from URL in the media modal, retain query params and properly insert the caption code.
Props koopersmith
fixes #22796


git-svn-id: http://core.svn.wordpress.org/trunk@23110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 23:12:59 +00:00
Andrew Nacin
2d9b708b6e 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: http://core.svn.wordpress.org/trunk@23098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 06:56:06 +00:00
Mark Jaquith
1419b404a8 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: http://core.svn.wordpress.org/trunk@23095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 05:52:19 +00:00
Mark Jaquith
54a390bea9 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: http://core.svn.wordpress.org/trunk@23089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 03:55:37 +00:00
Daryl Koopersmith
c75dc67668 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: http://core.svn.wordpress.org/trunk@23085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 03:15:39 +00:00
Andrew Nacin
173806d7a1 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: http://core.svn.wordpress.org/trunk@23083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 00:41:06 +00:00
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
Ryan Boren
2c1d52526a Don't use "embed" when referring to inserting from URL.
Props nacin
fixes #22603


git-svn-id: http://core.svn.wordpress.org/trunk@22868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 15:35:36 +00:00
Ryan Boren
555a87db2f Back compat $_REQUEST['post_id'] for media XHR requests.
Props koopersmith, nacin.
fixes #22588


git-svn-id: http://core.svn.wordpress.org/trunk@22865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 14:58:08 +00:00
Ryan Boren
a6bba833d4 Rename 'id' to 'state' in menu item view.
Props koopersmith
fixes #22594


git-svn-id: http://core.svn.wordpress.org/trunk@22851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-26 22:49:45 +00:00
Ryan Boren
7469f91bc7 Always render the attachment compat view. Assures attachment_fields_to_edit is always fired.
Props koopersmith, Chouby
fixes #22578


git-svn-id: http://core.svn.wordpress.org/trunk@22841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-26 15:05:14 +00:00
Andrew Nacin
24d68b3bcf Media: Watch more events for input changes to catch paste, autocomplete, etc.
Fixes issue where pasting a URL in 'From URL' (via the context menu) did not
enable the insert button, as the event was not yet fired.

props koopersmith.
fixes #22545.



git-svn-id: http://core.svn.wordpress.org/trunk@22836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-26 03:35:28 +00:00
Daryl Koopersmith
5f25155408 Media: Use a full uploader status view in the inline uploader. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 12:54:49 +00:00
Daryl Koopersmith
27e8de7e3a Media: Add uploader error detection to the inline uploader view as well. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 12:35:05 +00:00
Daryl Koopersmith
c5991558be Media: Properly render any pre-existing upload errors in the uploader status. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 12:24:54 +00:00
Daryl Koopersmith
440ec7ef3d 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: http://core.svn.wordpress.org/trunk@22821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 11:46:03 +00:00
Daryl Koopersmith
688b8de348 Media: Display WordPress and plupload error messages whenever an upload fails. see #22243, #22186, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 10:56:10 +00:00
Daryl Koopersmith
1e472d8974 Media: Add global upload progress to the sidebar. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 09:32:21 +00:00
Daryl Koopersmith
e63ef3a443 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: http://core.svn.wordpress.org/trunk@22809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 06:30:25 +00:00
Daryl Koopersmith
98494fdfe1 Media: Check to see if we need more attachments when the browser is attached to the DOM. fixes #22480, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 03:19:08 +00:00
Daryl Koopersmith
f80e93ebf8 Media: Convert the attachments browser to use internal views. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 01:43:31 +00:00
Daryl Koopersmith
de54f9318f Media: Make priority list views leverage the subview management class. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 00:41:39 +00:00
Daryl Koopersmith
4aa6a83d47 Media: Rename PriorityList's add/remove methods to set/unset (to prevent the default remove from being overridden). see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 20:43:42 +00:00
Daryl Koopersmith
452c486d5f Media: Refresh the window-wide uploader whenever a state is activated. Properly unbind controller events. fixes #22504, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 20:34:46 +00:00
Daryl Koopersmith
1923278143 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: http://core.svn.wordpress.org/trunk@22790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 20:27:49 +00:00
Daryl Koopersmith
1480429ec0 Media: Make inline uploader use main dispose method. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 19:54:06 +00:00
Daryl Koopersmith
f8630d2be3 Media: Remove unused variable for state attributes. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 19:21:08 +00:00
Daryl Koopersmith
b5335a5d24 Media: Make the upload state a dedicated screen, instead of including its own library view. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 18:29:53 +00:00
Daryl Koopersmith
7de56d32db Media: Use a more specific class for toolbar buttons. see #22284, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 17:50:02 +00:00
Daryl Koopersmith
5cecff80b8 Media: Calculate image width and height when embedding images. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 14:32:52 +00:00
Daryl Koopersmith
5e39581c13 Media: Remove redundant code.
Make the composite gallery library use `mirror` instead of `observe`, as one method now invokes the other. Also, make `mirror` return the attachment collection for chaining.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 12:11:38 +00:00
Daryl Koopersmith
ff482e86fb Media: Add filters for image-only libraries. see #22514, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 11:04:23 +00:00
Daryl Koopersmith
5b11aea8f5 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: http://core.svn.wordpress.org/trunk@22743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 10:18:59 +00:00
Daryl Koopersmith
a763641235 Media: Remove debug cruft. props ocean90. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 09:28:58 +00:00
Daryl Koopersmith
46bc46d88a Media: Dropping images on the edit gallery view will automatically add those images to the gallery. fixes #22521, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 08:17:45 +00:00
Daryl Koopersmith
d63026f2ba Media: Maintain event bindings in the main embed view. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 14:44:23 +00:00