Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
45886c7
Script Loader: Restore the admin easter egg behind the command palette.
adamsilverstein Aug 18, 2026
a27c5b5
Script Loader: Fix overlay coverage, accessibility, and ending of the…
adamsilverstein Aug 18, 2026
a686785
Script Loader: Use single quotes for the easter egg closing line.
adamsilverstein Aug 18, 2026
9597553
Script Loader: Trigger the easter egg without listing a command.
adamsilverstein Aug 18, 2026
b2150a3
Script Loader: Rename the easter egg files to teletype.
adamsilverstein Aug 18, 2026
182a994
Script Loader: Correct the easter egg's provenance and cipher its dia…
adamsilverstein Aug 21, 2026
bbd8f3a
Script Loader: Trim the easter egg's inline commentary.
adamsilverstein Aug 21, 2026
5230403
Script Loader: Soften the easter egg's dialogue and let it exit on it…
adamsilverstein Aug 22, 2026
3517a62
Script Loader: Only claim Enter when the command palette found nothing.
adamsilverstein Aug 22, 2026
f7bcded
Script Loader: Add the falling glyph rain to the easter egg's Matrix …
adamsilverstein Aug 22, 2026
57e9174
Script Loader: Give the easter egg to screen reader users too.
adamsilverstein Aug 22, 2026
7ba8542
Merge branch 'trunk' into 65907-restore-easter-egg
adamsilverstein Sep 22, 2026
3121e0f
Administration: Translate the easter egg's dialog label and Exit button.
adamsilverstein Sep 22, 2026
1f10f8f
Administration: Make the teletype loader's comment less revealing.
adamsilverstein Sep 23, 2026
8b28dcb
Administration: Shorten the teletype dialog's accessible label.
adamsilverstein Sep 23, 2026
4d4d44d
Administration: Make the teletype's inline comments less revealing.
adamsilverstein Sep 23, 2026
ce721d4
Merge branch 'trunk' into 65907-restore-easter-egg
adamsilverstein Sep 23, 2026
0073796
Merge branch 'trunk' into 65907-restore-easter-egg
peterwilsoncc Sep 29, 2026
56eb699
Move styles to HEREDOC for IDE highlighting.
peterwilsoncc Sep 30, 2026
f3aab92
Docblocks.
peterwilsoncc Sep 30, 2026
2257da9
CS: Fix undefined variable.
peterwilsoncc Sep 30, 2026
2cb7511
IIFE dockblock.
peterwilsoncc Sep 30, 2026
0f06f20
JavaScript is JavaScript, not CSS.
peterwilsoncc Sep 30, 2026
e44de84
Use unmodifed .
peterwilsoncc Sep 30, 2026
3e5334e
Merge branch 'trunk' into 65907-restore-easter-egg
peterwilsoncc Sep 30, 2026
dc20329
`$wp_version` now used in script loader three times.
peterwilsoncc Sep 30, 2026
d3b962f
Merge branch 'trunk' into 65907-restore-easter-egg
adamsilverstein Oct 20, 2026
12154fd
Administration: Tighten the teletype doc blocks.
adamsilverstein Oct 20, 2026
c743895
Administration: Tidy the teletype styles.
adamsilverstein Oct 20, 2026
303769b
Administration: Make the teletype strings translatable.
adamsilverstein Oct 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ module.exports = function(grunt) {
[ WORKING_DIR + 'wp-admin/js/common.js' ]: [ './src/js/_enqueues/admin/common.js' ],
[ WORKING_DIR + 'wp-admin/js/custom-background.js' ]: [ './src/js/_enqueues/admin/custom-background.js' ],
[ WORKING_DIR + 'wp-admin/js/custom-header.js' ]: [ './src/js/_enqueues/admin/custom-header.js' ],
[ WORKING_DIR + 'wp-admin/js/teletype.js' ]: [ './src/js/_enqueues/admin/teletype.js' ],
[ WORKING_DIR + 'wp-admin/js/teletype-loader.js' ]: [ './src/js/_enqueues/admin/teletype-loader.js' ],
[ WORKING_DIR + 'wp-admin/js/customize-controls.js' ]: [ './src/js/_enqueues/wp/customize/controls.js' ],
[ WORKING_DIR + 'wp-admin/js/customize-nav-menus.js' ]: [ './src/js/_enqueues/wp/customize/nav-menus.js' ],
[ WORKING_DIR + 'wp-admin/js/customize-widgets.js' ]: [ './src/js/_enqueues/wp/customize/widgets.js' ],
Expand Down
97 changes: 97 additions & 0 deletions src/js/_enqueues/admin/teletype-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* Listens to the command palette for the teletype.
*
* @output wp-admin/js/teletype-loader.js
*/

/**
* Watches Enter in the command palette and loads the teletype on a match.
*
* @param {Object} wp The global WordPress JS object.
* @param {Object} settings Settings printed by wp_enqueue_command_palette_assets().
*/
( function ( wp, settings ) {
'use strict';

if ( ! wp || ! wp.data || ! settings || ! settings.i18n ) {
return;
}

/**
* Lowercases text and strips its whitespace and punctuation.
*
* @param {string} value Text to normalize.
* @return {string} Normalized text.
*/
function normalize( value ) {
return value.toLowerCase().replace( /[\s!-\/:-@\[-`{-~\u3000-\u303f\uff01-\uff0f]/g, '' );
}

var trigger = normalize( settings.i18n.trigger || '' );

/**
* Loads the teletype if needed, then runs it.
*/
function play() {
var script;

if ( wp.teletype ) {
wp.teletype.run( settings.name, settings.i18n );
return;
}

script = document.createElement( 'script' );
script.src = settings.src;

script.onload = function () {
if ( wp.teletype ) {
wp.teletype.run( settings.name, settings.i18n );
}
};

document.head.appendChild( script );
}

/**
* Handles Enter in an open command palette.
*
* @param {KeyboardEvent} event The keydown event.
*/
function onKeydown( event ) {
var store,
input = event.target,
value;

if ( 'Enter' !== event.key || ! input || ! input.value ) {
return;
}

store = wp.data.select( 'core/commands' );

if ( ! store || ! store.isOpen() ) {
return;
}

// Leave Enter to the palette whenever one of its results is active.
if (
'combobox' !== input.getAttribute( 'role' ) ||
input.getAttribute( 'aria-activedescendant' )
) {
return;
}

value = normalize( input.value );

if ( ! value || value !== trigger ) {
return;
}

event.preventDefault();
event.stopPropagation();

wp.data.dispatch( 'core/commands' ).close();
play();
}

document.addEventListener( 'keydown', onKeydown, true );
}( window.wp, window.wpTeletype ) );
Loading
Loading