PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.5
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.5
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
desktop-mode / includes / code-blue / assets.php

assets.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.5, at includes/code-blue/assets.php

48 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation — Code Blue: asset registration.
4 *
5 * The bundle script + CSS handles are registered on `init` priority
6 * 5 and delivered entirely by the shell: the native-window sync
7 * injects the registered style at boot (`ensureStyle`) and loads the
8 * script the first time the Code Blue window opens. Deliberately no
9 * eager `admin_enqueue_scripts` enqueue — it would ship the
10 * stylesheet into every chromeless iframe page, where this window
11 * can never mount.
12 *
13 * @package OpenStation
14 */
15
16 defined( 'ABSPATH' ) || exit;
17
18 /**
19 * Register Code Blue CSS and JS handles.
20 */
21 function openstation_code_blue_register_assets() {
22 $version = OPENSTATION_VERSION;
23 $suffix = openstation_asset_suffix();
24
25 $css_path = OPENSTATION_DIR . 'assets/css/code-blue.css';
26 wp_register_style(
27 'openstation-code-blue',
28 OPENSTATION_URL . 'assets/css/code-blue.css',
29 array( 'os-variables' ),
30 file_exists( $css_path ) ? (string) filemtime( $css_path ) : $version
31 );
32
33 $js_path = OPENSTATION_DIR . 'assets/js/code-blue' . $suffix . '.js';
34 wp_register_script(
35 'openstation-code-blue',
36 OPENSTATION_URL . 'assets/js/code-blue' . $suffix . '.js',
37 array( 'wp-i18n' ),
38 file_exists( $js_path ) ? (string) filemtime( $js_path ) : $version,
39 true
40 );
41 wp_set_script_translations(
42 'openstation-code-blue',
43 'desktop-mode',
44 OPENSTATION_DIR . 'languages'
45 );
46 }
47 add_action( 'init', 'openstation_code_blue_register_assets', 5 );
48