| @@ -1,16 +1,17 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Desktop Mode — Content Graph: asset registration. | |
| 3 | + * OpenStation — Content Graph: asset registration. | |
| 4 | 4 | * |
| 5 | - * Mirrors the my-wordpress / recycle-bin / posts-window modules: the | |
| 6 | - * bundle script + CSS handles are registered on `init` priority 5, and | |
| 7 | - * the native-window sync lazy-loads the script the first time the | |
| 8 | - * Content Graph window opens. The CSS is enqueued eagerly in admin | |
| 9 | - * context (cheap, ~3KB) so the empty-state spinner has its layout the | |
| 10 | - * moment the window mounts. | |
| 5 | + * Mirrors the my-wordpress / posts-window modules: the bundle script | |
| 6 | + * + CSS handles are registered on `init` priority 5, and the | |
| 7 | + * native-window sync lazy-loads BOTH the first time the Content Graph | |
| 8 | + * window opens — the script via the registration's `script` arg, the | |
| 9 | + * CSS as a `styles` companion (see the registration in `window.php`). | |
| 10 | + * Nothing is enqueued eagerly; a session that never opens the | |
| 11 | + * Corkboard downloads neither. | |
| 11 | 12 | * |
| 12 | - * @package WPDesktopMode | |
| 13 | + * @package OpenStation | |
| 13 | 14 | */ |
| 14 | 15 | |
| 15 | 16 | defined( 'ABSPATH' ) || exit; |
| 16 | 17 | |
| @@ -16,24 +17,24 @@ | ||
| 16 | 17 | |
| 17 | 18 | /** |
| 18 | 19 | * Register Content Graph CSS and JS handles. |
| 19 | 20 | */ |
| 20 | -function desktop_mode_content_graph_register_assets() { | |
| 21 | - $version = DESKTOP_MODE_VERSION; | |
| 22 | - $suffix = desktop_mode_asset_suffix(); | |
| 21 | +function openstation_content_graph_register_assets() { | |
| 22 | + $version = OPENSTATION_VERSION; | |
| 23 | + $suffix = openstation_asset_suffix(); | |
| 23 | 24 | |
| 24 | - $css_path = DESKTOP_MODE_DIR . 'assets/css/content-graph.css'; | |
| 25 | + $css_path = OPENSTATION_DIR . 'assets/css/content-graph.css'; | |
| 25 | 26 | wp_register_style( |
| 26 | 27 | 'desktop-mode-content-graph', |
| 27 | - DESKTOP_MODE_URL . 'assets/css/content-graph.css', | |
| 28 | - array( 'desktop-mode-variables', 'dashicons' ), | |
| 28 | + OPENSTATION_URL . 'assets/css/content-graph.css', | |
| 29 | + array( 'os-variables', 'dashicons' ), | |
| 29 | 30 | file_exists( $css_path ) ? (string) filemtime( $css_path ) : $version |
| 30 | 31 | ); |
| 31 | 32 | |
| 32 | - $js_path = DESKTOP_MODE_DIR . 'assets/js/content-graph' . $suffix . '.js'; | |
| 33 | + $js_path = OPENSTATION_DIR . 'assets/js/content-graph' . $suffix . '.js'; | |
| 33 | 34 | wp_register_script( |
| 34 | 35 | 'desktop-mode-content-graph', |
| 35 | - DESKTOP_MODE_URL . 'assets/js/content-graph' . $suffix . '.js', | |
| 36 | + OPENSTATION_URL . 'assets/js/content-graph' . $suffix . '.js', | |
| 36 | 37 | array( 'wp-i18n' ), |
| 37 | 38 | file_exists( $js_path ) ? (string) filemtime( $js_path ) : $version, |
| 38 | 39 | true |
| 39 | 40 | ); |
| @@ -39,8 +40,8 @@ | ||
| 39 | 40 | ); |
| 40 | 41 | wp_set_script_translations( |
| 41 | 42 | 'desktop-mode-content-graph', |
| 42 | 43 | 'desktop-mode', |
| 43 | - DESKTOP_MODE_DIR . 'languages' | |
| 44 | + OPENSTATION_DIR . 'languages' | |
| 44 | 45 | ); |
| 45 | 46 | } |
| 46 | -add_action( 'init', 'desktop_mode_content_graph_register_assets', 5 ); | |
| 47 | +add_action( 'init', 'openstation_content_graph_register_assets', 5 ); | |