Commit Graph

138 Commits

Author SHA1 Message Date
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
Daryl Koopersmith
e25565f4b7 Media: Allow all galleries to be sortable. fixes #22488, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 14:04:59 +00:00
Daryl Koopersmith
6fb316b1fb Media: Add filters to the media library. fixes #22514, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 13:49:35 +00:00
Daryl Koopersmith
9350f67e28 Media: Refresh the attachment display settings when the active attachment finishes uploading. fixes #22452, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 11:57:08 +00:00
Daryl Koopersmith
31c525b289 Media: Remove dead dropdown code from button view. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 11:29:00 +00:00
Daryl Koopersmith
220a5175d5 Media: Attachment checkboxes now function as such. fixes #22462, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 11:10:04 +00:00
Daryl Koopersmith
d4744fda0a Media: Prevent undefined errors when media scripts are enqueued outside of wp_enqueue_media(). fixes #22495, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 01:48:37 +00:00
Daryl Koopersmith
05db7000c4 Media: Detect when views are added to the DOM and fire a ready event. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 00:53:02 +00:00
Daryl Koopersmith
663cde2c51 Media: Add render tracking to views. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 22:48:11 +00:00
Daryl Koopersmith
e6943d1033 Media: Add silent options to the views; improve documentation. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 12:11:16 +00:00
Daryl Koopersmith
028d378322 Media: Add a method to fetch the first subview. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 10:41:24 +00:00
Daryl Koopersmith
31576e6c0c Media: Add documentation to media.Views. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 10:40:49 +00:00
Daryl Koopersmith
549b5f61ae Media: Only show the alignment setting when viewing an image. fixes #21836, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 07:24:47 +00:00
Daryl Koopersmith
1af6c38db3 Media: Add default render method to views.
* Use default `render` method in the `Frame` view.
* Rename `Views.attach` to `Views.insert`.
* Add `Views.all` to retrieve all subviews.
* Add `Views.detach` to detach all subviews.
* Detect whether views are going to be reused in `View.set` and `detach` them instead of calling `dispose`.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 06:02:00 +00:00
Daryl Koopersmith
473583a4f4 Media: Allow subviews to be inserted at a specific index. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 04:41:57 +00:00
Daryl Koopersmith
795ba27d10 Media: Convert the attachments browser view's destroy method to the newer dispose method. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 03:33:29 +00:00
Daryl Koopersmith
ff204257db Media: Remove unused batch edit states and strings. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 03:11:48 +00:00
Daryl Koopersmith
25ebc64c20 Media: Remove debug cruft from [22655]. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 02:44:34 +00:00
Daryl Koopersmith
561f01bd79 Media: Optimize media models.
* Merge `Composite` model with general `Attachments` model, as `Attachments.validate` and `Composite.evaluate` were functionally equivalent.
* Queries should only watch `wp.Uploader.queue`, as watching `Attachments.all` results in queries attempting to add attachments before their properties are set (which then results a few too many irrelevant adds/removes). `Attachments.all` should potentially be removed or rethought.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 02:43:10 +00:00
Daryl Koopersmith
10eada54dc Media: Move Attachments view preventDefault handler to the events object. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 01:17:30 +00:00
Daryl Koopersmith
13a3cc30b2 Media: Allow for the views manager to be extended. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 00:54:18 +00:00
Daryl Koopersmith
4256ba0b48 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: http://core.svn.wordpress.org/trunk@22648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 00:36:47 +00:00
Daryl Koopersmith
b57d3ff767 Media: zIndex peace was only temporary.
Revert [22611] in favor of using plupload's `container` setting. Turns out, plupload's flash shim is forced to the exact same index as the admin bar, so balancing the two is better solved by nesting the shim.

see #22441, #22446, #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-16 10:30:36 +00:00
Daryl Koopersmith
24910d5c06 Media: Only show the edit selection link for the media library. Make the upload attachments list sortable. Only retain the silent option when running Attachments.validate(). see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-15 03:09:35 +00:00
Daryl Koopersmith
79c74bbe1e Media: Enter batch insert workflow by editing the selection instead of having an explicit button. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-15 02:36:06 +00:00