Commit Graph

1241 Commits

Author SHA1 Message Date
Daryl Koopersmith
0422f833a8 Media templates: Alter escaping regular expression to prevent it from aggresively consuming input meant for interpolation. see #22344, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 21:38:14 +00:00
Daryl Koopersmith
790464193d Media: Add custom URL as an option to attachment display properties. see #21390, #22206.
git-svn-id: http://core.svn.wordpress.org/trunk@22537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 20:36:46 +00:00
Daryl Koopersmith
43c289dee6 Media: Automatically strip any non-image items from the collection when creating a gallery.
Also changes the rules for when the "new gallery" button shows:
* More than two items must be selected.
* At least one of them must be an image.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 19:25:39 +00:00
Daryl Koopersmith
2396b66c98 Media: Watch additional search events. Properly captures clearing the search box. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 18:56:11 +00:00
Daryl Koopersmith
30e0a600bf 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: http://core.svn.wordpress.org/trunk@22532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 18:25:04 +00:00
Andrew Nacin
e7767b1eba Add comments to time intervals we cannot express with the constants. Fix a comment. props SergeyBiryukov. fixes #20987.
git-svn-id: http://core.svn.wordpress.org/trunk@22531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 18:13:09 +00:00
Daryl Koopersmith
944066ef83 Media: Account for a race condition when deleting an edit gallery frame. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 09:57:28 +00:00
Daryl Koopersmith
9c20d148b9 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: http://core.svn.wordpress.org/trunk@22529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 09:11:33 +00:00
Daryl Koopersmith
bed08350f4 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: http://core.svn.wordpress.org/trunk@22523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 07:51:37 +00:00
Andrew Nacin
809bb5a8f7 Update the JS version of the shortcode regex to match [22382]. props SergeyBiryukov. fixes #17657.
git-svn-id: http://core.svn.wordpress.org/trunk@22522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 07:23:55 +00:00
Bot (Assets)
c57076aab7 Compress scripts/styles: 3.5-beta2-22515.
git-svn-id: http://core.svn.wordpress.org/trunk@22515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 22:58:35 +00:00
Andrew Nacin
8f08f77601 WordPress dialog jQuery UI widget:
* Link to the upstream bug report.
 * No need to specify the default value for an option.
 * Use the new _super() UI method to open the dialog, avoiding a direct reference to the parent.
 * Fix typo in comment.
 * Use public isOpen() method rather than a private property.

props scott.gonzalez.
fixes #22399.



git-svn-id: http://core.svn.wordpress.org/trunk@22514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 22:36:35 +00:00
Andrew Nacin
8b53ffec74 Define a custom event prefix in the wpdialog jQuery UI widget to work around a jQuery UI 1.9.1 regression. see #22399.
git-svn-id: http://core.svn.wordpress.org/trunk@22513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 21:45:13 +00:00
Daryl Koopersmith
880b1e4b81 Media JS: Pass the region instance through when firing the activate and deactivate events. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 12:43:39 +00:00
Daryl Koopersmith
b9ed8db596 Media: Keep track of gallery display properties in a separate model instead of mixed in with the query parameters. This allows for arbitrary gallery arguments and a more flexible data structure. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 12:37:21 +00:00
Daryl Koopersmith
adf0c7e1a7 Media: When printing a gallery shortcode, hide the implicit orderby value. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 12:14:48 +00:00
Daryl Koopersmith
db30495fcd Media: Correctly set the edit gallery's library. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 12:09:15 +00:00
Daryl Koopersmith
3797b7e18c Media JS: Only block button events by default if the button does not link to anything. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 11:30:40 +00:00
Daryl Koopersmith
0c219be45d Media: Output correct link html when inserting attachments. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 10:48:50 +00:00
Daryl Koopersmith
4a008574d2 Media JS: Use basic upload/library by default.
`wp.media` now recognizes the `frame` attribute (currently a string; either'select' or 'post') and defaults to using a basic select frame. It also checks for the existence of classes in a safer fashion, as it does not assume the `MediaFrame` property exists.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 09:59:36 +00:00
Daryl Koopersmith
9c7acdfe7c Media: Add a basic starting frame for upload/library selection.
`media.view.MediaFrame.Select` is a frame class with a handful of sensible defaults to handle selecting and uploading items in the media library.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 09:47:12 +00:00
Daryl Koopersmith
76b23b3d48 Media: Add size dropdown to attachment display settings in the media modal. fixes #22206, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 06:15:25 +00:00
Daryl Koopersmith
9c4214745b Media: Ensure search box reflects actual search state.
* Also switches search box to use `<input type="search" />` to take advantage of browser UI to clear the field.

fixes #22315, see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 04:44:31 +00:00
Daryl Koopersmith
dd504180f7 Media: In the main media library in the insert media dialog, only show attachment display settings when one attachment is selected. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 02:11:37 +00:00
Daryl Koopersmith
21ff438642 Media: Add batch insertion workflow. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 01:44:02 +00:00
Daryl Koopersmith
23b62b3d77 Media JS: Use correct variable name when binding to the change:library event. see [22477], #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 01:24:55 +00:00
Daryl Koopersmith
103694aa4f Media JS: Add JIT composite library creation/destruction to states to allow for dynamically excluded Attachment models. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 01:23:20 +00:00
Bot (Assets)
0f3d286dd3 Compress scripts/styles: 3.5-beta2-22475.
git-svn-id: http://core.svn.wordpress.org/trunk@22475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 22:58:34 +00:00
Daryl Koopersmith
fe570eb90c Media JS: Add media.model.Composite, to aid in the representation of joint views. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 15:32:40 +00:00
Daryl Koopersmith
ef0774026b 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: http://core.svn.wordpress.org/trunk@22466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 14:15:09 +00:00
Bot (Assets)
9cc507b1c9 Compress scripts/styles: 3.5-beta2-22455.
git-svn-id: http://core.svn.wordpress.org/trunk@22456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 22:58:33 +00:00
Daryl Koopersmith
4daeaf464d Media: Improve memory management of views, events, and DOM nodes. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 22:43:16 +00:00
Bot (Assets)
a94a72e010 Compress scripts/styles: 3.5-beta2-22438. TinyMCE updated.
git-svn-id: http://core.svn.wordpress.org/trunk@22438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 20:29:58 +00:00
Daryl Koopersmith
90781c9e83 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: http://core.svn.wordpress.org/trunk@22437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 20:14:41 +00:00
Mark Jaquith
2ec9c4acc2 Use ImageOptim to losslessly smush our images. About half a MB in savings! fixes #22381. props waldojaquith
git-svn-id: http://core.svn.wordpress.org/trunk@22425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 18:49:10 +00:00
Daryl Koopersmith
9329d742cb 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: http://core.svn.wordpress.org/trunk@22415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 08:41:17 +00:00
Andrew Ozz
c09c079a6f Allow commonly used obsolete HTML5 attributes in TinyMCE, table[summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor] and a[name], fixes #22175
git-svn-id: http://core.svn.wordpress.org/trunk@22411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-06 23:36:10 +00:00
Bot (Assets)
aa464fde32 Compress scripts/styles: 3.5-beta2-22407.
git-svn-id: http://core.svn.wordpress.org/trunk@22407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-06 22:58:35 +00:00
Daryl Koopersmith
349afb3c4f Media JS: Move state-related logic from sidebar views to the state controllers. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-06 01:19:39 +00:00
Andrew Ozz
cbd737470c Kill use of colons in class names, props SergeyBiryukov, fixes #21152
git-svn-id: http://core.svn.wordpress.org/trunk@22396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-06 01:01:52 +00:00
Andrew Ozz
50c704fc80 Remove the Alt + Shift + G (old fullscreen mode) shortcut from the TinyMCE help popup, props SergeyBiryukov, see #21197
git-svn-id: http://core.svn.wordpress.org/trunk@22394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-06 00:28:01 +00:00
Bot (Assets)
c94990017b Compress scripts/styles: 3.5-beta2-22384.
git-svn-id: http://core.svn.wordpress.org/trunk@22384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-05 22:58:34 +00:00
Andrew Nacin
32ad332432 Update Thickbox images for HiDPI. props lessbloat. see #21019.
git-svn-id: http://core.svn.wordpress.org/trunk@22378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-05 21:00:15 +00:00
Daryl Koopersmith
825bea7637 Media: Show an inline uploader when the media library is empty.
Merges most of `wp.media.controller.Upload` into `wp.media.controller.Library`, so we always create an inline uploader instead of an attachments browser if the state's `library` is empty.

props rzen, fixes #22323, see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-05 02:43:47 +00:00
Daryl Koopersmith
92823b8635 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: http://core.svn.wordpress.org/trunk@22362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-04 22:59:12 +00:00
Ryan Boren
a29e0190db jQuery UI 1.9.1
Props ocean90
fixes #22290


git-svn-id: http://core.svn.wordpress.org/trunk@22361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-03 22:51:38 +00:00
Bot (Assets)
270a0964f5 Compress scripts/styles: 3.5-beta2-22360.
git-svn-id: http://core.svn.wordpress.org/trunk@22360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-02 22:58:37 +00:00
Daryl Koopersmith
9670372812 Media: Update the gallery "add images" state. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-02 01:20:01 +00:00
Bot (Assets)
3e51d043ab Compress scripts/styles: 3.5-beta2-22352.
git-svn-id: http://core.svn.wordpress.org/trunk@22352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-31 22:58:32 +00:00
Daryl Koopersmith
62771d6824 Media: Update gallery editing to work with the new frame view. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-31 21:43:59 +00:00