WordPress/wp-includes/customize
Weston Ruter 90bedf8f9d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 06:08:47 +00:00
..
class-wp-customize-background-image-control.php Customize: Improve custom background properties UI. 2016-10-26 06:52:29 +00:00
class-wp-customize-background-image-setting.php Customize: move `WP_Customize_Section` subclasses to `wp-includes/customize`, they load in the exact same place. 2015-10-24 18:21:25 +00:00
class-wp-customize-background-position-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-color-control.php Accessibility: Improve the color picker UI accessibility, interaction, and generated markup. 2017-09-03 16:02:46 +00:00
class-wp-customize-cropped-image-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-custom-css-setting.php Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion. 2017-09-13 06:08:47 +00:00
class-wp-customize-filter-setting.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-header-image-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-header-image-setting.php Customize: Reuse existing non-auto-draft posts and existing auto-draft posts in the customized state with matching slugs when applying starter content. 2016-12-02 00:25:41 +00:00
class-wp-customize-image-control.php Docs: Explicitly deprecate the `add_tab()`, `remove_tab()`, and `print_tab_image()` methods for `WP_Customize_Image_Control`, originally soft-deprecated in 4.1. 2017-08-20 03:38:46 +00:00
class-wp-customize-media-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-auto-add-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-item-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-item-setting.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-location-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-name-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-section.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menu-setting.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-nav-menus-panel.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-new-menu-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-new-menu-section.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-partial.php Docs: Remove "since since" and "one one" dittography from inline comments. 2017-09-09 13:53:42 +00:00
class-wp-customize-selective-refresh.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-sidebar-section.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-site-icon-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-theme-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-themes-section.php Customize: Add rightward-facing back button to Themes section header to improve navigation (since the section slides in from the left). 2017-09-11 05:23:48 +00:00
class-wp-customize-upload-control.php Customize: move `WP_Customize_Control` subclasses to `wp-includes/customize`, they load in the exact same place. 2015-10-24 18:57:25 +00:00
class-wp-widget-area-customize-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-widget-form-customize-control.php Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00