Commit Graph

191 Commits

Author SHA1 Message Date
Aaron Jorbin
99836a26c2 PHPCS: Fix errors
Fix errors introduced in [43973] due to Jorbin not running the correct tag of wpcs.

Unprops jorbin.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-11 04:45:23 +00:00
Aaron Jorbin
8169b49e75 REST API: Persist attributes for attachment links
In [43437], the link definition implementation caused attachment links to be unexpectedly nested under an attributes key. This changeset restores the prior behavior.

Merges [43681] to trunk.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44750.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-11 04:01:26 +00:00
Adam Silverstein
e71a3d6193 Media: Improve display and accessibility of meta data in detail view.
* Add a `human_readable_duration` function including tests.
* Add 'pixels' after image width/height.
* Add screen reader text for durations.

Props Presskopp, kiranpotphode, milindmore22, stormrockwell, afercia.
Fixes #39667. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@43462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-09-08 04:20:24 +00:00
John Blackbourn
61ba015b0f Media: Ensure the "Edit more details" link in the attachment details modal always points to the correct editing URL.
Fixes #44620

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


git-svn-id: http://core.svn.wordpress.org/trunk@43430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-31 10:51:24 +00:00
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Andrea Fercia
d6a73ef110 Media: avoid page scrolling when opening the media modal.
Moves focus to a proper element within the media modal to avoid the underlying
page to scroll to the bottom. Removes the media modal `freeze` option.

Props andreiglingeanu, adamsilverstein.
Fixes 39859.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-31 17:03:33 +00:00
Andrea Fercia
3fb8eee9fc Accessibility: Media: Improve the usage of a few label elements in the media templates.
Label elements should only be used for labelable elements.
- `Uploaded By` and `Uploaded To` aren't form controls and shouldn't be associated with labels
- changes the labels for media source, alternate sources, poster image, and tracks to solve a layout issue and explicitly associate the labels to their form fields (previously, the labels were wrapping also the Remove buttons)

Props Presskopp, afercia.
Fixes #38759, #40468.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-14 16:39:47 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Sergey Biryukov
320c289ec0 Media: Set correct value for "Link Rel" field in Image Details modal.
Props hazemnoor.
Fixes #41764.
Built from https://develop.svn.wordpress.org/trunk@41325


git-svn-id: http://core.svn.wordpress.org/trunk@41156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-31 11:17:45 +00:00
Weston Ruter
31d4d81039 Widgets: Introduce media widgets for images, audio, and video with extensible base for additional media widgets in the future.
The last time a new widget was introduced, Vuvuzelas were a thing, Angry Birds started taking over phones, and WordPress stopped shipping with Kubrick. Seven years and 17 releases without new widgets have been enough, time to spice up your sidebar!

Props westonruter, melchoyce, obenland, timmydcrawford, adamsilverstein, gonom9, wonderboymusic, Fab1en, DrewAPicture, sirbrillig, joen, matias, samikeijonen, afercia, celloexpressions, designsimply, michelleweber, ranh, kjellr, karmatosed.
Fixes #32417, #39993, #39994, #39995.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 21:11:44 +00:00
Andrea Fercia
88e515fac0 Accessibility: Improve the suggested image size text in the media views.
Adds `pixels` as unit, avoiding abbreviation for a clearer pronunciation by screen
readers. Also, adds the word `by` instead of the special character `times`.

Props Presskopp, stormrockwell.
Fixes #38932.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-05 23:29:44 +00:00
Andrea Fercia
9c360b1ab8 Administration: Fix minor misalignments caused by the button-link CSS class.
After [40059] the CSS class `button-link` uses `text-align: left` by default.
This change now requires to limit as much as possible the use of `button-link`
to controls that should really look like links and to explicitly set
`text-align: center` in a few other cases.

Fixes #39983.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 16:51:45 +00:00
Andrea Fercia
d33301821b Buttons: Improve the .button-link CSS class for link-like buttons.
Updates `.button-link` adding color and underline to make link-like buttons look
like links by default. Introduces `.button-link-delete` as a modifier, stackable
CSS class for red button-links.

Props Cheffheid, afercia.

See #34242.
Fixes #35126.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-09 16:47:44 +00:00
John Blackbourn
80a839de13 Docs: Misc corrections and additions to inline documentation.
See #39130
Props keesiemeijer

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


git-svn-id: http://core.svn.wordpress.org/trunk@39579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 09:28:40 +00:00
Helen Hou-Sandí
81f9cc26a1 Media: Clearly indicate that PDF thumbnails are just document previews.
This helps affirm that your upload is fine, and has not been reduced down to the first page or changed into an image. This applies to the attachment details modal in the media library, where media is also now centered in the preview area.

props folletto, helen.
fixes #38717.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-13 16:39:31 +00:00
Mike Schroder
a8e304ec8e Media: Add support for rendering PDF thumbnails.
When support for PDFs is available, on upload,
render 'Thumbnail', 'Medium', 'Large', and 'Full' sizes of
the first page, and save them in attachment meta.

Use these renders within Add Media, Media Gallery and List views,
Attachment Details, Post/Attachment Edit screens, and Attachment pages.

Support available by default via Imagick -> ImageMagick -> Ghostscript,
but can be provided by any `WP_Image_Editor` that supports PDFs.

Props adamsilverstein, azaozz, celloexpressions, desrosj, dglingren, ericlewis, ipstenu, joemcgill, joyously, markoheijnen, melchoyce, mikeschroder, tomauger.
Fixes #31050.
Built from https://develop.svn.wordpress.org/trunk@38949


git-svn-id: http://core.svn.wordpress.org/trunk@38892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 07:28:32 +00:00
Scott Taylor
0eebbed6b2 General: revert [38467], wp_is_IE() should not exist.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 15:22:31 +00:00
Scott Taylor
021e23e70b General: use a new function, wp_is_IE(), instead of the $is_IE global in a number of places.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:42:33 +00:00
John Blackbourn
dbdc1c28b1 I18N: Correct various instances of incorrect usage of esc_attr_e().
Fixes #37457
Props henry.wright, afercia

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


git-svn-id: http://core.svn.wordpress.org/trunk@38365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 18:06:30 +00:00
Dominik Schilling
4e66d6a568 Customize: Add a RTL version of "browser.png" for the site icon preview.
Props sidati.
Fixes #37063.
Built from https://develop.svn.wordpress.org/trunk@37963


git-svn-id: http://core.svn.wordpress.org/trunk@37904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-05 11:32:29 +00:00
Andrea Fercia
85cac9d47e Customizer, Site Icon preview: improve alt attributes and text accessibility.
Props shahpranaf, TacoVerdo, afercia.

Fixes #36562.
Built from https://develop.svn.wordpress.org/trunk@37229


git-svn-id: http://core.svn.wordpress.org/trunk@37195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-17 12:01:27 +00:00
Scott Taylor
e649fabb6a Accessibility: add missing alt attributes to a gaggle of <img>s.
Props afercia.
Fixes #34583.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-07 16:12:27 +00:00
Andrea Fercia
f014928b44 Media: Restore proper conditional statement broken after [35427].
Unprops afercia.
See #34273.
Built from https://develop.svn.wordpress.org/trunk@35463


git-svn-id: http://core.svn.wordpress.org/trunk@35427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-30 22:06:24 +00:00
Andrea Fercia
db8b09c40d Media: Improve the headings hierarchy in the Media Views for better accessibility.
Fixes #34273.
Built from https://develop.svn.wordpress.org/trunk@35427


git-svn-id: http://core.svn.wordpress.org/trunk@35391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-28 23:08:24 +00:00
Andrew Ozz
4cdddd401a TinyMCE:
- Sanitize and render HTML in captions when showing a gallery preview (wpView).
- Encode/escape HTML entered in the text field in the wpLink dialog.

Props iseulde, kraftbj, jnylen0, shawarkhan.
Fixes #32616.
Built from https://develop.svn.wordpress.org/trunk@35341


git-svn-id: http://core.svn.wordpress.org/trunk@35307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-21 20:38:26 +00:00
Scott Taylor
2f0fc3b97d After [34048], restore the else statement for h (height of video) in wp_underscore_video_template().
See #33798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 18:30:26 +00:00
Scott Taylor
4b4f08c7a0 In [30082], hardcoded heights were removed on the front end for videos rendered via shortcode. These values were not removed from the admin, which was an oversight.
See #33798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 18:27:25 +00:00
Sergey Biryukov
f9e7fb306c Merge two similar strings.
Props dipesh.kakadiya.
Fixes #33777.
Built from https://develop.svn.wordpress.org/trunk@33998


git-svn-id: http://core.svn.wordpress.org/trunk@33967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 10:59:27 +00:00
Scott Taylor
767dd35a47 Media:
When inserting an image into a post, the values in `wp.media.controller.Library` should not default to linking the image when no user settings are present.

The default display setting value for `link` is now `none`. User settings persist and will override or confirm this value based on user actions.

Props liljimmi, janhenckens, eherman24, wonderboymusic.
Fixes #31467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 12:13:23 +00:00
Konstantin Obenland
3248497cf3 Site Icon: Add crop preview to the media modal.
* Monkey patches imgAreaSelect library to support touch events.
* Removes Settings version of Site Icon since it would have been the same flow.
* Removes default value for Customizer setting - there is no default favicon.

Fixes #16434.



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


git-svn-id: http://core.svn.wordpress.org/trunk@33301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-20 15:57:25 +00:00
Sergey Biryukov
fa1b659d29 Merge two class attributes in WP_Customize_Media_Control::content_template() and wp_print_media_templates().
props nicholas_io.
fixes #32896.
Built from https://develop.svn.wordpress.org/trunk@33090


git-svn-id: http://core.svn.wordpress.org/trunk@33061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-06 14:19:26 +00:00
Sergey Biryukov
c99db2bc59 Media modal: Use better descriptive text for "Remove" buttons.
props afercia.
fixes #32792.
Built from https://develop.svn.wordpress.org/trunk@32972


git-svn-id: http://core.svn.wordpress.org/trunk@32943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 14:51:26 +00:00
Scott Taylor
72bf48f0b9 In Media microtemplates after [32467], use <button> instead of <a> for several more non-links.
Props afercia.
Fixes #26550.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-26 05:01:24 +00:00
Scott Taylor
b30b08fd92 Refresh attachment links in the media modal are unneeded since bringing the image editor into it in [27445].
Props rommelxcastro.
Fixes #32550.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-22 21:33:26 +00:00
Andrew Nacin
a0f4e8e086 Media: Support title fields to be removed from attachments.
props antpb.
fixes #23932.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-14 20:33:26 +00:00
Scott Taylor
4bf8e158ec Fix doc blocks for media*.php
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-26 19:23:25 +00:00
Helen Hou-Sandí
1e8a787aa1 Media: Visually align upload errors with other admin notices.
props sagarjadhav.
fixes #31874.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-15 16:19:26 +00:00
Scott Taylor
2251a28f1d In media-template.php, change a few <a href="#" class="button">s to <button type="button" class="button" ...>.
See #26550.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-09 06:07:25 +00:00
Andrew Ozz
60706015e1 Revert editing of video embed parameters in the media modal, [31620] and [31626] for now. Plan on revisiting in 4.3.
Props iseulde. Fixes #31139, fixes #32006.
Built from https://develop.svn.wordpress.org/trunk@32258


git-svn-id: http://core.svn.wordpress.org/trunk@32229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-21 22:41:26 +00:00
Helen Hou-Sandí
42028327a2 Insert from URL: Make sure the link text is actually used.
Turns out there were more pieces to renaming the field.

props iseulde.
fixes #29476.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-06 18:25:27 +00:00
Scott Taylor
3630732523 Remove the JS part of [31619].
Fixes #6820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 16:34:27 +00:00
Helen Hou-Sandí
b6393c9d77 Media: UI tweaks for Insert from URL.
"Title" field is now labeled as "Link Text", to reflect how it's actually used. It's also hidden whenever the embed is updating, to make it clearer that something is happening. Embed dimension fields are shown below the preview, much like image property fields are shown below.

fixes #29476, see #31139.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-06 15:03:25 +00:00
Scott Taylor
cc953717b7 Allow inline editing of width and height parameters while previewing an embed in the media modal:
* Use `wp.shortcode()` instead of manually constructing a shortcode in `views/embed/link`
* Allow a URL to transition to a shortcode (and vice versa) when returning an embed to TinyMCE
* In `WP_Embed`, store the last URL and last set of attributes requested in class properties
* `wp_ajax_parse_embed()`, allow `[embed]`s to have attributes. Return `attr` in the response.

This is a first pass to allow broad testing with recent MCE view changes. 

See #31139.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-05 06:00:26 +00:00
Scott Taylor
d3471e9850 Allow attachments to be Detached from their parent in media grid and list modes.
See #6820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-05 05:35:28 +00:00
Andrew Ozz
b799bd8e33 TinyMCE: wpView improvements:
- Better structure, simpler "view" registration, better extensibility.
- Better inline documentation.
- Don't show a placeholder for pasted link until we know the link is "embeddable'.
And many more improvements. Props iseulde. See #31412.
Built from https://develop.svn.wordpress.org/trunk@31546


git-svn-id: http://core.svn.wordpress.org/trunk@31527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-25 23:13:25 +00:00
Scott Taylor
952a5c9971 Support chromeless Vimeo via MEjs:
* Bump MediaElement script loader versions to 2.16.2 - missed in [30634], oops!
* Add `Froogaloop` to `js/mediaelement` scripts for Vimeo
* Check for Vimeo in the same locations that YouTube is checked
* Dynamically load Froogaloop script in admin when editing a TinyMCE view
* Edit MediaElement to call `mejs.$.extend` instead of `$.extend` in `mejs.HtmlMediaElementShim.createPlugin()`, since `$` is not available via WP's jQuery (I will report this upstream):
6f9a78e008/src/js/me-shim.js (L631)

Fixes #29267.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-31 20:41:24 +00:00
John Blackbourn
e93105ba9a Clarify the text for the 'Edit Selection' link when multiple media items are selected in the media manager.
Props adamsilverstein
See #24325

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


git-svn-id: http://core.svn.wordpress.org/trunk@30675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-01 04:15:23 +00:00
Scott Taylor
75d347b259 Add size to the UI for Gallery Settings in the media modal. Ensure that the TinyMCE view is refreshed when size changes.
Props richardmtl, noplanman, wonderboymusic.
Fixes #18143.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 03:45:16 +00:00
Sergey Biryukov
10e0807cce Add context for 'Trash' string in media modal.
props pavelevap.
fixes #29739.
Built from https://develop.svn.wordpress.org/trunk@29764


git-svn-id: http://core.svn.wordpress.org/trunk@29536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-24 13:49:20 +00:00
Sergey Biryukov
0113d3457b Avoid PHP notices in media modal caused by orphaned attachments.
fixes #29566 for trunk.
Built from https://develop.svn.wordpress.org/trunk@29724


git-svn-id: http://core.svn.wordpress.org/trunk@29498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-09 10:03:14 +00:00