Server IP : 149.255.58.128 / Your IP : 216.73.216.75
System : Linux cloud516.thundercloud.uk 5.14.0-427.26.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 17 15:51:13 EDT 2024 x86_64
PHP Version : 8.2.28
Disable Function : allow_url_include, apache_child_terminate, apache_setenv, exec, passthru, pcntl_exec, posix_kill, posix_mkfifo, posix_getpwuid, posix_setpgid, posix_setsid, posix_setuid, posix_setgid, posix_seteuid, posix_setegid, posix_uname, proc_close, proc_get_status, proc_open, proc_terminate, shell_exec, show_source, system
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Upload Files :
Command :
Current File : /home/wheelch2/public_html/wp-content/themes/twentytwentyone/assets/js//editor-dark-mode-support.js
/* global twentytwentyoneIsDarkMode, setTimeout */
// Check the color scheme preference and inject the classes if necessary.
if ( document.body.classList.contains( 'twentytwentyone-supports-dark-theme' ) ) {
twentytwentyoneDarkModeEditorInit();
}
/**
* Once the editor loads, add the dark mode class.
*
* Wait for the editor to load by periodically checking for an element, then we add the classes.
*
* @since Twenty Twenty-One 1.0
*
* @param {number} attempt Track the number of tries
* @return {void}
*/
function twentytwentyoneDarkModeEditorInit( attempt ) {
var container = document.querySelector( '.block-editor__typewriter' ),
maxAttempts = 8;
// Set the initial attempt if it's undefined.
attempt = attempt || 0;
if ( twentytwentyoneIsDarkMode() ) {
if ( null === container ) {
// Try again.
if ( attempt < maxAttempts ) {
setTimeout(
function() {
twentytwentyoneDarkModeEditorInit( attempt + 1 );
},
// Double the delay, give the server some time to breathe.
25 * Math.pow( 2, attempt )
);
}
return;
}
document.body.classList.add( 'is-dark-theme' );
document.documentElement.classList.add( 'is-dark-theme' );
container.classList.add( 'is-dark-theme' );
}
}