| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Desktop Mode — Focus Timer widget PHP registration. | |
| 3 | + * OpenStation — Focus Timer widget PHP registration. | |
| 4 | 4 | * |
| 5 | 5 | * Registers the widget's JS bundle + CSS, enqueues the CSS eagerly on |
| 6 | - * shell pages, and announces the widget to Desktop Mode so it appears in | |
| 6 | + * shell pages, and announces the widget to OpenStation so it appears in | |
| 7 | 7 | * the widget picker. All behaviour lives in the JS |
| 8 | 8 | * (src/plugins/focus-timer-widget/); this file only declares the widget. |
| 9 | 9 | * |
| 10 | 10 | * The timer runs entirely in the browser — no REST routes, no server |
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | * |
| 10 | 10 | * The timer runs entirely in the browser — no REST routes, no server |
| 11 | 11 | * state, no external services — so the script declares no dependencies. |
| 12 | 12 | * |
| 13 | - * @package WPDesktopMode | |
| 13 | + * @package OpenStation | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | defined( 'ABSPATH' ) || exit; |
| 17 | 17 | |
| @@ -19,66 +19,66 @@ | ||
| 19 | 19 | * Register the Focus Timer widget's script + style handles. |
| 20 | 20 | * |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | -function desktop_mode_register_focus_timer_widget_assets() { | |
| 24 | - $suffix = desktop_mode_asset_suffix(); | |
| 25 | - $version = defined( 'DESKTOP_MODE_VERSION' ) ? DESKTOP_MODE_VERSION : '0'; | |
| 23 | +function openstation_register_focus_timer_widget_assets() { | |
| 24 | + $suffix = openstation_asset_suffix(); | |
| 25 | + $version = defined( 'OPENSTATION_VERSION' ) ? OPENSTATION_VERSION : '0'; | |
| 26 | 26 | |
| 27 | - $js_path = DESKTOP_MODE_DIR . 'assets/js/widget-focus-timer' . $suffix . '.js'; | |
| 28 | - $css_path = DESKTOP_MODE_DIR . 'assets/js/widget-focus-timer' . $suffix . '.css'; | |
| 27 | + $js_path = OPENSTATION_DIR . 'assets/js/widget-focus-timer' . $suffix . '.js'; | |
| 28 | + $css_path = OPENSTATION_DIR . 'assets/js/widget-focus-timer' . $suffix . '.css'; | |
| 29 | 29 | |
| 30 | 30 | wp_register_style( |
| 31 | - 'desktop-mode-focus-timer-widget', | |
| 32 | - DESKTOP_MODE_URL . 'assets/js/widget-focus-timer' . $suffix . '.css', | |
| 31 | + 'os-focus-timer-widget', | |
| 32 | + OPENSTATION_URL . 'assets/js/widget-focus-timer' . $suffix . '.css', | |
| 33 | 33 | array(), |
| 34 | 34 | file_exists( $css_path ) ? (string) filemtime( $css_path ) : $version |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | wp_register_script( |
| 38 | - 'desktop-mode-focus-timer-widget', | |
| 39 | - DESKTOP_MODE_URL . 'assets/js/widget-focus-timer' . $suffix . '.js', | |
| 38 | + 'os-focus-timer-widget', | |
| 39 | + OPENSTATION_URL . 'assets/js/widget-focus-timer' . $suffix . '.js', | |
| 40 | 40 | array(), |
| 41 | 41 | file_exists( $js_path ) ? (string) filemtime( $js_path ) : $version, |
| 42 | 42 | true |
| 43 | 43 | ); |
| 44 | 44 | } |
| 45 | -add_action( 'init', 'desktop_mode_register_focus_timer_widget_assets', 5 ); | |
| 45 | +add_action( 'init', 'openstation_register_focus_timer_widget_assets', 5 ); | |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Eagerly enqueue the CSS on Desktop Mode shell pages (avoids a flash of | |
| 48 | + * Eagerly enqueue the CSS on OpenStation shell pages (avoids a flash of | |
| 49 | 49 | * unstyled content before the lazy JS mounts). |
| 50 | 50 | * |
| 51 | 51 | * @return void |
| 52 | 52 | */ |
| 53 | -function desktop_mode_enqueue_focus_timer_widget_styles() { | |
| 54 | - if ( function_exists( 'desktop_mode_is_enabled' ) && ! desktop_mode_is_enabled() ) { | |
| 53 | +function openstation_enqueue_focus_timer_widget_styles() { | |
| 54 | + if ( function_exists( 'openstation_is_enabled' ) && ! openstation_is_enabled() ) { | |
| 55 | 55 | return; |
| 56 | 56 | } |
| 57 | - if ( function_exists( 'desktop_mode_is_chromeless_request' ) && desktop_mode_is_chromeless_request() ) { | |
| 57 | + if ( function_exists( 'openstation_is_chromeless_request' ) && openstation_is_chromeless_request() ) { | |
| 58 | 58 | return; |
| 59 | 59 | } |
| 60 | - wp_enqueue_style( 'desktop-mode-focus-timer-widget' ); | |
| 60 | + wp_enqueue_style( 'os-focus-timer-widget' ); | |
| 61 | 61 | } |
| 62 | -add_action( 'admin_enqueue_scripts', 'desktop_mode_enqueue_focus_timer_widget_styles', 20 ); | |
| 62 | +add_action( 'admin_enqueue_scripts', 'openstation_enqueue_focus_timer_widget_styles', 20 ); | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Announce the widget to Desktop Mode. | |
| 65 | + * Announce the widget to OpenStation. | |
| 66 | 66 | * |
| 67 | 67 | * @return void |
| 68 | 68 | */ |
| 69 | -function desktop_mode_register_focus_timer_widget() { | |
| 70 | - if ( ! function_exists( 'desktop_mode_register_widget' ) ) { | |
| 69 | +function openstation_register_focus_timer_widget() { | |
| 70 | + if ( ! function_exists( 'openstation_register_widget' ) ) { | |
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - desktop_mode_register_widget( | |
| 74 | + openstation_register_widget( | |
| 75 | 75 | 'desktop-mode/focus-timer', |
| 76 | 76 | array( |
| 77 | 77 | 'label' => __( 'Focus Timer', 'desktop-mode' ), |
| 78 | 78 | 'description' => __( 'A focus countdown. Link it to a window and get a shake + alarm when time is up.', 'desktop-mode' ), |
| 79 | 79 | 'icon' => 'dashicons-clock', |
| 80 | - 'script' => 'desktop-mode-focus-timer-widget', | |
| 80 | + 'script' => 'os-focus-timer-widget', | |
| 81 | 81 | 'movable' => true, |
| 82 | 82 | 'resizable' => true, |
| 83 | 83 | 'min_width' => 240, |
| 84 | 84 | 'min_height' => 200, |
| @@ -86,5 +86,5 @@ | ||
| 86 | 86 | 'default_height' => 300, |
| 87 | 87 | ) |
| 88 | 88 | ); |
| 89 | 89 | } |
| 90 | -add_action( 'init', 'desktop_mode_register_focus_timer_widget', 6 ); | |
| 90 | +add_action( 'init', 'openstation_register_focus_timer_widget', 6 ); | |