Commit Graph

18 Commits

Author SHA1 Message Date
Peter Wilson
b70ebbddf9 Script Loader: Switch to JavaScript translations.
Update JavaScript files for tag suggestions and the TinyMCE link plugin to use client side translations. This allows for `_n()` to be used for strings requiring singular and plural versions in which the correct form is only known client side.

Props audrasjb, chaion07, costdev, hellofromtonya, johnbillion, marybaum, nicolefurlan, oglekler, rebasaurus, rsiddharth, sergeybiryukov, shaampk1, shahariaazam, swissspidy, tobifjellner.
Fixes #48244.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-18 22:16:14 +00:00
Peter Wilson
a334e05915 Editor: Limit display of tags on classic editor.
On the classic editor, limit the search of tags and non-hierarchical taxonomies to twenty results. This in turn prevents an unbounded database query via an AJAX request.

Props pikamander2, costdev, azouamauriac, audrasjb.
Fixes #55052.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 04:06:05 +00:00
Andrew Ozz
190b9a0b32 Quick/Bulk Edit: Follow up to [49703]. Improve the logic a bit and always return this (the jQuery object) in wpTagsSuggest.
Fixes #51872.
Built from https://develop.svn.wordpress.org/trunk@49710


git-svn-id: http://core.svn.wordpress.org/trunk@49433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-30 14:31:04 +00:00
Andrew Ozz
bac1ada04d Quick/Bulk Edit: Fix undefined error when initializing UI Autocomplete 1.12.1 on non-existing element and then attempting to use the autocomplete instance.
Example: `jQuery( '#nonexisting' ).autocomplete().autocomplete( 'instance' ).something`.

Props _luigi, sabernhardt, donmhico, azaozz.
Fixes #51872.
Built from https://develop.svn.wordpress.org/trunk@49703


git-svn-id: http://core.svn.wordpress.org/trunk@49426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-28 12:46:05 +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
Dominik Schilling
3d95a45675 I18N: Use wp.i18n for translatable strings in wp-admin/js/tags-box.js and wp-admin/js/tags-suggest.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50579.
Built from https://develop.svn.wordpress.org/trunk@48350


git-svn-id: http://core.svn.wordpress.org/trunk@48119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-06 21:00:03 +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
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
Andrea Fercia
4ead9880b0 Accessibility: Make the Tags meta box better support Input Method Editor (IME) converters.
Also, restores the keyboard interaction behavior prior to [41988] by requesting one single Enter key press to add a tag.

Props ryanshoover, miyauchi.
Fixes #45371.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-17 07:18:51 +00:00
desrosj
8eb90ac374 Docs: Restore output annotation in tags-suggest.js.
This was mistakenly removed in [44537].

See #38922.
Built from https://develop.svn.wordpress.org/trunk@44538


git-svn-id: http://core.svn.wordpress.org/trunk@44369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:50:51 +00:00
desrosj
6fbf4ceaea REST API: Restore use of wp_ajax_ajax_tag_search() for tag search.
This solution does not work with custom taxonomies in the current state.

Reverts [42614,42619,42737].

Props danielbachhuber.
See #38922.
Built from https://develop.svn.wordpress.org/trunk@44537


git-svn-id: http://core.svn.wordpress.org/trunk@44368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:37:51 +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
Adam Silverstein
35a20d8f50 Remove unused var after r42614, fixing a jshint error.
Built from https://develop.svn.wordpress.org/trunk@42618


git-svn-id: http://core.svn.wordpress.org/trunk@42447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-30 00:34:59 +00:00
Adam Silverstein
86434ebca4 Taxonomy: Use REST API for ajax tag search.
Deprecate wp_ajax_ajax_tag_search and switch to using the REST API when searching tags in the tags meta box.

Props nacin, chriscct7, afercia, swissspidy, jnylen0, rmccue, ryelle.
Fixes #38922.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-30 00:17:31 +00:00
Andrea Fercia
35d8daf000 Quick/Bulk Edit: Fix the Tag suggestions position on the Bulk Edit textarea.
Always passes the complete `position` object to the jQuery autocomplete widget.
Also checks if an autocomplete instance already exists on the Bulk Edit textarea.

Props davidbenton.
Fixes #40242.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 16:35:45 +00:00
Sergey Biryukov
2fadd7a895 Docs: Use 3-digit, x.x.x style semantic versioning for @since 4.7.0 entries.
See #37770.
Built from https://develop.svn.wordpress.org/trunk@39281


git-svn-id: http://core.svn.wordpress.org/trunk@39221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-17 18:28:30 +00:00
Andrea Fercia
5c555e5d10 Accessibility: Improve the Tags meta box accessibility.
- changes the "X" links in buttons, improves their color contrast ratio and focus style
- adds screen reader text "Remove item: + tagname"
- uses `wp.a11y.speak()` to give screen reader users feedback when adding/removing tags
- makes the `tagcloud-link` toggle a button, with an `aria-expanded` attribute to indicate the tag cloud collapsed/expanded state
- changes colors for the autocomplete highlighted option in order to have a better color contrast ratio
- reduces the font size for the autocomplete on Press This
- removes CSS related to the old `suggest.js` from Press This

Props joedolson, cgrymala, azaozz, afercia.
Fixes #27555.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 18:16:42 +00:00
Andrew Ozz
d91da52588 Accessible Tags autocomplete:
- Replace suggest.js with UI Autocomplete.
- Use the same settings like in the editor link toolbar.
- Abstract it and add in a new file, tags-suggest.js. Then make it a dependency for the Tags postbox(es) and Quick and Bulk Edit.
- Add `data-wp-taxonomy` on all input elements to improve handling in the UI for custom taxonomies.

Props afercia, azaozz.
See #33902.
Built from https://develop.svn.wordpress.org/trunk@38797


git-svn-id: http://core.svn.wordpress.org/trunk@38740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 22:40:28 +00:00