wordpress-develop/tests/phpunit/tests/customize
Weston Ruter dbace684e2 Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion.
* Code editor is integrated into the Theme/Plugin Editor, Additional CSS in Customizer, and Custom HTML widget. Code editor is not yet integrated into the post editor, and it may not be until accessibility concerns are addressed.
* The CodeMirror component in the Custom HTML widget is integrated in a similar way to TinyMCE being integrated into the Text widget, adopting the same approach for integrating dynamic JavaScript-initialized fields.
* Linting is performed for JS, CSS, HTML, and JSON via JSHint, CSSLint, HTMLHint, and JSONLint respectively. Linting is not yet supported for PHP.
* When user lacks `unfiltered_html` the capability, the Custom HTML widget will report any Kses-invalid elements and attributes as errors via a custom Kses rule for HTMLHint.
* When linting errors are detected, the user will be prevented from saving the code until the errors are fixed, reducing instances of broken websites.
* The placeholder value is removed from Custom CSS in favor of a fleshed-out section description which now auto-expands when the CSS field is empty. See #39892.
* The CodeMirror library is included as `wp.CodeMirror` to prevent conflicts with any existing `CodeMirror` global.
* An `wp.codeEditor.initialize()` API in JS is provided to convert a `textarea` into CodeMirror, with a `wp_enqueue_code_editor()` function in PHP to manage enqueueing the assets and settings needed to edit a given type of code.
* A user preference is added to manage whether or not "syntax highlighting" is enabled. The feature is opt-out, being enabled by default.
* Allowed file extensions in the theme and plugin editors have been updated to include formats which CodeMirror has modes for: `conf`, `css`, `diff`, `patch`, `html`, `htm`, `http`, `js`, `json`, `jsx`, `less`, `md`, `php`, `phtml`, `php3`, `php4`, `php5`, `php7`, `phps`, `scss`, `sass`, `sh`, `bash`, `sql`, `svg`, `xml`, `yml`, `yaml`, `txt`.

Props westonruter, georgestephanis, obenland, melchoyce, pixolin, mizejewski, michelleweber, afercia, grahamarmfield, samikeijonen, rianrietveld, iseulde.
See #38707.
Fixes #12423, #39892.


git-svn-id: https://develop.svn.wordpress.org/trunk@41376 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-13 06:07:48 +00:00
..
control.php Customize: Allow page stubs to be created via dropdown-pages controls in the Static Front Page section. 2016-10-25 06:30:27 +00:00
custom-css-setting.php Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion. 2017-09-13 06:07:48 +00:00
manager.php Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion. 2017-09-13 06:07:48 +00:00
nav-menu-item-setting.php Customize: Fix handling of the nav menu item labels (titles) that match defaults (original titles) and fix the display of item type labels. 2016-11-30 23:35:34 +00:00
nav-menu-setting.php Tests: Use a minimal theme for tests. 2016-10-21 11:02:37 +00:00
nav-menus.php Customize: For selective refresh of nav menus, prevent preg_replace() from dropping backslashes in JSON replaced into the data-customize-partial-placement-context HTML attribute. 2017-08-02 05:10:05 +00:00
panel.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
partial.php Tests: Use a minimal theme for tests. 2016-10-21 11:02:37 +00:00
section.php Unit Tests: 2016-08-27 08:35:16 +00:00
selective-refresh-ajax.php Build/Test tools: Remove usage of DOING_AJAX from the test suite, so all tests that expect either an Ajax request or a 2017-08-22 15:07:42 +00:00
selective-refresh.php Tests: Use a minimal theme for tests. 2016-10-21 11:02:37 +00:00
setting.php Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
widgets.php Customize: Fix phpunit tests after [40704] due to logic inversion error. 2017-05-16 14:33:16 +00:00