Commit Graph

82 Commits

Author SHA1 Message Date
John Blackbourn
ee96f93558 Administration: Fix a coding standards issue after [49179].
See #50699

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


git-svn-id: http://core.svn.wordpress.org/trunk@48942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 12:34:08 +00:00
Andrew Ozz
59c45c41e4 Fix and improve arranging of postboxes/metaboxes:
- Enable arranging only when the Screen Options tab is open.
- Prevent accidental/unintended dragging. Seen it happen mostly on laptops when using the mousepad/trackpad.
- Improve discoverability and usefulness by always showing the "drop zones" outline when postboxes are draggable/arrangeable.
- Add some (brief) explanation to the Screen Options tab helping the user understand what options are available and how to change them. This is especially helpful for screen reader users to give an idea how to use the screen options and what to expect.
- Fix/enhance some of the code in `postbox.js` and make it coding standards compliant.

See #50699.
Built from https://develop.svn.wordpress.org/trunk@49179


git-svn-id: http://core.svn.wordpress.org/trunk@48941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 10:00:06 +00:00
Andrea Fercia
efdd927b48 Accessibility: Administration: Address backward compatibility concerns for the sortable postboxes areas after [48340].
Fixes #49288.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 13:17:02 +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
Andrea Fercia
c7617838b1 Accessibility: Improve reordering of the post boxes in the block editor meta boxes area.
Follow-up to [48373].
- ignores hidden "sortables" areas 
- hides the reorder buttons when there's only one post box 
- makes the reorder buttons slightly bigger to match the side of the toggle button

Fixes #39074.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-13 18:03:05 +00:00
Andrea Fercia
22d0cd6c96 Accessibility: Allow post boxes on the Dashboard and Classic Editor pages to be reordered by using the keyboard.
So far, it has been possible to rearrange into a new order the post boxes (also known as "widgets" on the Dashboard and "meta boxes" on the Edit post page) only by using a pointing device, for example a mouse.

This change adds new controls and functionality to allow the boxes to be rearranged also with the keyboard. Additionally, audible messages are sent to the admin ARIA live region to notify screen reader users of the reorder action result.

Props joedolson, anevins, antpb, audrasjb, xkon, MarcoZ, karmatosed, afercia.
Fixes #39074.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-07 13:00:02 +00:00
Andrea Fercia
454dab13c1 Accessibility: Administration: Improve the sortable postboxes areas on the Dashboard and Classic Editor pages.
- makes the postboxes areas in the Dashboard visible also on large screens 
- uses a more meaningful text when all postboxes areas are empty instead of "Drag boxes here"
- restores the ability to drag boxes to the "advanced" area in the Classic Editor page
- makes the postboxes areas in the Classic Editor page visible while dragging so that users have a clue what the available areas are
- improves the color contrast of the postboxes areas while dragging
- uses `wp.i18n` for translatable strings in `wp-admin/js/postbox.js`

Props xkon, karmatosed, audrasjb, ocean90, joedolson, afercia, azaozz.
See #20491.
Fixes #49288, #47541.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-06 18:03:02 +00:00
whyisjake
9edf42f215 Administration: Remove unnecessary !important CSS rules from common.css
Fixes #47569.

Props foack, SergeyBiryukov, davidbaumwald, sabernhardt, isabel_brison, audrasjb. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@47898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-23 00:01:07 +00:00
John Blackbourn
da52485cf1 Editor: Revert a fix for incorrect usage of ID attributes on custom fields.
This reverts [47222] due to compatibility issues with plugins which are using the `#poststuff` selector.

See #46964
Built from https://develop.svn.wordpress.org/trunk@47410


git-svn-id: http://core.svn.wordpress.org/trunk@47197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-03-03 00:37:06 +00:00
joedolson
61ce35440c Editor: Fix incorrect usage of ID attributes on custom fields.
Repeated containers used for custom fields have duplicate ID attributes. Duplicate IDs are incorrect HTML, and will also cause unexpected results when trying to manipulate using JS. Duplicate IDs are changed to matching classes; CSS & JS updated to match. 

Props jankimoradiya, audrasjb, donmhico, afercia.
Fixes #46964.

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


git-svn-id: http://core.svn.wordpress.org/trunk@47022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 19:41:07 +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
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
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
Sergey Biryukov
78138cd2c7 Docs: Add documentation for wp-admin/js/postbox.js.
Props atimmer, andizer.
Fixes #37365.
Built from https://develop.svn.wordpress.org/trunk@38643


git-svn-id: http://core.svn.wordpress.org/trunk@38586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 18:47:31 +00:00
Andrew Ozz
5cdb444009 Editor, editor-expand: adjust the sidebar position when moving a postbox from one column to another.
Fixes #35230.
Built from https://develop.svn.wordpress.org/trunk@37659


git-svn-id: http://core.svn.wordpress.org/trunk@37625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-08 22:37:29 +00:00
Sergey Biryukov
c55e4194f8 Docs: Fix typo in a comment in wp-admin/js/postbox.js.
Props yoavf.
Fixes #36349.
Built from https://develop.svn.wordpress.org/trunk@37195


git-svn-id: http://core.svn.wordpress.org/trunk@37161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-13 07:29:27 +00:00
Pascal Birchler
08693cd206 Administration: After [36295], mark postBoxL10n as a global to please JSHint.
See #26399.
Built from https://develop.svn.wordpress.org/trunk@36296


git-svn-id: http://core.svn.wordpress.org/trunk@36263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-14 08:40:26 +00:00
John Blackbourn
9ae1736d01 Administration: Add a "Drag boxes here" message to empty dashboard meta boxes so it's clear to users that it's possible to drag meta boxes into empty spaces.
Props xavortm
Fixes #26399

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


git-svn-id: http://core.svn.wordpress.org/trunk@36262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-14 04:13:26 +00:00
Andrea Fercia
f13881d4e3 Admin: Restore the "Show advanced menu properties" checkboxes IDs.
These checkboxes are used on the Menus screen options and the Customizer Menus options.
Their IDs were removed in [34991] but they're needed to get the checkboxes to be saved
via AJAX. Also, avoids a useless AJAX call.

Fixes #35112 for trunk.
Built from https://develop.svn.wordpress.org/trunk@36137


git-svn-id: http://core.svn.wordpress.org/trunk@36103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-31 11:52:26 +00:00
Michael Adams
699c377856 Meta Boxes: Preserve radio inputs' state when sorting metaboxes.
When sorting a metabox, a clone of that metabox is created as a drag/drop "helper".
Previously, any checked radio input in the original metabox would become unchecked, when its clone "helper" was inserted into the DOM
(since only one radio within a set of radios of the same name can be checked).

Continued use of the clone helper is important so that the element being dragged isn't subject to the click and other event handlers attached to the real metabox,
so we can't just switch to dragging around the real metabox.  See, for example, comment:10:ticket:16972.

Preserve the radios' state via some name attribute trickery.

Fixes #16972

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


git-svn-id: http://core.svn.wordpress.org/trunk@35773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 22:23:49 +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
Scott Taylor
2783773775 Meta Boxes: reboot some of the code in postbox.js to support aria-expanded attribute toggling and to properly reference static class properties.
Props afercia, wonderboymusic.
Fixes #33754.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 01:58:25 +00:00
Sergey Biryukov
fc9961ca22 Make post meta box toggles accessible.
props joedolson.
fixes #33544.
Built from https://develop.svn.wordpress.org/trunk@33762


git-svn-id: http://core.svn.wordpress.org/trunk@33730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 15:23:24 +00:00
Andrew Ozz
68a3e1af2c Editor scrolling: set max-width: 100% for the text editor clone instead of always resizing it. See #29246.
Built from https://develop.svn.wordpress.org/trunk@29524


git-svn-id: http://core.svn.wordpress.org/trunk@29300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-18 01:13:16 +00:00
Andrew Ozz
bae4afab44 Editor scrolling:
- Properly handle change of sidebar height when opening, closing or hiding postboxes.
- Add a flag when to start pinning. Set it to few pixels more than the initial editor height.
See #28328
Built from https://develop.svn.wordpress.org/trunk@29523


git-svn-id: http://core.svn.wordpress.org/trunk@29299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-18 00:35:18 +00:00
Andrew Ozz
5e4a020ff8 Enhance the editor on the Add/Edit Post screens, first run. Props avril, see #28328.
Built from https://develop.svn.wordpress.org/trunk@29049


git-svn-id: http://core.svn.wordpress.org/trunk@28837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-09 22:06:15 +00:00
Helen Hou-Sandí
38e5e13b1f Only apply metabox handle styles and JS events to .postbox .hndle, as opposed to all h3s in a .postbox.
Developers previously relying on the `h3` behavior may be affected. You may want to investigate `do_meta_boxes()` rather than recreating markup.

props SergeyBiryukov, nabil_kadimi.
fixes #28485.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-01 16:23:15 +00:00
Andrew Ozz
3bdfaafaa0 Fix error in postbox.js attempting to change screen columns on mobile devices orientation changes, fixes #26493.
Built from https://develop.svn.wordpress.org/trunk@26822


git-svn-id: http://core.svn.wordpress.org/trunk@26709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-09 04:21:10 +00:00
Andrew Nacin
c962236312 Fix JSHint errors in postbox.js.
props atimmer.
fixes #26006.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-14 18:10:09 +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
12e243bda4 Compress scripts/styles: 3.5-alpha-21092.
git-svn-id: http://core.svn.wordpress.org/trunk@21092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-20 15:58:25 +00:00
bumpbot
a9263fe649 Compress scripts/styles: 3.4-beta3-20678.
git-svn-id: http://core.svn.wordpress.org/trunk@20678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-01 22:58:23 +00:00
bumpbot
2dfc4aa101 Compress scripts/styles: 3.4-beta3-20620.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-27 18:58:22 +00:00
bumpbot
b15a9dde67 Compress scripts/styles: 3.4-beta1-20418.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-10 01:58:27 +00:00
bumpbot
7dd14bbd09 Compress scripts/styles: 3.4-alpha-20294.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-28 02:58:21 +00:00
bumpbot
6879033b3a Compress scripts/styles: 3.4-alpha-20273.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-23 21:58:28 +00:00
azaozz
f85e0b3f00 Make iPad support usable again, add viewport meta, see #18863
git-svn-id: http://svn.automattic.com/wordpress/trunk@18926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-10 04:19:05 +00:00
azaozz
1050e0023a Add/remove the border to postbox containers when the last postbox is hidden/shown from Screen Options, props ocean90, fixes #18882
git-svn-id: http://svn.automattic.com/wordpress/trunk@18925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-09 17:30:51 +00:00
azaozz
c86787bbd3 Fix postbox containers when there are no visible postboxes in them, fixes #18882
git-svn-id: http://svn.automattic.com/wordpress/trunk@18924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-09 00:05:38 +00:00
azaozz
53ac6d4a37 Clean up unused bits from responsive admin, fix the JS on dashboard, see #18863
git-svn-id: http://svn.automattic.com/wordpress/trunk@18900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-06 08:43:01 +00:00
azaozz
ffca93b1f2 Responsive admin improvements for the dashboard, new/write screens and links screens, see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-21 06:16:24 +00:00
azaozz
f6b2da9388 The rest of add missing var in postbox.js, see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-16 23:28:40 +00:00
azaozz
debc12b386 Auto-column switching for the dashboard (js based), see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-14 07:02:46 +00:00
azaozz
63969dbca7 Toggle class 'responsive' on div.wrap when auto columns is toggled, see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-30 23:18:18 +00:00
azaozz
7865d5c451 Disable js moving of dashboard postboxes, add all of them in the first column on 'auto', see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-30 22:29:37 +00:00
azaozz
4e323dd08f Improve auto column switching for post.php, see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-25 22:55:39 +00:00
azaozz
f3f79602b9 Auto column switching for the dashboard, see #18198
git-svn-id: http://svn.automattic.com/wordpress/trunk@18582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-23 04:00:56 +00:00