The `keyup` event was used to provide support for IE8, where which doesn't support the `input` event. As we dropped IE8 support some time ago, this was simply adding unnecessary complexity and double-event triggers.
Props dlh, afercia.
Fixes#32882.
Built from https://develop.svn.wordpress.org/trunk@44539
git-svn-id: http://core.svn.wordpress.org/trunk@44370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Many variables in the JavaScript were defined in the global scope without being explicitly assigned to the window. When built with Webpack, the code gets encapsulated in anonymous functions and those implicit globals get assigned to the wrong scope. This patch prevents that from happening.
Fixes#44371. See #43731.
Built from https://develop.svn.wordpress.org/trunk@43577
git-svn-id: http://core.svn.wordpress.org/trunk@43406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
JSDoc takes it structural data from `@namespace`, `@lends` and `@memberOf`. This change fixes these tags for all JavaScript files in the wp-admin folder.
* Add jsdoc configuration to parse wp-admin/js files. Use `jsdoc -c jsdoc.conf.json` to generate JSDoc.
* Define all used namespaces using `@namespace`.
* Define each usage of the extend function as a prototype assignment using `@lends`.
* Add `@alias` if JSDoc cannot detect the correct name automatically.
This has previously been corrected for all `wp-includes` JavaScript files: [41351].
Props herregroen.
Fixes#42485.
Built from https://develop.svn.wordpress.org/trunk@42403
git-svn-id: http://core.svn.wordpress.org/trunk@42232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
Fire a `menu-item-added` event after a menu item is added to the DOM. Fire a `menu-removing-item` event before a menu item is removed from the DOM. Enables hooking into and responding to menu changes.
Props welcher, adamsilverstein.
Fixes#31218.
Built from https://develop.svn.wordpress.org/trunk@39928
git-svn-id: http://core.svn.wordpress.org/trunk@39865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- adds hidden text to the pagination links
- slightly increases the links clickable area
- fixes a JS error when clicking on the current page number
- avoids to generate nested `<div>` elements at each click
Props xavortm, cwpnolen, afercia.
Fixes#35577.
Built from https://develop.svn.wordpress.org/trunk@38981
git-svn-id: http://core.svn.wordpress.org/trunk@38924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On the Menus screen, events that trigger the posts-categories search need to be
delegated. This "boxes" may get dynamically rebuilt so events directly attached
to the search input field need to be delegated.
Fixes#38324.
Built from https://develop.svn.wordpress.org/trunk@38799
git-svn-id: http://core.svn.wordpress.org/trunk@38742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On the Menus screen, the links to move menu items behave like buttons: they
perform an action so they should be real buttons to be correctly reported to
assistive technologies. Since they're logically grouped controls, they should
also be wrapped in a `<fieldset>` element for better semantics and accessibility.
Props Cheffheid.
Fixes#35578.
Built from https://develop.svn.wordpress.org/trunk@38770
git-svn-id: http://core.svn.wordpress.org/trunk@38713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the Edit Menu screen, each menu item creates 11 form input elements. In menus with more than 71 menu items, often items after the 71st weren't saved. This was because PHP's runtime configuration `max_input_vars` default value is 1000. Large menus exceed this, so PHP didn't populate the `$_POST` superglobal for the latter menu items.
The entire form is now JSON-encoded into a single input which populates `$_POST` manually on form submission.
This was attempted previously in [36506] which was reverted in [36507]. Some form fields were not being slurped into the form's JSON representation, and it did not scale for a site with many posts. This approach fixes those problems.
Props ocean90, afercia.
See #14134.
Built from https://develop.svn.wordpress.org/trunk@36510
git-svn-id: http://core.svn.wordpress.org/trunk@36477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the Edit Menu screen, each menu item creates 11 form input elements. In menus with more than 71 menu items, often items after the 71st weren't saved. This was because PHP's runtime configuration `max_input_vars` default value is 1000. Large menus exceed this, so PHP didn't populate the `$_POST` superglobal for the latter menu items.
The entire form is now JSON-encoded into a single input which populates `$_POST` manually on form submission.
See #14134.
Built from https://develop.svn.wordpress.org/trunk@36506
git-svn-id: http://core.svn.wordpress.org/trunk@36473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Also, adds missing labels and improves the existing ones.
Updates the "custom links" labels and inputs in the Customizer too.
Introduces a generic, reusable, `.wp-initial-focus` CSS class to be used for
the sole purpose of setting the initial focus.
"Quick Search": uniform the attached events and avoids new AJAX requests to
be triggered when the pressed key doesn't change the searched term.
Fixes#35374.
Built from https://develop.svn.wordpress.org/trunk@36379
git-svn-id: http://core.svn.wordpress.org/trunk@36346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The accessibility helpers previously processed all items when editing a menu, which was quite slow to the point of being unresponsive for large menus. They now only process items when they are expanded or a user comes near them in some way, such as hover or focus.
Also simplifies a redundant set of click event handlers down to one, which further enhances performance.
props atimmer, sevenspark.
fixes#25698.
Built from https://develop.svn.wordpress.org/trunk@31604
git-svn-id: http://core.svn.wordpress.org/trunk@31585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Enqueues JS in `do_accordion_sections()`.
* Top and bottom rounded corners for the nav menu accordion.
* Better RTL and no-JS.
props lessbloat, DrewAPicture, aaroncampbell, helen. fixes#23449.
git-svn-id: http://core.svn.wordpress.org/trunk@24680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Registration stays the same — they're meta boxes
* Call `do_accordion_sections()` instead of `do_meta_boxes()` and they render as an accordion
props DrewAPicture, lessbloat, jkudish. fixes#23450. see #23449
git-svn-id: http://core.svn.wordpress.org/trunk@23707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
dropdown, unless you have zero or one menus (which is the most common),
in which case you jump right into editing your sole menu.
Do assignment to location using checkboxes in the main menu editing
section instead of the backwards menu => location assignment in a
random meta box.
More to come, but this gets us started.
props lessbloat, DrewAPicture, jkudish. see #23119
git-svn-id: http://core.svn.wordpress.org/trunk@23441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* This moves our "development" versions from .dev.js to .js (same for css).
* The compressed version then moves from .js to .min.js (same for css).
By switching to the standard .min convention, it sets expectations for developers,
and works nicely with existing tools such as ack.
fixes#21633.
git-svn-id: http://core.svn.wordpress.org/trunk@21592 1a063a9b-81f0-0310-95a4-ce76da25c4cd