Commit Graph

20680 Commits

Author SHA1 Message Date
Ryan Boren 38b29deb8e preg_quote() the permalink structure so that regex special chars such as dots are correctly handled. Props SergeyBiryukov. fixes #21167
git-svn-id: https://develop.svn.wordpress.org/trunk@22365 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-05 14:13:29 +00:00
Ryan Boren 41697f3910 Attachment editor improvements. Put the non-editable metadata into the submit/publish box.
Props helenyhou
see #21391


git-svn-id: https://develop.svn.wordpress.org/trunk@22364 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-05 14:04:22 +00:00
Daryl Koopersmith f42b826898 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: https://develop.svn.wordpress.org/trunk@22363 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-05 02:43:47 +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
Ryan Boren 351979863e jQuery UI 1.9.1
Props ocean90
fixes #22290


git-svn-id: https://develop.svn.wordpress.org/trunk@22361 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-03 22:51:38 +00:00
bumpbot 4dbb7eb959 Compress scripts/styles: 3.5-beta2-22360.
git-svn-id: https://develop.svn.wordpress.org/trunk@22360 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-02 22:58:37 +00:00
Lance Willett 67deebeca5 Bundled Themes: allow `show_home` argument to be overridden when using `wp_page_menu` as a fallback to a Custom Menu. Props SergeyBiryukov and kovshenin, fixes #22331.
git-svn-id: https://develop.svn.wordpress.org/trunk@22359 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-02 16:52:53 +00:00
Lance Willett fa95152015 Twenty Twelve: handle a long site title a bit better in mobile view, don't use line-height to add space between the h1 and h2 elements in this case.
git-svn-id: https://develop.svn.wordpress.org/trunk@22358 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-02 16:48:11 +00:00
Andrew Nacin a6a8321d7d clean_post_cache() no longer calls itself recursively. see #11399.
git-svn-id: https://develop.svn.wordpress.org/trunk@22357 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-02 16:13:53 +00:00
Daryl Koopersmith a8b411b563 Media: Update the gallery "add images" state. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22356 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-02 01:20:01 +00:00
Nikolay Bachiyski e9fbc52474 Fix typos in comments. Props SergeyBiryukov, see #22337
git-svn-id: https://develop.svn.wordpress.org/trunk@22355 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 23:56:23 +00:00
Dion Hulse 3d40fbad80 Fix a PHP Notice when attempting to Add or remove capabilities from nonexistant roles. Props SergeyBiryukov. Fixes #18461
git-svn-id: https://develop.svn.wordpress.org/trunk@22354 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 23:18:33 +00:00
Mark Jaquith 2dc29f9587 Clean up [22347] a bit. see #14348
git-svn-id: https://develop.svn.wordpress.org/trunk@22353 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 23:01:13 +00:00
bumpbot 7bd3be3ca2 Compress scripts/styles: 3.5-beta2-22352.
git-svn-id: https://develop.svn.wordpress.org/trunk@22352 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 22:58:32 +00:00
Jon Cave e62a2b0327 Add Instagram oEmbed support. Props bananastalktome. Fixes #21704.
git-svn-id: https://develop.svn.wordpress.org/trunk@22351 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 22:45:23 +00:00
Nikolay Bachiyski b5b580e50a Replace gp_endswith() with working implementation
In [22349] we introduced a call to gp_endswith(),
whcih doesn't exist in WordPress, only in GlotPress.

See #22337


git-svn-id: https://develop.svn.wordpress.org/trunk@22350 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 22:26:20 +00:00
Nikolay Bachiyski 1a9ffb97a7 Sync POMO with GlotPress
See http://glotpress.trac.wordpress.org/browser/trunk/pomo/


git-svn-id: https://develop.svn.wordpress.org/trunk@22349 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 22:13:51 +00:00
Daryl Koopersmith 794c7f6b1c Media: Update gallery editing to work with the new frame view. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22348 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 21:43:59 +00:00
Mark Jaquith 921c060e18 When receiving a HEAD request, die() right before we start outputting content.
* Content doesn't make sense for HEAD requests
* Saves wear and tear on the server
* Introduces a filter: exit_on_http_head (we send TRUE through it)

fixes #14348. props mbijon, mitchoyoshitaka.

git-svn-id: https://develop.svn.wordpress.org/trunk@22347 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 21:39:23 +00:00
Dion Hulse 8da6cfb9fc Theme Translations: Allow for theme pomo files to be loaded from WP_LANG_DIR/themes/{$domain}-{$locale}.(p|m)o.
This directory format is what we have chosen for Language Packs (See #18200), but which is currently delayed.

By making this change, we can ship localised theme files within core for bundled themes, and avoid the issues associated with Theme Updates overwriting/removing the language files.

Fixes #18960



git-svn-id: https://develop.svn.wordpress.org/trunk@22346 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 21:30:33 +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 9703b3a86f Media JS: When editing a gallery, prevent attachments from being selected as they are removed. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22344 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 20:51:34 +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 90888aaebd Remove dead gallery settings code. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22342 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 20:00:39 +00:00
Daryl Koopersmith 791d93553a Make gallery columns fallback a string, as the accepted values are strings. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22341 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 20:00:02 +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 61ad4ebfa2 Media JS: Several improvements to the Attachment views.
* Bind Attachment details updates to the Attachments initialize method.
* Improve Attachment view unbinding.
* Re-render Attachment views when titles and captions are updated.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22339 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 23:59:57 +00:00
Daryl Koopersmith b5652fb180 Media JS: Properly fire the Attachment view details method on render. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22338 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 23:41:13 +00:00
Daryl Koopersmith 6deb5064ee Media JS: Properly build detail views when the selection's single model changes. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22337 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 23:36:38 +00:00
Daryl Koopersmith c67117e150 Media CSS: Remove inner shadow when attachment is selected. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22336 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 23:16:28 +00:00
Daryl Koopersmith ee6bda8ddd Media JS: Improve handling of single attachments in selections.
* Adds `wp.media.model.Selection.single()` to specify a single item used in a multi-item selection.
* Fixes a bug where the `details` class would not be removed when "Clear Selection" was clicked.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22335 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 23:15:16 +00:00
bumpbot 936f82bb1f Compress scripts/styles: 3.5-beta2-22334.
git-svn-id: https://develop.svn.wordpress.org/trunk@22334 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 22:58:31 +00:00
Daryl Koopersmith 66259023dd Media JS: Remove unused Attachment view events. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22333 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 21:15:46 +00:00
Daryl Koopersmith 59c70a3061 Improve selection UI/behavior in the media modal.
* Moves handling which models are in the selection into the `Library` state.
* Adds highlight for the last-selected view in a multi-view state.
* A view must be the last-selected view before it can be deselected.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22332 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 21:09:45 +00:00
Dion Hulse 499f18d2c2 Prevent an issue on windows systems which can cause the temporary directory from get_temp_dir() from returning a path containing \/. Props to SergeyBiryukov for the initial patch. Fixes #20778
git-svn-id: https://develop.svn.wordpress.org/trunk@22331 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 20:58:35 +00:00
Dion Hulse 5792b83c42 When reading local feeds from disk, check that the file exists first to avoid a PHP Warning in WP_SimplePie_File. Props SergeyBiryukov. Fixes #17756
git-svn-id: https://develop.svn.wordpress.org/trunk@22330 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 20:48:35 +00:00
Andrew Ozz c2547c9aa1 Min-height on the permalink wrapper prevents the editor jumping down when starting new post, props SergeyBiryukov, see #22298
git-svn-id: https://develop.svn.wordpress.org/trunk@22329 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 18:16:54 +00:00
Andrew Ozz eb24f7b6c6 Fix the permalink covering the insert media button when wrapped, props SergeyBiryukov, fixes #22298
git-svn-id: https://develop.svn.wordpress.org/trunk@22328 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 17:43:08 +00:00
Andrew Ozz 2d6b896243 Buttons: make install.css depend on buttons.css (so button styles are always loaded), see #21598
git-svn-id: https://develop.svn.wordpress.org/trunk@22327 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 16:28:13 +00:00
bumpbot db035ece96 Compress scripts/styles: 3.5-beta2-22326.
git-svn-id: https://develop.svn.wordpress.org/trunk@22326 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-29 22:58:31 +00:00
Daryl Koopersmith 82270d36ef Improve attachment detailed preview styling. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22325 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-29 18:16:12 +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
Daryl Koopersmith bc29728df2 Add attachment details to the media sidebar.
* Also moves most of the `Frame` view's `createSelection` method to a real `Selection` model (which inherits from the `Attachments` model).
* Properly assigns the library within the `Gallery` state, allowing for the `Gallery` state to inherit from the `Library` state.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22323 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-29 15:13:02 +00:00
Daryl Koopersmith 6e387bb2db Add inline uploader UI to media modal sidebar. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22322 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-29 07:38:13 +00:00
Daryl Koopersmith 8fe5b79380 Add a sidebar to the media modal.
* Adds `wp.media.view.Sidebar`, to aid in rendering the sidebar.
* Removes the `directions` from the `Attachments` view and shifts search into a separate view (`wp.mce.view.Search`) that can be relocated at will. This also serves to simplify the `Attachments` view by removing the nested `list` and `$list` parameters.
* Show the toolbar on the featured image workflow, effectively requiring confirmation before closing the dialog.

see #21390, #21776, #21808.


git-svn-id: https://develop.svn.wordpress.org/trunk@22321 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-29 06:56:23 +00:00
Daryl Koopersmith 15c451d2f6 Give media a heart transplant.
Revises the concept of the media controller and workspace views (i.e. two central points of control) to be more granular. The main media object is now the `Frame`, which is a hybrid view and state machine.

The state machine is a collection of states, which are just generic instances of `Backbone.Model`. This circumvents the problem of juggling global parameters when changing states. Each state contains its own event loop. All events are also forwarded to the frame itself (as is the case in all model/collection relationships).

The frame view contains several regions, each of which can be overridden without harming or re-rendering the other regions. These work well when used in conjunction with the state machine events.

This removes the upload sidebar (don't worry, visible upload UI will return). Drag and drop uploading still works. The ability to upload has been abstracted into its own view (instead of being attached to the central workspace view).

Editing galleries is temporarily broken — the gallery creation and editing experiences will be unified in a future patch.

Adds events to detect dragging changes in `wp.Uploader` and adds methods to detect and leverage browser support for CSS3 transitions.

see #21390, #21809.


git-svn-id: https://develop.svn.wordpress.org/trunk@22320 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-28 23:29:17 +00:00
Andrew Nacin cf3fe27ca0 Cast image metadata focal_length and shutter_speed to strings to restore previous behavior when stripslashes_deep() converted these values. Avoids rounding errors without making a determination of which digit we should round to. props jcakec. fixes #22259.
git-svn-id: https://develop.svn.wordpress.org/trunk@22319 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-28 16:17:56 +00:00
Lance Willett d29ca99ec1 Twenty Twelve: fix SVN properties
git-svn-id: https://develop.svn.wordpress.org/trunk@22318 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-26 23:25:45 +00:00
Lance Willett 5b17cb82f9 Twenty Ten: fix SVN properties
git-svn-id: https://develop.svn.wordpress.org/trunk@22317 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-26 23:25:08 +00:00
Lance Willett 1211d832ba Twenty Eleven: fix SVN properties
git-svn-id: https://develop.svn.wordpress.org/trunk@22316 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-26 23:24:23 +00:00