PluginProbe
CryptX / 4.1.1
CryptX v4.1.1
4.2.0 4.1.1 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.9 2.0 2.1 2.2 2.3 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 All 92 releases
cryptx / src / index.js

index.js in CryptX 4.1.1, at src/index.js

35 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * The CryptX settings screen.
3 *
4 * Everything this file knows about the options comes from the schema the REST
5 * route hands over. Adding an option means adding it to SettingsSchema.php --
6 * there is deliberately no second list of fields here that could fall behind.
7 */
8
9 import { createRoot, StrictMode } from '@wordpress/element';
10 import { __ } from '@wordpress/i18n';
11
12 import App from './components/App';
13 import './index.css';
14
15 document.addEventListener( 'DOMContentLoaded', () => {
16 const container = document.getElementById( 'cryptx-settings-root' );
17
18 if ( ! container ) {
19 return;
20 }
21
22 // The container carries the "loading" fallback that PHP printed. Clearing
23 // it here rather than in PHP means the fallback stays visible for people
24 // whose browser never gets this far.
25 container.textContent = '';
26 container.setAttribute( 'aria-busy', 'false' );
27 container.setAttribute( 'aria-label', __( 'CryptX settings', 'cryptx' ) );
28
29 createRoot( container ).render(
30 <StrictMode>
31 <App />
32 </StrictMode>
33 );
34 } );
35