Commit Graph

100 Commits

Author SHA1 Message Date
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 fc17576fd2 Accessibility: Improve toggling the "Post locked" information visibility.
- effectively hides the "Post locked" information from assistive technologies
- when a post is locked, reveals the "Post locked" information without CSS animation
- the height CSS animation didn't work anyways after [24906]

See #24553.
Fixes #44946.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-25 17:15:52 +00:00
omarreiss bdbaccce37 General: Explicitly assigns all JS globals to the window.
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
2018-08-19 13:33:24 +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
Andrea Fercia 4767e7736c Accessibility: Change the posts "Quick Edit" link to a button.
For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation. Also,
adds an `aria-expanded` attribute to the button to communicate to assistive
technologies the expanded / collapsed status of the Quick Edit form.

Props Cheffheid, audrasjb, afercia.
Fixes #38677.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-21 22:31:32 +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
atimmer 1f707de9dd Docs: Improve wp-admin JSDoc structural data globally.
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
2017-12-15 13:42:46 +00:00
Andrea Fercia a42b9cebde Quick/Bulk Edit: Improve the inline error messages styling.
- uses the core `notice` styles for the Quick Edit form inline error messages
- adds missing periods at the end of a few error messages

Props ocean90, karmatosed, melchoyce, afercia.
Fixes #35496.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 21:52:52 +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
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
Dion Hulse 5f7bbe66d7 Posts, Post Types: Fix Quick Edit to correctly set the page template for non-hierarchical post types.
Props dd32, swissspidy.
Fixes #38655.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-13 07:42:31 +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
Andrea Fercia 496bde4e77 Quick/Bulk Edit: Remove a no more used jQuery loop for unsupported post formats.
See #23426.
See #24096.
Fixes #35564.
Built from https://develop.svn.wordpress.org/trunk@36375


git-svn-id: http://core.svn.wordpress.org/trunk@36342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-21 22:50:25 +00:00
Andrea Fercia c6ec579751 Accessibility: Improve focus handling and audible feedback on the Posts Quick-Bulk Edit.
Avoids a focus loss when saving or closing the form moving focus back to a proper place.
Uses `wp.a11y.speak()` to dispatch successful edits and error messages to screen readers.

Fixes #34756.
Built from https://develop.svn.wordpress.org/trunk@36303


git-svn-id: http://core.svn.wordpress.org/trunk@36270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-14 22:58:27 +00:00
Andrea Fercia 9b486acb9b Quick Edit: on the Taxonomies screens, prevent a page reload when pressing Enter on a focused field.
Fixes #35401 for trunk.
Built from https://develop.svn.wordpress.org/trunk@36260


git-svn-id: http://core.svn.wordpress.org/trunk@36227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-11 13:15:29 +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
Andrew Ozz a6cf0b41a6 JS: in event callbacks replace the very outdated `return false` with `preventDefault()`.
Props adamsilverstein.
Fixes #18590.
Built from https://develop.svn.wordpress.org/trunk@34977


git-svn-id: http://core.svn.wordpress.org/trunk@34942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-09 01:27:27 +00:00
Andrea Fercia 5f5ea8c3e2 Quick Edit: fix the Tags auto-suggest tooltip visibility.
Be sure to hide the `jquery.suggest` Tags textarea tooltip also when using the keyboard to Save/Cancel.

Props rommelxcastro for the initial patch.
Fixes #32580.
Built from https://develop.svn.wordpress.org/trunk@34064


git-svn-id: http://core.svn.wordpress.org/trunk@34032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 23:34:25 +00:00
Helen Hou-Sandí 8eb7f71e6b List tables: A better responsive view.
Instead of truncating columns, the data that's already in the markup can now be toggled into view. Only seems appropriate to celebrate four years of contributing by finally doing the first thing I ever mocked up.

Known issues / concerns:
* Custom list tables that don't define a primary column will show nothing at all. These are not extremely common, as `WP_List_Table` isn't really recommended for plugin consumption, but it happens. We need to come up with some kind of fallback.
* Some visual elements, particularly whitespace, could use refining.
* Needs a11y review.
* Touch performance on iOS feels sluggish - is there anything we can do about that?
* Would this be better accordion-style (only one expanded at a time)?
* Is `wp_strip_all_tags()` good enough for column titles that have HTML in them? It's essentially a workaround for the fact that core's comments column does that for the icon, which maybe it shouldn't. Perhaps worth another ticket, as a markup change would be fairly independent.
* Visual hierarchy is not great when expanded (also worthy of another ticket).
* Quick edit now becomes noticeably more annoying to cancel out of, as you have to scroll all the way down and you lose your position from before it was opened. Again, worthy of another ticket.

props Michael Arestad, helen.
see #32395.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-01 01:31:25 +00:00
Helen Hou-Sandí 8f85bb1ac5 Bulk/quick edit: Set the correct colspan.
`thead` can contain `td`s now, too.

props afercia.
fixes #31654.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-01 01:06:25 +00:00
Scott Taylor 86beb35f6d Use `<button>` instead of `<a>` for non-link links in Quick Edit.
Props afercia.
Fixes #32213.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-19 21:42:27 +00:00
Konstantin Obenland bafb008be1 When inline editing a post, reset password field to be editable by default.
The Quick Edit form is cloned and then populated with post-specific data. If the 
previous post was private, the password field would continue to be disabled for
the next post.

Props afercia.
Fixes #32259.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-09 22:02:27 +00:00
Helen Hou-Sandí 3ac1a19529 Spinners: Toggle a class instead of show/hide.
Toggling spinners also now uses visibility instead of display, so that the space is always reserved and nothing moves around unexpectedly.

props cdog, MikeHansenMe, valendesigns.
fixes #22839. see #31875, #30725.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-03 04:52:27 +00:00
Helen Hou-Sandí 591c4b7d3b List tables: Go back to inserting quick edit rows after, as some plugins rely on that assumption. Results are the same.
fixes #26060.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-18 21:50:27 +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
Scott Taylor 6ffa051689 Replace flagrant instances of `.html('')` with `.empty()`.
Props OriginalEXE, SergeyBiryukov.
Fixes #27034.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-09 19:44:26 +00:00
Sergey Biryukov 15fc97b1cf Quick Edit: Don't save the post if Enter is pressed on the Cancel link.
props afercia.
fixes #30345.
Built from https://develop.svn.wordpress.org/trunk@31274


git-svn-id: http://core.svn.wordpress.org/trunk@31255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-24 15:07:22 +00:00
Helen Hou-Sandí 62a197d6bf List tables: Use CSS :nth-child() selectors for zebra striping.
Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the `.alternate` class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 22:14:22 +00:00
Sergey Biryukov 1c227553b9 Fix unexpected replacement of a previous tag when selecting a tag from autosuggest results.
props camdensegal.
fixes #28471.
Built from https://develop.svn.wordpress.org/trunk@28851


git-svn-id: http://core.svn.wordpress.org/trunk@28655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 16:08:14 +00:00
Sergey Biryukov 78a9cb855e Fix displaying taxonomies in bulk edit if the post type does not support titles.
props scribu.
fixes #16793.
Built from https://develop.svn.wordpress.org/trunk@28600


git-svn-id: http://core.svn.wordpress.org/trunk@28425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-28 13:50:14 +00:00
Andrew Ozz 0f20e57329 Heartbeat:
- Bring back heartbeat.interval().
- Rename wp_disable_heartbeat_suspend() to wp_heartbeat_set_suspension().
- Rename the option for disabling suspension from options.suspend to options.suspension.
Fixes #25073.
Built from https://develop.svn.wordpress.org/trunk@26549


git-svn-id: http://core.svn.wordpress.org/trunk@26441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-03 00:45:10 +00:00
Andrew Nacin 6212b30ddd JShint fixes for inline-edit-post.js.
props dougwollison.
fixes #26001.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-19 04:32:10 +00:00
Andrew Ozz 188fce6c9b Heartbeat: clean up code style, better naming, better code structure. Props carldanley, props evansolomon.
Changes:
- Add connectNow() public method to trigger a connection immediately.
- Remove the "skipping" when no data to send.
- Change the default interval to 60 sec.
- Fix resetting the next connection time when changing the interval.
See #25073.
Built from https://develop.svn.wordpress.org/trunk@26169


git-svn-id: http://core.svn.wordpress.org/trunk@26078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-14 18:41:10 +00:00
Sergey Biryukov e64191e739 Change jQuery selector in Quick Edit to avoid losing data in IE8.
fixes #24923 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26123


git-svn-id: http://core.svn.wordpress.org/trunk@26035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-13 04:06:09 +00:00
Andrew Nacin b6d680174d List tables: When executing a search, reset the Bulk Actions dropdown to avoid the search from failing.
props c3mdigital, vinod-dalvi.
fixes #25034.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-03 01:09:10 +00:00
Scott Taylor ea352cde7c Revert [25663] for UX discussion
Built from https://develop.svn.wordpress.org/trunk@25667


git-svn-id: http://core.svn.wordpress.org/trunk@25583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 20:53:09 +00:00
Scott Taylor 0793f55437 When Quick Edit'ing a page, checks if edited page has a new parent and moves the row underneath that one. If the parent doesn't exist on this page then it hides the row altogether.
Props solarissmoke, MikeHansenMe.
Fixes #14188.


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


git-svn-id: http://core.svn.wordpress.org/trunk@25579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 20:38:09 +00:00
Helen Hou-Sandí 2e584b5e09 Allow all non-visible default row actions in the admin to be accessed via keyboard. fixes #21334.
Built from https://develop.svn.wordpress.org/trunk@25595


git-svn-id: http://core.svn.wordpress.org/trunk@25512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 02:50:09 +00:00
Helen Hou-Sandí 185655f89d Allow non-visible post row actions to be accessed via keyboard. props adamsilverstein, lessbloat. fixes #21334.
Built from https://develop.svn.wordpress.org/trunk@25593


git-svn-id: http://core.svn.wordpress.org/trunk@25510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 02:04:10 +00:00
Helen Hou-Sandí 9adfd648a8 Make sure quick edited non-alternate list table rows don't become alternate. props mordauk. fixes #24951.
Built from https://develop.svn.wordpress.org/trunk@25039


git-svn-id: http://core.svn.wordpress.org/trunk@25026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-16 20:19:09 +00:00
Mark Jaquith 5f19c95249 Gracefully slide down the "{Name} is editing" notice portion of the post row, so everything isn't shifting down in an instant and throwing off people's clicks.
fixes #24553. props kadamwhite, johnbillion.

git-svn-id: http://core.svn.wordpress.org/trunk@24576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-05 23:17:25 +00:00
Andrew Ozz 0fff739949 Heartbeat: rename some vars/args to make them more intuitive, don't set user_id on every request, see #23216
git-svn-id: http://core.svn.wordpress.org/trunk@24406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-05 00:13:40 +00:00
Andrew Ozz 4c04bf0012 Post locks: do not check locks on the Posts screen if the list table is empty, see #23697
git-svn-id: http://core.svn.wordpress.org/trunk@24299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-20 04:10:43 +00:00
Andrew Ozz 3b4b058275 Post locks on the posts list screen: new icons for the lock, props empireoflight, show avatar for the user currently editing, props dh-shredder, see #23312
git-svn-id: http://core.svn.wordpress.org/trunk@23681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-13 00:28:07 +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
Helen Hou-Sandí 28f6c5bcf4 Remove the long-broken and questionably useful [more]/[less] toggle for hierarchical taxonomies in Quick/Bulk Edit. Nobody seems to have noticed in the nearly 3 years it's been broken. fixes #23006
git-svn-id: http://core.svn.wordpress.org/trunk@23354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 22:36:15 +00:00