Commit Graph

2475 Commits

Author SHA1 Message Date
Andrea Fercia
b43ddef0bc Accessibility: Improve the color picker UI accessibility, interaction, and generated markup.
- Refactors the UI controls around the Iris color picker to output valid and semantic markup
- Simplifies the way elements visibility gets toggled
- Properly associates the visually hidden label with the color input field
- Makes the toggle button a real button
- Adds `aria-expanded` to the toggle button
- Keeps focus on the toggle button instead of moving it to the color input field
- Adds `aria-label` attributes to give better context to some controls
- Removes a redundant title attribute
- Keeps the toggle button text to "Select Color" instead of changing it to "Current Color" when a color is selected
- Slightly improves the responsive view
- CSS clean-up

Fixes #39662.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-03 16:02:46 +00:00
Scott Taylor
4557e0d292 Docs: improve JS docs for bookmarklet.js
Props andizer, ireneyoast.
Fixes #41547.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:55:45 +00:00
Scott Taylor
55a180f063 Docs: improve JS docs for tags.js
Props atimmer, jipmoors.
Fixes #41069.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:52:44 +00:00
Scott Taylor
412d5e60be Docs: improve JS docs for editor-expand.js
Props IreneYoast, terwdan.
Fixes #41068.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:48:45 +00:00
Adam Silverstein
d856eda571 Docs: Improve JavaScript documentation in color-picker.js.
Add and improve JSDOC blocks.

Props carolinegeven, jjcomack, jipmoors.
Fixes #41063.



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


git-svn-id: http://core.svn.wordpress.org/trunk@41104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 13:10:44 +00:00
Weston Ruter
667f377cd0 Widgets: Prevent visual Text widget from decoding encoded HTML.
Also apply `the_editor_content` filters on widget `text` with `format_for_editor()` as is done for the post editor.

Amends [40631].
Props westonruter, azaozz.
See #35243.
Fixes #41596.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-17 23:37:43 +00:00
Weston Ruter
75ad3494a8 Widgets: Expose link URL input field in Image widget to avoid having to open media modal to discover.
Props timmydcrawford, westonruter.
See #39993.
Fixes #41274.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 17:56:42 +00:00
Weston Ruter
18613c0010 Widgets: Add missing open class for expanded widgets in Customizer; utilize open class for expansion detection in Text and Media widgets.
Fixes #41625.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 06:25:43 +00:00
Weston Ruter
5c755f652b Customize: Prevent attachment deletions from silently failing in media modals opened for Media widgets.
Amends [40640].
See #32417.
Fixes #41609.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 06:11:43 +00:00
Weston Ruter
e956aa4176 Customize: Prevent wide widgets from being displayed as wide when Customizer is displayed in mobile breakpoint.
Fixes #41624.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 05:55:43 +00:00
Weston Ruter
a5d3688157 Customize: Update selector to add max-height/max-width for wide widgets to account for JS-driven Text widget and Media widgets.
Fixes #41623.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 05:42:42 +00:00
Weston Ruter
9c3cdaf3fb Widgets: Fix extensibility of Text widgets so that JS logic will initialize on subclassed widgets.
Amends [40631].
See #35243.
Fixes #41540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 05:25:46 +00:00
Andrea Fercia
a029f83fb5 Menus: Visually hide the menu item edit link text in a consistent way.
Fixes a visual glitch visible on Ubuntu. WordPress uses system fonts and they have
different metrics across operating systems. Uses screen-reader-text as a more
solid way to visually hide text.

Props punit5658, afercia.
Fixes #41497.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 22:12:43 +00:00
James Nylen
c91b130b53 REST API: Allow overriding jQuery.ajax calls from within wp-admin
There are now 3 places where we call out to the REST API from within wp-admin.  This commit introduces a small library to allow overriding these calls, centralize nonce-passing logic, and eliminate the need to pass a full REST URL down to client code (this last feature is not yet used and will be explored in a separate ticket).

Fixes #40919.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 16:45:44 +00:00
Pascal Birchler
66a3b24b72 Permalinks: Remove unnecessary semicolon after [41182].
See #29872.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 17:55:46 +00:00
Pascal Birchler
fd07b2254d Permalinks: Add buttons for the available structure tags to the admin UI.
Often times, it can be confusing to set a custom permalink structure. One has to double-check the documentation, make 
sure to correctly insert the structure tag, and hope not to break their site.

With this addition, the available structure tags are being displayed as a list of easily clickable buttons that can be 
used to insert tags to the custom structure input field and to remove them again.

Props kpdesign, swissspidy, joedolson, afercia.
Fixes #29872.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 17:43:45 +00:00
Weston Ruter
18fd50d2b6 Media: Improve acceptance of YouTube /embed/ URLs when inserting in media modal.
Props timmydcrawford.
Fixes #41201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 02:36:46 +00:00
Sergey Biryukov
4e4df0e6c9 Docs: Use 3-digit, x.x.x style semantic versioning for @since 4.8.0 entries.
See #41017.
Built from https://develop.svn.wordpress.org/trunk@41151


git-svn-id: http://core.svn.wordpress.org/trunk@40991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 22:48:42 +00:00
Weston Ruter
ddca4ceff1 Widgets: Rename Text widget's legacy mode to non-visual mode, restore boolean filter prop, and improve compatibility for widget_text filters applied in Custom HTML widget.
Props westonruter, obenland, timmydcrawford for testing.
Amends [41050].
See #35243, #40951, #40907.
Fixes #41394.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 22:46:42 +00:00
Weston Ruter
8b3d2e0876 Widgets: Improve Text widget's reliability in syncing Visual tab's contents with Text tab and with hidden sync inputs.
Amends [40631].
Props azaozz, westonruter, rinkuyadav999 for testing.
See #35243.
Fixes #40974 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 20:49:45 +00:00
Weston Ruter
9330e39b3d Widgets: Check for existence of wp.customize.state before attempting to access in Text widget.
Amends [40631].
See #35243.
Fixes #41361 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-18 22:36:42 +00:00
Adam Silverstein
499e2a0ff9 Move sanitizeText and stripTags from press this to wp.sanitize.
Introduce the `wp.sanitize` namespace and add two helpers for text sanitization. `stripTags` strips HTML tags from a string using regex.

Fixes #40635.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-15 15:48:46 +00:00
Weston Ruter
8db1f562e6 Widgets: Add legacy mode for Text widget and add usage pointers to default visual mode.
The Text widget in legacy mode omits TinyMCE and retains old behavior for matching pre-existing Text widgets. Usage pointers added to default visual mode appear when attempting to paste HTML code into the Visual tab and when clicking on the Text tab, informing users of the new Custom HTML widget.

Props westonruter, melchoyce, gitlost for testing, obenland for testing, dougal for testing, afercia for testing.
See #35243.
Fixes #40951.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 17:09:43 +00:00
Weston Ruter
1af3aa0000 Customize: Restrict click target of menu deletion, moving to button from its container.
Props westonruter, afercia.
Fixes #40981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-10 18:40:44 +00:00
Weston Ruter
7b28ff2f2a Customize: Fix logic to re-expand a newly inserted nav menu section after placeholder section is replaced.
Fixes todo from Menu Customizer feature plugin: https://github.com/voldemortensen/menu-customizer/commit/0f4ea4e#diff-daa55fade2253f26ccbe02f71058841cR2330
Amends [32806].
Props greuben.
See #32576.
Fixes #40997.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 00:44:41 +00:00
Andrew Ozz
dcc372e098 Customizer: improve setting the TinyMCE modals z-index.
Props westonruter, greuben.
See #41158.
Built from https://develop.svn.wordpress.org/trunk@40995


git-svn-id: http://core.svn.wordpress.org/trunk@40845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-03 21:18:44 +00:00
Andrew Ozz
65f1051697 TinyMCE: respect the Disable the visual editor when writing user setting and don't output the TinyMCE components when using wp_enqueue_editor().
Fixes #40960 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40991


git-svn-id: http://core.svn.wordpress.org/trunk@40841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 21:31:47 +00:00
Andrew Ozz
16167ffe41 Text widget: bump the TinyMCE modals z-index to 500001 so they show in the Customizer.
Props greuben.
Fixes #41158 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40990


git-svn-id: http://core.svn.wordpress.org/trunk@40840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 20:33:41 +00:00
Weston Ruter
b7ca48fff0 Widgets: Add accessibility mode support for TinyMCE-enhanced Text and Media widgets (Video, Audio, Images).
Amends [40640], [40631].
Props westonruter, afercia.
See #35243, #32417.
Fixes #40986.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 18:48:41 +00:00
Weston Ruter
46551a898a Widgets: Forcibly limit Video widget to only accept oEmbed URLs from YouTube and Vimeo (for now).
Amends [40640].
Props timmydcrawford.
See #34115, #39994.
Fixes #40935.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:24:41 +00:00
Peter Wilson
395ff7aebe Docs: Add wp-admin/js/media.js documentation.
Props jipmoors, jjcomack, diedeexterkate.
Fixes #41072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 15:37:53 +00:00
Peter Wilson
952975fd0d Docs: Add wp-admin/js/custom-background.js documentation.
Props jipmoors.
Fixes #41067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 13:24:41 +00:00
Sergey Biryukov
c569080cd1 Docs: Add documentation for wp-admin/js/comment.js.
Props ireneyoast, andizer, jipmoors.
Fixes #41065.
Built from https://develop.svn.wordpress.org/trunk@40913


git-svn-id: http://core.svn.wordpress.org/trunk@40763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 13:02:40 +00:00
Weston Ruter
bb2e8b0d63 Widgets: Ensure that audio and video files appear in media library browser upon upload.
Props timmydcrawford.
Amends [40640].
See #32417, #39994, #39995.
Fixes #40803.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 03:20:41 +00:00
Weston Ruter
478d7730b6 Widgets: Prevent multiple items from being selectable when first populating a media widget.
Amends [40640].
Props obenland, timmydcrawford.
See #32417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-24 05:31:42 +00:00
Adam Silverstein
5cc6c39430 Themes: improve browser history support on new themes page.
When closing the theme preview, restore the previously selected tab. Avoid an issue where duplicate entries in the history prevented navigation. When re-opening the preview, remove bound event handlers before re-adding them.

Props afercia.
Fixes #36613.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-23 20:32:44 +00:00
Weston Ruter
6e935e7f20 Widgets: Further refine WP JS coding style in media widgets code.
Props afercia.
See #32417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 22:05:42 +00:00
Dominik Schilling
96549c5022 Widgets: Remove unused JS variable to fix JSHint error introduced in [40640].
See #39994.
Built from https://develop.svn.wordpress.org/trunk@40811


git-svn-id: http://core.svn.wordpress.org/trunk@40669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-20 09:45:42 +00:00
Weston Ruter
039397721e Widgets: Introduce isHostedVideo method on VideoWidgetControl to allow plugins to extend for recognizing services beyond YouTube and Vimeo.
Also update jshint configuration in Gruntfile to include the widget scripts among the JS files linted.

Props timmydcrawford.
See #39994.
Fixes #40808.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-20 04:18:41 +00:00
Andrea Fercia
1a8f7ab144 Dashboard: Don't trigger an Events search when the search field is empty.
Fixes #40816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 17:27:43 +00:00
Konstantin Obenland
359cc45e08 Docs: Improve inline docs for inlineEditPost.
Props jjcomack, rensw90.
Fixes #39823.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 15:45:42 +00:00
Andrew Ozz
7a9ce6d03f Dashboard: Improve the handling of locations determined by geolocating the IP address and by entering a city name. Fix couple of edge cases, and some names.
Props iandunn coreymckrill.
Fixes #40702.
Built from https://develop.svn.wordpress.org/trunk@40790


git-svn-id: http://core.svn.wordpress.org/trunk@40648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 05:48:42 +00:00
Andrew Ozz
daab579a88 Dashboard:
- Close the form after obtaining a valid location.
- Fix focusing the toggle button after closing the form.
- Fix aria attribute values.
- Fix positions in IE11.
- Some JS and CSS cleanup.

Props afercia, coreymckrill.
Fixes #40735.
Built from https://develop.svn.wordpress.org/trunk@40789


git-svn-id: http://core.svn.wordpress.org/trunk@40647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 04:01:41 +00:00
Andrew Ozz
d7c37de2de Editor: When stripping paragraph tags, and there is a <br> at the beginning or the end, merge them and keep the paragraph, not the <br>.
Props rellect.
Fixes #37066.
Built from https://develop.svn.wordpress.org/trunk@40787


git-svn-id: http://core.svn.wordpress.org/trunk@40645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 22:55:42 +00:00
Weston Ruter
e62f6ac8fe Widgets: Ensure title field for media widget will update with sanitized value after change event in addition to input event.
Aligns behavior of field with Text widget and other widgets whereby the server-sanitized title (via the `widget-update` request) is supplied into the field after the `change` event.

See #32417.
Fixes #40805.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 21:04:41 +00:00
Weston Ruter
764d8b521f Media: Trim whitespace in URLs provided for external embeds.
Also avoid showing error notice in media widget when URL field is empty.

Props timmydcrawford, westonruter.
Fixes #40771.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 01:59:42 +00:00
Aaron Campbell
38347d7c58 Add nonce for updating file system credentials.
Built from https://develop.svn.wordpress.org/trunk@40723


git-svn-id: http://core.svn.wordpress.org/trunk@40581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 14:48:44 +00:00
Dominik Schilling
3d10fef22d Customize: Igore invalid customization sessions.
Built from https://develop.svn.wordpress.org/trunk@40704


git-svn-id: http://core.svn.wordpress.org/trunk@40567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 12:07:43 +00:00
Weston Ruter
8a29b28a98 Widgets: Prevent image title attribute from being populated from attachment title by default upon selection.
Props westonruter, timmydcrawford.
See #39993.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 18:42:44 +00:00
Weston Ruter
3ce794812d Widgets: Fix deferred rendering of controls for media widgets until container element fully expands.
Adds omitted call to `renderWhenAnimationDone()` which was missed when this code was copied from the Text widget.

Amends [40656].
See #40750.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 22:01:42 +00:00