PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
← All changes | includes/render/shell.php +38 -22 0.9.81.1.10 View file →
@@ -1,17 +1,18 @@
1 1 <?php
2 2 /**
3 - * Desktop Mode — Shell markup injection.
3 + * OpenStation — Shell markup injection.
4 4 *
5 - * Emits the `<div id="desktop-mode-shell">…</div>` skeleton at
6 - * `in_admin_header @ 5`. The shell floats on top of the classic
7 - * admin via `position: fixed`; the body class added by
8 - * `body-classes.php` triggers the CSS that hides classic chrome.
5 + * Emits the `<div id="os-shell">…</div>` skeleton at
6 + * `in_admin_header @ 5` on the shell screen (`includes/shell-screen.php`).
7 + * The shell floats on top of the admin document via `position: fixed`;
8 + * the body class added by `body-classes.php` triggers the CSS that
9 + * hides classic chrome.
9 10 *
10 11 * Extracted from `render.php` during the architecture-0.8.1 PHP
11 12 * slicing (phase 6).
12 13 *
13 - * @package Desktop_Mode
14 + * @package OpenStation
14 15 */
15 16
16 17 defined( 'ABSPATH' ) || exit;
17 18
@@ -21,13 +22,13 @@
21 22 *
22 23 * Runs on `in_admin_header` at priority 5 so the shell renders right
23 24 * after the classic admin bar but before the page content. The shell
24 25 * floats above the classic layout via `position: fixed` in CSS; the
25 - * classic sidebar, body, and footer are hidden with `body.desktop-mode-active`
26 + * classic sidebar, body, and footer are hidden with `body.os-active`
26 27 * selectors.
27 28 */
28 -function desktop_mode_render_shell() {
29 - if ( desktop_mode_is_chromeless_request() || ! desktop_mode_is_enabled() || desktop_mode_is_classic_request() ) {
29 +function openstation_render_shell() {
30 + if ( ! openstation_is_shell_request() ) {
30 31 return;
31 32 }
32 33
33 34 /**
@@ -32,9 +33,9 @@
32 33
33 34 /**
34 35 * Fires right before the desktop shell markup is rendered.
35 36 */
36 - do_action( 'desktop_mode_shell_before' );
37 + do_action( 'openstation_shell_before' );
37 38
38 39 // Stamp the user's admin color scheme onto the shell root so the
39 40 // variables.css per-scheme selectors kick in before first paint —
40 41 // doing this from JS on init() would show the default palette for a
@@ -46,13 +47,19 @@
46 47 // server-side means the first paint is already themed. Setting
47 48 // it from `applyDesktopTheme()` on boot would flash the default
48 49 // palette for a frame. Empty string when the user is on the
49 50 // system default (and nothing else about themes runs at all).
50 - $desktop_theme = function_exists( 'desktop_mode_active_desktop_theme_slug' )
51 - ? desktop_mode_active_desktop_theme_slug()
51 + $desktop_theme = function_exists( 'openstation_active_desktop_theme_slug' )
52 + ? openstation_active_desktop_theme_slug()
52 53 : '';
54 +
55 + // A shell asked to boot into overview (a switch from another site's
56 + // switcher) arrives with its desk hidden until overview is up, so the
57 + // desk slides in as one piece instead of the bare desk flashing first.
58 + // See `src/multisite/instance-transition.ts`.
59 + $arriving = openstation_shell_lands_in_overview() ? ' os-shell--arriving' : '';
53 60 ?>
54 - <div id="desktop-mode-shell" class="desktop-mode-shell" data-desktop-mode-scheme="<?php echo esc_attr( $scheme ); ?>"<?php echo '' !== $desktop_theme ? ' data-desktop-mode-desktop-theme="' . esc_attr( $desktop_theme ) . '"' : ''; ?> role="application" aria-label="<?php esc_attr_e( 'Desktop shell', 'desktop-mode' ); ?>">
61 + <div id="os-shell" class="os-shell<?php echo esc_attr( $arriving ); ?>" data-os-scheme="<?php echo esc_attr( $scheme ); ?>"<?php echo '' !== $desktop_theme ? ' data-os-desktop-theme="' . esc_attr( $desktop_theme ) . '"' : ''; ?> role="application" aria-label="<?php esc_attr_e( 'Desktop shell', 'desktop-mode' ); ?>">
55 62 <?php
56 63 /*
57 64 * Wallpaper layer — sits behind both the dock and the desktop
58 65 * area so a translucent dock bleeds through to the wallpaper
@@ -57,21 +64,30 @@
57 64 * Wallpaper layer — sits behind both the dock and the desktop
58 65 * area so a translucent dock bleeds through to the wallpaper
59 66 * (macOS pattern). Canvas-driven wallpapers mount their own
60 67 * DOM into this element; static CSS wallpapers just inherit
61 - * the `--desktop-mode-bg` custom property the shell sets at
68 + * the `--os-bg` custom property the shell sets at
62 69 * boot. Presentational only.
63 70 */
64 71 ?>
65 - <div id="desktop-mode-wallpaper" class="desktop-mode-wallpaper" aria-hidden="true"></div>
66 - <div class="desktop-mode-shell__body">
67 - <nav id="desktop-mode-dock" class="desktop-mode-dock" role="toolbar" aria-label="<?php esc_attr_e( 'Admin navigation', 'desktop-mode' ); ?>"></nav>
68 - <div id="desktop-mode-area" class="desktop-mode-area desktop-mode-area--with-dock desktop-mode-area--booting">
72 + <div id="os-wallpaper" class="os-wallpaper" aria-hidden="true"></div>
73 + <div class="os-shell__body">
74 + <?php
75 + /*
76 + * `data-os-dock-behavior` is stamped here, not only by the
77 + * shell's apply pass, so a `dynamic` dock is folded from the
78 + * first paint instead of flashing on screen and folding once
79 + * the JS lands. The Split layout's sidebar is synthesised by
80 + * JS and stamped there.
81 + */
82 + ?>
83 + <nav id="os-dock" class="os-dock" role="toolbar" aria-label="<?php esc_attr_e( 'Admin navigation', 'desktop-mode' ); ?>" data-os-dock-behavior="<?php echo esc_attr( openstation_get_dock_behavior() ); ?>"></nav>
84 + <div id="os-area" class="os-area os-area--with-dock os-area--booting">
69 85 <?php
70 86 /*
71 87 * Widget column — paints above the wallpaper but
72 88 * beneath windows (z-index 1 vs. windows at 100+).
73 - * Hosted INSIDE `.desktop-mode-area` so scrolling the
89 + * Hosted INSIDE `.os-area` so scrolling the
74 90 * area (not that we do today) would scroll widgets
75 91 * with it, and so the dock naturally frames
76 92 * it. Empty on first render — JS (`WidgetLayer`)
77 93 * populates it on boot.
@@ -76,9 +92,9 @@
76 92 * it. Empty on first render — JS (`WidgetLayer`)
77 93 * populates it on boot.
78 94 */
79 95 ?>
80 - <aside id="desktop-mode-widgets" class="desktop-mode-widgets" aria-label="<?php esc_attr_e( 'Widgets', 'desktop-mode' ); ?>"></aside>
96 + <aside id="os-widgets" class="os-widgets" aria-label="<?php esc_attr_e( 'Widgets', 'desktop-mode' ); ?>"></aside>
81 97 </div>
82 98 </div>
83 99 </div>
84 100 <?php
@@ -84,8 +100,8 @@
84 100 <?php
85 101 /**
86 102 * Fires right after the desktop shell markup has rendered.
87 103 */
88 - do_action( 'desktop_mode_shell_after' );
104 + do_action( 'openstation_shell_after' );
89 105 }
90 -add_action( 'in_admin_header', 'desktop_mode_render_shell', 5 );
106 +add_action( 'in_admin_header', 'openstation_render_shell', 5 );
91 107