Commit Graph

38 Commits

Author SHA1 Message Date
davidbaumwald 2ea5eb36fe Taxonomy: Only reset non-button form field values after adding a tag.
[52953] added HTML5 input types to the form reset after a tag is created.  The selector was a bit too greedy, causing `button` types to have their values reset also.  

This change updates the jQuery selector to exclude `button`, `submit`, and `reset` input types from the form reset.

Follow-up to [52953].

Props peterwilsoncc.
Fixes #48030.
Built from https://develop.svn.wordpress.org/trunk@53168


git-svn-id: http://core.svn.wordpress.org/trunk@52757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 19:37:14 +00:00
Peter Wilson 3d9bb812f1 Taxonomy: Show error message for terms without a name.
Display an error message to users if they attempt to create a term without a name via the admin-ajax `add-tag` action. This improves the accessibility of the screen by avoiding the use of color alone to indicate an error.

Props conner_bw, birgire, afercia.
Fixes #47018.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 03:50:05 +00:00
davidbaumwald ee85a17cf2 Taxonomy: Consider HTML5 input types when resetting form values after adding a new tag.
When adding a new tag, the form is reset by clearing values for `input[type=text]` and `textarea`s.  However, the reset doesn't account for any HTML5 input types, like `number` or `url`, that may be added by plugins or themes.

This change updates the form resetting jQuery to clear any values from `input` types that are not hidden and neither a `checkbox` nor `radio` type.

Props stevegrunwell.
Fixes #48030.
Built from https://develop.svn.wordpress.org/trunk@52953


git-svn-id: http://core.svn.wordpress.org/trunk@52542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:12:06 +00:00
Sergey Biryukov 87db5b833d External Libraries: Further fix jQuery deprecations in WordPress core.
Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429].

Props Clorith.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50547


git-svn-id: http://core.svn.wordpress.org/trunk@50160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 19:01:03 +00:00
Sergey Biryukov 9f12d7f575 External Libraries: First pass at fixing jQuery deprecations in WordPress core and bundled themes.
To be able to disable jQuery Migrate as step 3 of updating the jQuery version shipped with WordPress, all `JQMIGRATE` warnings in the browser console will have to be addressed.

This includes many minor adjustments to a wide array of core files.

Follow-up to:
* Step 1: Disabling jQuery Migrate 1.4.1 in WordPress 5.5: [48323], [48324]
* Step 2: Updating jQuery to 3.5.1 and adding jQuery Migrate 3.3.x in WordPress 5.6: [49101], [49338], [49615], [49649]

Props Clorith, azaozz.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50001


git-svn-id: http://core.svn.wordpress.org/trunk@49702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-22 12:32:03 +00:00
Dominik Schilling 31d93c553a I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/tags.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 #50577.
Built from https://develop.svn.wordpress.org/trunk@48347


git-svn-id: http://core.svn.wordpress.org/trunk@48116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-06 19:47:03 +00:00
Sergey Biryukov e13c363b17 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48104


git-svn-id: http://core.svn.wordpress.org/trunk@47873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:02:12 +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
Sergey Biryukov f933abef11 Accessibility: Taxonomy: When a new category or tag is being added, show a spinner and noop the button to avoid multiple requests.
Props andg, afercia, guddu1315, SergeyBiryukov.
Fixes #47607.
Built from https://develop.svn.wordpress.org/trunk@45683


git-svn-id: http://core.svn.wordpress.org/trunk@45494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-26 17:46:56 +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
atimmer f6a37e7d39 Docs: Remove `@summary` tags from JSDoc.
As decided in the JavaScript core chat. With a few reasons:

* It is visually cleaner when reading the source.
* This bring the JavaScript documentation closer to the PHP documentation.

The only disadvantage is that the JSDoc parser doesn't split out the summary and the description in the new format. We've decided to solve this when building the JavaScript documentation parser.

Props herregroen.
Fixes #42901.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-18 14:14:53 +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
Adam Silverstein d1ec180619 Taxonomy: Add a "delete" button on term edit page.
Add a 'delete' link next to the update button on the term edit screen so you can delete a term while you are reviewing it's details. 

Props cklosows, bradt, ocean90, johnbillion, DrewAPicture, ryan, MatheusGimenez, maguiar.
Fixes #9777.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 19:26:41 +00:00
Gary Pendergast b7546d798f Emoji: Instead of having custom hooks for Ajax callbacks, use MutationObserver to re-parse any changed elements in the DOM.
Props iseulde

See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-12 12:52:26 +00:00
Andrew Nacin 78679bfb3f Emoji JS cleanup.
* Filename: emoji.js => wp-emoji.js
 * Script handle: emoji => wp-emoji
 * Object: WPEmoji => wp.emoji
 * Script settings: EmojiSettings => _wpemojiSettings
 * Setting key: base_url => baseUrl
 * Remove executable bit from files

see #31242.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-12 03:17:26 +00:00
Sergey Biryukov 9f6cd01346 Fix JSHint errors in [31734] and add missing dependencies.
props iseulde.
fixes #31328.
Built from https://develop.svn.wordpress.org/trunk@31741


git-svn-id: http://core.svn.wordpress.org/trunk@31722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-12 01:05:26 +00:00
Gary Pendergast 03ade8c011 Add emoji URL support, and Twemoji fallback for displaying slugs in wp-admin, when the browser doesn't natively support emoji.
Props pento, SergeyBiryukov and boonebgorges.

Fixes #31328


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


git-svn-id: http://core.svn.wordpress.org/trunk@31715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 22:55:28 +00:00
Andrew Nacin 8daa128928 Fix JSHint errors in tags.js.
props atimmer.
fixes #26009.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-15 05:02:10 +00:00
Andrew Nacin 2a956dd5b7 Stop using jQuery.live(). props ocean90. see #22975.
git-svn-id: http://core.svn.wordpress.org/trunk@23444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-16 17:46:12 +00:00
Andrew Nacin 2710bcade1 Switch to .min for compressed JS and CSS files.
* 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
2012-08-23 00:04:18 +00:00
bumpbot 085a053c22 Compress scripts/styles: 3.4-alpha-20090.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-02 21:15:21 +00:00
azaozz 9e4bee6c26 Add quotes to [value="some"] selectors, see #16426
git-svn-id: http://svn.automattic.com/wordpress/trunk@17777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-30 02:15:08 +00:00
scribu af0d6246ae Remove placeholder row when adding first term. See #15849
git-svn-id: http://svn.automattic.com/wordpress/trunk@17003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-16 19:13:47 +00:00
scribu 020ce73746 Ajaxify list-type screens in the admin. See #14579
git-svn-id: http://svn.automattic.com/wordpress/trunk@15491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-11 21:54:51 +00:00
nacin 6ae5b10973 Squeeze out some bytes via munging.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-27 13:39:44 +00:00
dd32 c9ea3a7686 Convert Terms page to use WP_Ajax_Response(), hierarchical terms will now appear under their parent OR have the parents prefixed, Terms will be removed from tag cloud/parent list upon deletion, Terms will be added to Parent list in correct order upon ajax creation, Errors on term creation flow back to UI, clean up _tag_row() alternate class handling, Show None text in Category dropdown if empty and show_if_empty = true. See #11838
git-svn-id: http://svn.automattic.com/wordpress/trunk@13086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-02-13 05:40:47 +00:00
dd32 34cc6ab57e Merge Categories/Hierarchical taxonomies into edit-tags.php. See #11838
git-svn-id: http://svn.automattic.com/wordpress/trunk@12818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-01-24 11:00:27 +00:00
azaozz f385e7da46 Use new jQuery methods when adding, editing and deleting tags with AJAX, fix warning when deleting tags, see #10239
git-svn-id: http://svn.automattic.com/wordpress/trunk@11676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-07-01 08:12:39 +00:00
azaozz affd966711 Custom taxonomies support: quick edit, delete, show in the menu
git-svn-id: http://svn.automattic.com/wordpress/trunk@10557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-12 08:00:29 +00:00
azaozz 515b09febb Fix delete warnings for categories, link categories, tags and comments, fixes #9050
git-svn-id: http://svn.automattic.com/wordpress/trunk@10522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-07 15:26:01 +00:00
azaozz 1c9353ad2e Cleanup js files and prepare for concatenating, move most inline js to files
git-svn-id: http://svn.automattic.com/wordpress/trunk@10348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-01-12 13:43:17 +00:00
azaozz a750885c8e Minify all js and add the non-minified files as .dev.js
git-svn-id: http://svn.automattic.com/wordpress/trunk@10291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-01-02 15:08:58 +00:00
ryan 5c5d1aef4d Key screen meta off of page hook. fixes #8246
git-svn-id: http://svn.automattic.com/wordpress/trunk@9735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-11-17 19:16:26 +00:00
azaozz b756fbabcd QE fixes: don't display-filter titles, show QE for newly added cats and tags, fixes #8146
git-svn-id: http://svn.automattic.com/wordpress/trunk@9606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-11-11 09:39:42 +00:00
ryan b10412eab9 Column hiding for comments. Settings box JS consolidation. Props Viper007Bond. see #7725
git-svn-id: http://svn.automattic.com/wordpress/trunk@8988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-09-26 01:05:52 +00:00
ryan 24823f8c9e Consolidate column header code. Add column hiding to taxonomy pages (incomplete). see #7725
git-svn-id: http://svn.automattic.com/wordpress/trunk@8923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-09-18 05:41:45 +00:00
ryan 879f7f4766 First cut at Manage->Tags. Props jhodgdon. see #5684
git-svn-id: http://svn.automattic.com/wordpress/trunk@6660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-01-25 19:29:01 +00:00