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/desktop-themes/compile.php +26 -26 0.9.81.1.10 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 - * Desktop Mode — Desktop-theme CSS compiler.
3 + * OpenStation — Desktop-theme CSS compiler.
4 4 *
5 5 * Turns a **sanitized** manifest into a stylesheet made of custom-
6 6 * property declarations plus, when the theme bundles fonts, a block
7 7 * of `@font-face` rules. No author string ever becomes a selector,
@@ -16,9 +16,9 @@
16 16 * author contributes two constrained substrings — a family name
17 17 * matching `^[A-Za-z0-9][A-Za-z0-9 _-]{0,63}$` (so double-quoting it
18 18 * is airtight) and a file path that already passed the font-extension
19 19 * allowlist and a containment check. Everything else is a closed
20 - * enum. See `desktop_mode_sanitize_desktop_theme_fonts()`.
20 + * enum. See `openstation_sanitize_desktop_theme_fonts()`.
21 21 *
22 22 * `@font-face` is deliberately NOT scoped to the theme's selector —
23 23 * at-rules cannot be nested inside one, and there is nothing to
24 24 * scope: a face that nothing references costs a name in a table and
@@ -26,9 +26,9 @@
26 26 *
27 27 * ## Textures are table-driven
28 28 *
29 29 * The slot => custom-property mapping lives in
30 - * {@see desktop_mode_desktop_theme_texture_slots()}, not here. This
30 + * {@see openstation_desktop_theme_texture_slots()}, not here. This
31 31 * file knows how to turn `image` and `border-image` descriptors into
32 32 * declarations; it does not know that `TITLEBAR` exists. That is what
33 33 * lets a plugin texture a surface the framework has never heard of.
34 34 *
@@ -35,14 +35,14 @@
35 35 * ## Why the selector is doubled
36 36 *
37 37 * Output is scoped to BOTH:
38 38 *
39 - * .desktop-mode-shell[data-desktop-mode-desktop-theme="<slug>"]
40 - * body.desktop-mode-desktop-theme-<slug>
39 + * .os-shell[data-os-desktop-theme="<slug>"]
40 + * body.os-desktop-theme-<slug>
41 41 *
42 42 * The shell root covers the desktop, dock, and every window. But
43 43 * toasts, confirm dialogs, tooltips, and context menus mount on
44 - * `document.body`, OUTSIDE `#desktop-mode-shell` — a shell-only
44 + * `document.body`, OUTSIDE `#os-shell` — a shell-only
45 45 * scope would leave those surfaces on the default palette while
46 46 * everything around them reskinned.
47 47 *
48 48 * ## Why the dependency chain matters
@@ -48,17 +48,17 @@
48 48 * ## Why the dependency chain matters
49 49 *
50 50 * Both selectors weigh (0,2,0) — the same specificity as the
51 51 * per-admin-color-scheme blocks in `variables.css`
52 - * (`.desktop-mode-shell[data-desktop-mode-scheme="…"]`). A
52 + * (`.os-shell[data-os-scheme="…"]`). A
53 53 * specificity tie is broken by source order, so the compiled theme
54 54 * sheet MUST print after `variables.css`. That is enforced by
55 - * registering the style handle with `desktop-mode-variables` as a
56 - * dependency (see `desktop_mode_enqueue_desktop_theme_style()`);
55 + * registering the style handle with `os-variables` as a
56 + * dependency (see `openstation_enqueue_desktop_theme_style()`);
57 57 * do not remove that dependency, and do not "simplify" the selector
58 58 * to a single class — it would lose the tie.
59 59 *
60 - * @package WPDesktopMode
60 + * @package OpenStation
61 61 */
62 62
63 63 defined( 'ABSPATH' ) || exit;
64 64
@@ -92,9 +92,9 @@
92 92 * @param string $version Cache-buster for relative refs (the theme's
93 93 * `installedAt`). Omit to skip versioning.
94 94 * @return string Absolute URL, or `''` when unusable.
95 95 */
96 -function desktop_mode_desktop_theme_asset_url( $ref, $base_url, $version = '' ) {
96 +function openstation_desktop_theme_asset_url( $ref, $base_url, $version = '' ) {
97 97 $ref = (string) $ref;
98 98 if ( '' === $ref ) {
99 99 return '';
100 100 }
@@ -118,9 +118,9 @@
118 118 *
119 119 * @param string $url Absolute URL.
120 120 * @return string
121 121 */
122 -function desktop_mode_desktop_theme_css_url( $url ) {
122 +function openstation_desktop_theme_css_url( $url ) {
123 123 return 'url("' . $url . '")';
124 124 }
125 125
126 126 /**
@@ -133,9 +133,9 @@
133 133 * because for `unicodeRange`-subsetted faces of one family that
134 134 * order is semantic.
135 135 *
136 136 * @param array $manifest Sanitized manifest from
137 - * {@see desktop_mode_sanitize_desktop_theme_manifest()}.
137 + * {@see openstation_sanitize_desktop_theme_manifest()}.
138 138 * @param string $slug Storage slug.
139 139 * @param string $base_url Theme base URL (no trailing slash). May be
140 140 * empty for code themes whose assets are
141 141 * absolute URLs.
@@ -140,15 +140,15 @@
140 140 * empty for code themes whose assets are
141 141 * absolute URLs.
142 142 * @param string $version Cache-buster appended to generated asset
143 143 * URLs — see
144 - * {@see desktop_mode_desktop_theme_asset_url()}.
144 + * {@see openstation_desktop_theme_asset_url()}.
145 145 * The stylesheet itself is versioned by the
146 146 * enqueue, but the textures it references are
147 147 * not, and a re-upload must invalidate both.
148 148 * @return string Stylesheet text. `''` when the theme sets nothing.
149 149 */
150 -function desktop_mode_desktop_theme_compile_css( $manifest, $slug, $base_url = '', $version = '' ) {
150 +function openstation_desktop_theme_compile_css( $manifest, $slug, $base_url = '', $version = '' ) {
151 151 $slug = sanitize_key( (string) $slug );
152 152 if ( '' === $slug || ! is_array( $manifest ) ) {
153 153 return '';
154 154 }
@@ -169,9 +169,9 @@
169 169 ? $manifest['textures']
170 170 : array();
171 171 ksort( $textures );
172 172
173 - $slots = desktop_mode_desktop_theme_texture_slots();
173 + $slots = openstation_desktop_theme_texture_slots();
174 174 // Slots that share one size token (the four window corners).
175 175 // First declared wins; `ksort` above makes "first" deterministic.
176 176 $size_groups = array();
177 177
@@ -185,13 +185,13 @@
185 185 // A slot the allowlist accepts but gives no property to
186 186 // write. Nothing to emit — see the filter docblock.
187 187 continue;
188 188 }
189 - $url = desktop_mode_desktop_theme_asset_url( $entry['path'], $base_url, $version );
189 + $url = openstation_desktop_theme_asset_url( $entry['path'], $base_url, $version );
190 190 if ( '' === $url ) {
191 191 continue;
192 192 }
193 - $css_url = desktop_mode_desktop_theme_css_url( $url );
193 + $css_url = openstation_desktop_theme_css_url( $url );
194 194 $type = isset( $definition['type'] ) ? (string) $definition['type'] : 'image';
195 195
196 196 if ( 'border-image' === $type ) {
197 197 $declarations[] = "\t{$prop}-source: {$css_url};";
@@ -232,14 +232,14 @@
232 232 foreach ( $size_groups as $property => $value ) {
233 233 $declarations[] = "\t{$property}: {$value};";
234 234 }
235 235
236 - $font_faces = desktop_mode_desktop_theme_compile_font_faces( $manifest, $base_url, $version );
236 + $font_faces = openstation_desktop_theme_compile_font_faces( $manifest, $base_url, $version );
237 237
238 238 if ( empty( $declarations ) ) {
239 239 return '' === $font_faces
240 240 ? ''
241 - : "/* Desktop Mode desktop theme: {$slug} — compiled, do not edit. */\n" . $font_faces;
241 + : "/* OpenStation desktop theme: {$slug} — compiled, do not edit. */\n" . $font_faces;
242 242 }
243 243
244 244 // Re-sort so the emitted block is stable regardless of the order
245 245 // the loops above happened to append in.
@@ -244,12 +244,12 @@
244 244 // Re-sort so the emitted block is stable regardless of the order
245 245 // the loops above happened to append in.
246 246 sort( $declarations, SORT_STRING );
247 247
248 - $selector = '.desktop-mode-shell[data-desktop-mode-desktop-theme="' . $slug . '"],' . "\n"
249 - . 'body.desktop-mode-desktop-theme-' . $slug;
248 + $selector = '.os-shell[data-os-desktop-theme="' . $slug . '"],' . "\n"
249 + . 'body.os-desktop-theme-' . $slug;
250 250
251 - return "/* Desktop Mode desktop theme: {$slug} — compiled, do not edit. */\n"
251 + return "/* OpenStation desktop theme: {$slug} — compiled, do not edit. */\n"
252 252 . $font_faces
253 253 . $selector . " {\n"
254 254 . implode( "\n", $declarations ) . "\n"
255 255 . "}\n";
@@ -276,9 +276,9 @@
276 276 * @param string $version Cache-buster for relative refs.
277 277 * @return string Stylesheet fragment, or `''` when there are no
278 278 * usable faces.
279 279 */
280 -function desktop_mode_desktop_theme_compile_font_faces( $manifest, $base_url = '', $version = '' ) {
280 +function openstation_desktop_theme_compile_font_faces( $manifest, $base_url = '', $version = '' ) {
281 281 $fonts = isset( $manifest['fonts'] ) && is_array( $manifest['fonts'] )
282 282 ? $manifest['fonts']
283 283 : array();
284 284 if ( empty( $fonts ) ) {
@@ -295,13 +295,13 @@
295 295 foreach ( $face['src'] as $source ) {
296 296 if ( ! is_array( $source ) || empty( $source['path'] ) || empty( $source['format'] ) ) {
297 297 continue;
298 298 }
299 - $url = desktop_mode_desktop_theme_asset_url( $source['path'], $base_url, $version );
299 + $url = openstation_desktop_theme_asset_url( $source['path'], $base_url, $version );
300 300 if ( '' === $url ) {
301 301 continue;
302 302 }
303 - $sources[] = desktop_mode_desktop_theme_css_url( $url )
303 + $sources[] = openstation_desktop_theme_css_url( $url )
304 304 . ' format("' . $source['format'] . '")';
305 305 }
306 306 if ( empty( $sources ) ) {
307 307 continue;