Commit Graph

521 Commits

Author SHA1 Message Date
John Blackbourn
afbfe981fc Media: Add an audio and video player to the media manager modal.
This introduces a means of playing existing audio and video files while browsing them prior to selecting them for use.

Props antpb, Mista-Flo, garrett-eclipse, mapk

Fixes #43640

Built from https://develop.svn.wordpress.org/trunk@49195


git-svn-id: http://core.svn.wordpress.org/trunk@48957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 17:39:07 +00:00
whyisjake
3dd9628aae Build/Test Tools: Enable JSDocs to be linted with ESLint.
As part of the [Javascript Inline Docs Initiative](https://make.wordpress.org/core/handbook/docs/inline/js/) this add some tooling to lint Javascript docblocks. Two new commands:

* `npm run lint:jsdoc`
* `npm run lint:jsdoc:fix`

The latter will run the linter and try to fix an possible issues automatically.

Fixes #43828.
Props netweb, atimmer, kamataryo, whyisjake.


Built from https://develop.svn.wordpress.org/trunk@48650


git-svn-id: http://core.svn.wordpress.org/trunk@48412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-27 23:35:02 +00:00
Andrea Fercia
e661df6b9e Docs: Replace @returns tag in media/views/attachment/details.js with @return.
Per the documentation standards, `@returns` is an unsupported synonym, `@return` should be used instead.

Follow-up to [46800], [48232].
See #49572.

Built from https://develop.svn.wordpress.org/trunk@48309


git-svn-id: http://core.svn.wordpress.org/trunk@48078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-05 08:03:01 +00:00
Andrea Fercia
eebf187963 Accessibility: Media: Add a "Copy URL" button to the attachment File URL fields.
For a number of years, various screens in the WordPress admin provided users with a readonly input field to copy the attachment file URL. Manually copying from a readonly field is an annoying task at best even for mouser users. It's a usability and accessibility issue at the same time. 
These fields now have a new "Copy URL" button that is easy to use and accessible to everyone.

Props theolg, markdubois, vabrashev, sajjad67, xkon, nrqsnchz, melchoyce, audrasjb, afercia.
See #41612, #50322, #50335.
Fixes #48463.

Built from https://develop.svn.wordpress.org/trunk@48232


git-svn-id: http://core.svn.wordpress.org/trunk@48001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-30 13:16:04 +00:00
Sergey Biryukov
be16bb9fba Docs: Remove extra spaces from @param tags.
Per the documentation standards, `@param` tags should be aligned with each other, but not with the `@return` tag.

See #49572.
Built from https://develop.svn.wordpress.org/trunk@48110


git-svn-id: http://core.svn.wordpress.org/trunk@47879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:58:10 +00:00
Andrea Fercia
0fcc994a8f Media: Fix bottom spacing on various Media Modal elements for non-webkit browsers.
Implementation of bottom padding in overflow content differs across browsers. See https://github.com/w3c/csswg-drafts/issues/129. To make bottom spacing consistent across browsers there's the need for an alternate CSS method.
- uses a CSS `after` pseudo element or simply a bottom margin to reserve some bottom spacing
- removes a couple leftovers from [40428]
- fixes an annoying visual glitch where the media modal content is visible behind the bottom toolbar border

Props sabernhardt, afercia.
See #40152.
Fixes #48378.

Built from https://develop.svn.wordpress.org/trunk@47266


git-svn-id: http://core.svn.wordpress.org/trunk@47066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-11 16:32:06 +00:00
Sergey Biryukov
a6949956d1 Administration: Capitalize Trash consistently in various messages and comments.
When used as a noun referring to the "virtual" place, `Trash` should be capitalized.

Props garrett-eclipse, aandrewdixon, Presskopp.
Fixes #45317.
Built from https://develop.svn.wordpress.org/trunk@47233


git-svn-id: http://core.svn.wordpress.org/trunk@47033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-10 04:12:07 +00:00
Andrea Fercia
f2edcb4421 Accessibility: Media: Make the toolbar and inline uploader visual order always match the DOM order.
Depending on the specific media view, the media UI elements are placed in a
different visual order. This change makes sure their visual order always
matches the DOM order.

Propos syhc, audrasjb, afercia.
See #37188.
Fixes #48403.

Built from https://develop.svn.wordpress.org/trunk@47217


git-svn-id: http://core.svn.wordpress.org/trunk@47017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:32:04 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
9571033894 Coding Standards: Move assignment out of condition in js/media/controllers/library.js.
Props ankitmaru.
Fixes #49108.
Built from https://develop.svn.wordpress.org/trunk@47030


git-svn-id: http://core.svn.wordpress.org/trunk@46830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-02 12:07:02 +00:00
Sergey Biryukov
d3a14b7719 Coding Standards: Move assignment out of condition in js/media/views/settings.js.
Props ankitmaru.
Fixes #49107.
Built from https://develop.svn.wordpress.org/trunk@47029


git-svn-id: http://core.svn.wordpress.org/trunk@46829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-02 12:02:02 +00:00
Sergey Biryukov
2a0489ec49 Docs: Replace @returns tags in JS docs with @return.
Per the documentation standards, `@returns` is an unsupported synonym, `@return` should be used instead:
https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/

See #48303.
Built from https://develop.svn.wordpress.org/trunk@46800


git-svn-id: http://core.svn.wordpress.org/trunk@46600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-29 18:01:03 +00:00
Sergey Biryukov
4a4afbd68c Docs: Add missing full stops to @returns tags in JS docs, per the documentation standards.
Props shital-patel, kalpshit.
Fixes #48305.
Built from https://develop.svn.wordpress.org/trunk@46799


git-svn-id: http://core.svn.wordpress.org/trunk@46599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-29 16:56:02 +00:00
Andrea Fercia
c0950c1d50 Accessibility: Media: Add an aria-pressed attribute to active button within a button group.
The `aria-pressed` attribute communicates semantically the "active" state of buttons that otherwise only look "active".

Fixes #48355.

Built from https://develop.svn.wordpress.org/trunk@46748


git-svn-id: http://core.svn.wordpress.org/trunk@46548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-18 22:23:03 +00:00
Andrea Fercia
d5bfc553b9 Accessibility: Media: Improve the Media Modal spinner position after [46418].
Fixes #47138.

Built from https://develop.svn.wordpress.org/trunk@46549


git-svn-id: http://core.svn.wordpress.org/trunk@46346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-15 16:47:02 +00:00
antpb
97356bbd75 Media: Adds Edit Image controller to Media Library select frame.
This adds the necessary state for `EditImage` views in the `select` frame and listeners for setting that view.

Props fblaser, w3rkjana, afercia, antpb.
See #48028.

Built from https://develop.svn.wordpress.org/trunk@46461


git-svn-id: http://core.svn.wordpress.org/trunk@46259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-11 20:43:03 +00:00
Andrea Fercia
932df464e6 Accessibility: Media: Improve the logic to render the ARIA tabs markup after [46363].
Additionally checks for the "menu" and "router" state attributes to better determine when the ARIA tabs pattern markup is appropriate.

See #47149.

Built from https://develop.svn.wordpress.org/trunk@46438


git-svn-id: http://core.svn.wordpress.org/trunk@46236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-08 17:07:02 +00:00
Andrea Fercia
1f3d583825 Accessibility: Media: Improve the search media field labelling.
Visible `<label>` elements benefit all users. The `placeholder` attribute should not be used as a replacement for visible labels.
Instead, it's supposed to be used only for a short hint to aid users with data entry e.g. a sample value or a brief description of the expected format.

Screen readers may not announce a `placeholder` attribute at all. Other users may suffer from the lack of a visible label and a placeholder used as replacement, for example:

- users with cognitive disabilities may have trouble remembering what the filled field does
- speech recognition users cannot see the name they can speak to set focus on the field
- low-vision users with high text-size may not be able to see the whole placeholder even when it's visible, if its value is clipped by the edge of the input

Props anevins, audrasjb, karmatosed, azaozz, SergeyBiryukov, afercia.
See #40331.
Fixes #47138.

Built from https://develop.svn.wordpress.org/trunk@46418


git-svn-id: http://core.svn.wordpress.org/trunk@46216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-07 12:43:03 +00:00
Andrea Fercia
b1cd71c2d2 Accessibility: Media: Add more headings in the Media Modal.
Headings are the predominant mechanism for screen reader users to find information in a page. They also help all users to better identify the main sections of user interfaces.

- adds three new headings within the media modal 
- improves plural form translation for "item selected" by using `wp.i18n`
- horizontally centers the media modal menu in the responsive view

Props kjellr, karmatosed, melchoyce, afercia.
See #47149.
Fixes #47610.

Built from https://develop.svn.wordpress.org/trunk@46375


git-svn-id: http://core.svn.wordpress.org/trunk@46174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-03 12:10:57 +00:00
Andrea Fercia
63e199abc7 Accessibility: Media: Use the ARIA tabs pattern for the media modal menus.
The ARIA tabs pattern improves interaction for keyboard and assistive technologies users.
It gives the menu items proper roles, and `aria-selected` allows users of assistive technologies to know which tab is currently selected.

Props audrasjb, afercia, joedolson, karmatosed, melchoyce.
See #47149.

Built from https://develop.svn.wordpress.org/trunk@46363


git-svn-id: http://core.svn.wordpress.org/trunk@46162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-30 19:37:58 +00:00
antpb
247e7eb7d5 Media: Revert [46354] preventing bad clipping of text in image details page.
See #47115.

Built from https://develop.svn.wordpress.org/trunk@46355


git-svn-id: http://core.svn.wordpress.org/trunk@46154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-30 17:12:59 +00:00
antpb
7c8028febf Media: Prevents clipping of text when scaling image edit screen.
Props sabernhardt, audrasjb, afercia.
See #47115.

Built from https://develop.svn.wordpress.org/trunk@46354


git-svn-id: http://core.svn.wordpress.org/trunk@46153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-30 16:34:58 +00:00
Andrea Fercia
abb00ee8a4 Media: Fix JavaScript TypeError after [45376].
Props desrosj, afercia.
Fixes #48021.

Built from https://develop.svn.wordpress.org/trunk@46321


git-svn-id: http://core.svn.wordpress.org/trunk@46120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-26 13:06:56 +00:00
Andrea Fercia
9e26d98d7e Accessibility: Media: Make screen readers announce the Media search results.
- adds audible messages via `wp.a11y.speak()` to announce the search results 
- removes a `keyup` event that was there only to support old browsers 
- removes `aria-modal="true"` from the media modal dialog as it prevents the ARIA live regions to be perceived by screen readers
- triggers the search only after 2 ASCII characters have been typed

Props anevins, antpb, aduth, loreleiaurora, afercia.
Fixes #47146.

Built from https://develop.svn.wordpress.org/trunk@46239


git-svn-id: http://core.svn.wordpress.org/trunk@46051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-23 12:19:56 +00:00
Adam Silverstein
0cb3860138 External Libraries: Update Backbone.js to 1.4.0.
Upgrade Backbone to the latest stable version. Fix some issues in Media with `listenTo` which changed in this version, see https://backbonejs.org/#changelog.

Props desrosj, priyankkpatel, pierlo.
Fixes #47478.


Built from https://develop.svn.wordpress.org/trunk@46157


git-svn-id: http://core.svn.wordpress.org/trunk@45969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-17 17:19:54 +00:00
Andrew Ozz
e313498193 Uploads: After an image is uploaded and PHP times out or runs out of memory during post-processing (the server response is HTTP 500 error), try to resize it three more times. Then, if all attempts fail, do a cleanup of any sub-sizes that may have been created and show an error message asking the user to scale the image and upload it again.
See #47872.
Built from https://develop.svn.wordpress.org/trunk@45934


git-svn-id: http://core.svn.wordpress.org/trunk@45745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 01:11:54 +00:00
Andrea Fercia
3ab18dba93 Accessibility: Add a default title for the media modal dialog.
Makes sure the media modal dialog `h1` heading isn't empty when custom media frames don't set a title. This is particularly important now that the media modal is an ARIA dialog, as the title is referenced by an `aria-labelledby` attribute to properly label the dialog.

Props donmhico, audrasjb.
Fixes #47612.

Built from https://develop.svn.wordpress.org/trunk@45925


git-svn-id: http://core.svn.wordpress.org/trunk@45736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 15:18:56 +00:00
Sergey Biryukov
6b9ab1c5c5 Docs: Update @since tag for new JS functions and variables introduced in [45572].
Props garrett-eclipse.
See #47145.
Built from https://develop.svn.wordpress.org/trunk@45867


git-svn-id: http://core.svn.wordpress.org/trunk@45678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 22:54:55 +00:00
Tammie Lister
d5c7657189 Media: Reduces the bulk media options to have one primary button
This fixes where 2 primary buttons were showing for bulk actions within media trash.

Props garrett-eclipse, afercia, ianbelanger, SergeyBiryukov
Fixes #46757, #46758

Built from https://develop.svn.wordpress.org/trunk@45701


git-svn-id: http://core.svn.wordpress.org/trunk@45512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-30 23:20:57 +00:00
Andrea Fercia
00704114e0 Accessibility: Make the Media modal an ARIA modal dialog.
For a number of years, the Media modal missed an explicit ARIA role and the required attributes for modal dialogs.

This was confusing for assistive technology users, since they may not realize they're inside a dialog, and that consequently the keyboard interactions may be different from the rest of the page. Lack of an explicit label for the dialog was confusing as well, since assistive technology users didn't have an immediate sense of what the dialog is for.

This change makes the Media modal meet the ARIA Authoring Practices recommendations, helping users better understand the purpose and interactions with the modal. Also, it makes sure to hide the rest of the page content from assistive technologies, until support for `aria-modal="true"` improves.

Additionally:
- moves the modal H1 heading to the beginning of the modal content 
- changes the modal left menu position to make visual and DOM order match 
- improves the `wp.media.view.FocusManager` documentation

Fixes #47145.

Built from https://develop.svn.wordpress.org/trunk@45572


git-svn-id: http://core.svn.wordpress.org/trunk@45383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-27 12:33:56 +00:00
atimmer
73ad55051b Docs: Improve JSDoc for media/views/attachment/details.js.
Props maartenleenders, boblinthorst, dfangstrom.
Fixes #47588.

Built from https://develop.svn.wordpress.org/trunk@45561


git-svn-id: http://core.svn.wordpress.org/trunk@45372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-22 13:02:52 +00:00
Andrea Fercia
d69a3e6f90 Accessibility: Handle one more case of focus loss when switching view in the Media Views.
See #43169.

Built from https://develop.svn.wordpress.org/trunk@45531


git-svn-id: http://core.svn.wordpress.org/trunk@45342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-13 16:22:52 +00:00
Andrea Fercia
340fd28d82 Accessibility: Improve focus management in the Media Views.
- keeps focus management only where necessary to avoid focus losses
- removes focus management where a specific user workflow was assumed
- makes the "Attachment Details" navigation buttons really disabled when there are no next or previous attachments
- adds inline comments to clarify all the usages of focus()

Fixes #43169.

Built from https://develop.svn.wordpress.org/trunk@45524


git-svn-id: http://core.svn.wordpress.org/trunk@45335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-12 21:03:52 +00:00
Andrea Fercia
f57e10a35d Accessibility: Fix the order of the Previous, Next, and Close buttons in the Attachment Details modal.
Making the visual and DOM order match benefits keyboard users who navigate documents sequentially and expect the focus order to be consistent with the sequential reading order.

Fixes #47458.

Built from https://develop.svn.wordpress.org/trunk@45506


git-svn-id: http://core.svn.wordpress.org/trunk@45317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-09 15:48:53 +00:00
Andrea Fercia
6a9bcaeaa9 Accessibility: Improve accessibility of all the media views form controls.
- changes the media views form controls to have explicitly associated labels with for/id attributes
- adds a few missing labels / aria-labels
- improves a few existing labels / aria-labels
- improves semantics in a few places, by adding visually hidden headings, fieldset + legend elements, aria-describedby attributes
- improves the image custom size input fields and their labelling
- adds `role="status"` to the "saved" indicator so that status messages are announced to assistive technologies
- swaps the columns source order in the image details template, to make visual and DOM order match
- swaps the "Replace" and "Back" buttons source order in the Replace Image view, to make visual and DOM order match
- gallery settings: move checkbox label to the right: checkboxes are supposed to have labels on the right
- merge similar strings, unified to "Drop files to upload" (removed "Drop files here", and "Drop files anywhere to upload")
- makes the "upload-ui" consistent across the media views
- hides the IE 11 "X" `::-ms-clear` button in the Insert from URL field, as it conflicts with the uploading spinner
- adds comments to all the media templates to clarify their usage
- slightly increases vertical spacing between form fields in the media sidebar
- removes some CSS selectors introduced as backwards compatibility for WordPress pre-4.4
- removes some CSS still targeting Internet Explorer 7 and 8

Fixes #47141.
Fixes #47122.

Built from https://develop.svn.wordpress.org/trunk@45499


git-svn-id: http://core.svn.wordpress.org/trunk@45310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-07 20:45:02 +00:00
Andrea Fercia
74c0d658b4 Accessibility: Improve the media views upload Dismiss Errors button.
- makes the Dismiss Errors button visible in the media views inline uploader
- avoids a focus loss when activating the Dismiss Errors button

See the related GitHub issue from the WPCampus accessibility audit https://github.com/WordPress/gutenberg/issues/15354

Fixes #47113.

Built from https://develop.svn.wordpress.org/trunk@45376


git-svn-id: http://core.svn.wordpress.org/trunk@45187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-22 19:33:53 +00:00
Gary Pendergast
4b1ff1c298 Media: Update the media bulk action labels for consistency.
Props ianbelanger, garrett-eclipse, afercia, Presskopp.
Fixes #44675.


Built from https://develop.svn.wordpress.org/trunk@45147


git-svn-id: http://core.svn.wordpress.org/trunk@44956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-08 23:54:52 +00:00
Adam Silverstein
19c4841fb6 Media: introduce a "Heading" view for improved accessibility.
* Add a new media view: `wp.media.view.Heading` designed to add accessibility friendly headers in the media library/modal.
* Add an initial "Attachments list" heading above the attachments list.

Props afercia.
Fixes #36925.

Built from https://develop.svn.wordpress.org/trunk@44969


git-svn-id: http://core.svn.wordpress.org/trunk@44800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 21:05:52 +00:00
Andrea Fercia
e9db7c48d2 Accessibility: improve the "URL" and "Alt text" fields in the media modals.
Many users found the attachment URL field confusing: it says "URL" so it may appear like a field meant to paste a URL into.
Also, the Alt text field is the most important one in terms of content, while the Title field needs to be de-emphasized.

- changes the URL field label to "Copy link"
- moves the alt text field to the top as first field 
- avoids to set initial focus on the alt text field 
- adds an explanatory text with a link pointing to the W3C "alt decision tree" tutorial 
- adds `aria-describedby` to target the explanatory text
- adjusts the CSS accordingly
- updates the QUnit index.html file

Props melchoyce, audrasjb, afercia.
Fixes #41612.

Built from https://develop.svn.wordpress.org/trunk@44900


git-svn-id: http://core.svn.wordpress.org/trunk@44731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-15 10:43:51 +00:00
Andrea Fercia
a32aeb0392 Media: Improve unselecting media in the media bulk selection mode.
Disables the "Delete Selected" button when unselecting media by clicking the
"checkmark" box in the media bulk selection mode.

Props subrataemfluence, adamsilverstein.
Fixes #42239.

Built from https://develop.svn.wordpress.org/trunk@44640


git-svn-id: http://core.svn.wordpress.org/trunk@44471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-17 12:08:49 +00:00
Andrea Fercia
3578f89900 Accessibility: Improve the way Internet Explorer 11 and JAWS announce fieldset legends.
When Internet Explorer encounters a non interactive element with a `tabindex`
attribute, it adds the element to the accessibility tree with a `role=group` and
an accessible name computed from the element. This prevents JAWS from announcing
any fieldset legend within the element.

- removes `tabindex="0"` from the content and the toolbar containers: these tabindex attributes are no longer needed
- removes `aria-label="Main content"` from the content container: not needed
- keeps the media modal focus fallback introduced in [38142] by making the `#wpbody-content` element focusable only when needed

Props stevefaulkner, aardrian.
Fixes #43154.

Built from https://develop.svn.wordpress.org/trunk@44639


git-svn-id: http://core.svn.wordpress.org/trunk@44470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-17 11:55:51 +00:00
desrosj
5db34748e6 Script loader: Adjust JS packages registration.
Adjusts the packages registration after [43723]:

    Combine the different registration functions into one `wp_default_packages` function. To reach this goal move the prefix logic into a function so it can be called from different locations. Use a static variable there to prevent duplicate inclusion of `version.php`.

    Call this function from the `wp_default_scripts` action by registering it as a default filter.

    Combine some of the logic in `_WP_Editors::print_tinymce_scripts` into `wp_register_tinymce_scripts`. The logic to force an uncompressed TinyMCE script file stays in `_WP_Editors::force_uncompressed_tinymce` because that logic is very specific to the classic editor.

    The script handle `wp-tinymce` is now a dependency of the editor script handle. In combination with the previous item, this makes the classic editor work.

    Adjust the syntax of the script paths to be more consistent with other WordPress code.

    Always use "production" mode for the media files to prevent people from inadvertently committing development files.

Props pento, omarreiss, atimmer.

Merges [43738] into trunk.

Fixes #45065.
Built from https://develop.svn.wordpress.org/trunk@44115


git-svn-id: http://core.svn.wordpress.org/trunk@43945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 17:27:38 +00:00
atimmer
4f9ba9044e Build tools: Upgrade webpack to version 4.
* Minification is done by uglify, so disable that in the media build.
* The webpack boilerplate has changed, which explains the changes in the build files.
* ModuleConcatenationPlugin is enable by default for production builds so we don't have to specify that ourselves.

Merge notes: In `trunk` uglify isn't run on the media files after webpack, so webpack does need to do that. Newer webpack versions use `terser-webpack-plugin` as the default minification. Use the `uglifyjs-webpack-plugin` plugin to maintain the same behavior as before. We can look into terser as a minifier later.

Merges [43688] to trunk.
See #45065.

Built from https://develop.svn.wordpress.org/trunk@44111


git-svn-id: http://core.svn.wordpress.org/trunk@43941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 11:05:25 +00:00
atimmer
bde558be2f Docs: Add file doc @output annotations.
These annotations make it clear to the reader of a JavaScript source
where the build process outputs to. These annotations can later be
integrated in a webpack configuration. This way there is one source of
truth.

The `build` folder is omitted from the paths, because a single JS file
shouldn't not be responsible of knowing where outputs in general will
end up at. A file only knows its output location relative to the
project.

Props adamsilverstein, herregroen, omarreiss, pento.
Fixes #44361.

Built from https://develop.svn.wordpress.org/trunk@43347


git-svn-id: http://core.svn.wordpress.org/trunk@43175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:30:15 +00:00
Gary Pendergast
922f83a69f Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten lore—
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;—DMing me, I can’t ignore.
“’Tis some contributor,” I muttered, “DMing me an idea or four—
            Only this and nothing more.”

Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid me—down out cold—upon the floor.
Curious, I listened closely;—to a plan I agreed with, mostly—
A way to make our JavaScript—JavaScript which was a chore—
Maintainable, extendable, for the future, is what I saw.
            Guten-ready for evermore.

Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
“There’s nothing else for us to do,” DMing me, “It’s done!” he swore—
“No longer random guessing at which file need next be explored—
            Let’s move on, we’re all aboard.”

Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
“Though this change be useful here,” I said, “it is too large, I fear,
We couldn’t manage such a patch, we’ve done nothing like this before—
Tell me where doth go this change, change to make our codebase soar!”
            Quoth Omar, “In WordPress Core.”

Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.


Built from https://develop.svn.wordpress.org/trunk@43309


git-svn-id: http://core.svn.wordpress.org/trunk@43138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-23 10:05:31 +00:00
atimmer
b6ef716d97 Docs: Improve JSDoc for media/controllers/gallery-edit.js.
Amends [43141] - includes the built media files.

See #43866.

Built from https://develop.svn.wordpress.org/trunk@43142


git-svn-id: http://core.svn.wordpress.org/trunk@42971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-03 14:48:22 +00:00
Andrew Ozz
3266b10d04 Privacy: add "Mine" filter for media similarly to posts and comments.
Props audrasjb.
See #43820.
Built from https://develop.svn.wordpress.org/trunk@43056


git-svn-id: http://core.svn.wordpress.org/trunk@42885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-01 15:43:22 +00:00
Dominik Schilling
f33092e163 Media: Update built files after [42798].
See #43500.
Built from https://develop.svn.wordpress.org/trunk@42931


git-svn-id: http://core.svn.wordpress.org/trunk@42761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-03 19:49:30 +00:00
Adam Silverstein
a299c5c344 Fix eshint error since r42739.
Remove a trailing comma in [42739] that was throing a jshint error.


Built from https://develop.svn.wordpress.org/trunk@42740


git-svn-id: http://core.svn.wordpress.org/trunk@42570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-25 16:49:30 +00:00
Adam Silverstein
da89d20c39 Media: grid view - correct placeholder positioning during uploads.
Preventing contextually created attachments from being added to the grid collection in Attachments.validator. Remove the previous filtering introduced in [41937] which caused the placement issue.

Props lancewillett, Junaidkbr, designsimply, joemcgill.
Fixes #42968.

Built from https://develop.svn.wordpress.org/trunk@42739


git-svn-id: http://core.svn.wordpress.org/trunk@42569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-25 16:41:31 +00:00