PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.11
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.11
1.1.11 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 All 35 releases
← All changes | includes/widgets/widget-jazz-quote.php +32 -41 0.9.7 → 1.1.11 View file →
@@ -1,16 +1,15 @@
1 1 <?php
2 2 /**
3 - * Desktop Mode — Jazz Quote Widget.
3 + * OpenStation — Jazz Quote Widget.
4 4 *
5 5 * A love letter to WordPress's jazz musician release naming tradition.
6 6 * Shows the current WP version, its jazz musician codename, and a
7 7 * rotating daily quote from that musician.
8 8 *
9 - * Requires: Desktop Mode 0.18.0+ (desktop_mode_register_widget).
9 + * Requires: OpenStation 0.18.0+ (openstation_register_widget).
10 10 *
11 - * @package WPDesktopMode
12 - * @since 0.26.0
11 + * @package OpenStation
13 12 */
14 13
15 14 defined( 'ABSPATH' ) || exit;
16 15
@@ -15,100 +14,92 @@
15 14 defined( 'ABSPATH' ) || exit;
16 15
17 16 /**
18 17 * Register JS + CSS assets.
19 - *
20 - * @since 0.26.0
21 18 */
22 -function desktop_mode_register_jazz_quote_widget_assets() {
23 - $suffix = desktop_mode_asset_suffix();
24 - $version = defined( 'DESKTOP_MODE_VERSION' ) ? DESKTOP_MODE_VERSION : '0';
19 +function openstation_register_jazz_quote_widget_assets() {
20 + $suffix = openstation_asset_suffix();
21 + $version = defined( 'OPENSTATION_VERSION' ) ? OPENSTATION_VERSION : '0';
25 22
26 - $js_path = DESKTOP_MODE_DIR . 'assets/js/widget-jazz-quote' . $suffix . '.js';
27 - $css_path = DESKTOP_MODE_DIR . 'assets/js/widget-jazz-quote' . $suffix . '.css';
23 + $js_path = OPENSTATION_DIR . 'assets/js/widget-jazz-quote' . $suffix . '.js';
24 + $css_path = OPENSTATION_DIR . 'assets/js/widget-jazz-quote' . $suffix . '.css';
28 25
29 26 wp_register_style(
30 - 'desktop-mode-jazz-quote-widget',
31 - DESKTOP_MODE_URL . 'assets/js/widget-jazz-quote' . $suffix . '.css',
27 + 'os-jazz-quote-widget',
28 + OPENSTATION_URL . 'assets/js/widget-jazz-quote' . $suffix . '.css',
32 29 array(),
33 30 file_exists( $css_path ) ? (string) filemtime( $css_path ) : $version
34 31 );
35 32
36 33 wp_register_script(
37 - 'desktop-mode-jazz-quote-widget',
38 - DESKTOP_MODE_URL . 'assets/js/widget-jazz-quote' . $suffix . '.js',
34 + 'os-jazz-quote-widget',
35 + OPENSTATION_URL . 'assets/js/widget-jazz-quote' . $suffix . '.js',
39 36 array(),
40 37 file_exists( $js_path ) ? (string) filemtime( $js_path ) : $version,
41 38 true
42 39 );
43 40 }
44 -add_action( 'init', 'desktop_mode_register_jazz_quote_widget_assets', 5 );
41 +add_action( 'init', 'openstation_register_jazz_quote_widget_assets', 5 );
45 42
46 43 /**
47 44 * Inline the WordPress version on the MAIN desktop shell script.
48 45 *
49 - * wp_add_inline_script() only outputs when the attached handle is
46 + * Note that wp_add_inline_script() only outputs when the attached handle is
50 47 * actually enqueued. The widget JS loads lazily via the shell's
51 48 * server-sync, so attaching the inline script to the widget handle
52 49 * would mean it never appears. Instead we attach it to the main
53 50 * desktop handle which is always enqueued on shell pages.
54 51 *
55 - * window.desktopModeJazzQuote is therefore available from page load,
52 + * window.openStationJazzQuote is therefore available from page load,
56 53 * before the widget bundle is ever fetched.
57 - *
58 - * @since 0.26.0
59 54 */
60 -function desktop_mode_jazz_quote_inline_version() {
61 - if ( ! desktop_mode_is_enabled() ) {
55 +function openstation_jazz_quote_inline_version() {
56 + if ( ! openstation_is_enabled() ) {
62 57 return;
63 58 }
64 - if ( desktop_mode_is_chromeless_request() ) {
59 + if ( openstation_is_chromeless_request() ) {
65 60 return;
66 61 }
67 62 $main_handle = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
68 - ? 'desktop-mode'
69 - : 'desktop-mode';
63 + ? 'openstation'
64 + : 'openstation';
70 65
71 66 wp_add_inline_script(
72 67 $main_handle,
73 - 'window.desktopModeJazzQuote = { wpVersion: ' . wp_json_encode( get_bloginfo( 'version' ) ) . ' };',
68 + 'window.openStationJazzQuote = { wpVersion: ' . wp_json_encode( get_bloginfo( 'version' ) ) . ' };',
74 69 'before'
75 70 );
76 71 }
77 -add_action( 'admin_enqueue_scripts', 'desktop_mode_jazz_quote_inline_version', 15 );
72 +add_action( 'admin_enqueue_scripts', 'openstation_jazz_quote_inline_version', 15 );
78 73
79 74 /**
80 75 * Eagerly enqueue the CSS on shell pages.
81 - *
82 - * @since 0.26.0
83 76 */
84 -function desktop_mode_enqueue_jazz_quote_widget_styles() {
85 - if ( function_exists( 'desktop_mode_is_enabled' ) && ! desktop_mode_is_enabled() ) {
77 +function openstation_enqueue_jazz_quote_widget_styles() {
78 + if ( function_exists( 'openstation_is_enabled' ) && ! openstation_is_enabled() ) {
86 79 return;
87 80 }
88 - if ( function_exists( 'desktop_mode_is_chromeless_request' ) && desktop_mode_is_chromeless_request() ) {
81 + if ( function_exists( 'openstation_is_chromeless_request' ) && openstation_is_chromeless_request() ) {
89 82 return;
90 83 }
91 - wp_enqueue_style( 'desktop-mode-jazz-quote-widget' );
84 + wp_enqueue_style( 'os-jazz-quote-widget' );
92 85 }
93 -add_action( 'admin_enqueue_scripts', 'desktop_mode_enqueue_jazz_quote_widget_styles', 20 );
86 +add_action( 'admin_enqueue_scripts', 'openstation_enqueue_jazz_quote_widget_styles', 20 );
94 87
95 88 /**
96 89 * Register the widget definition.
97 - *
98 - * @since 0.26.0
99 90 */
100 -function desktop_mode_register_jazz_quote_widget() {
101 - if ( ! function_exists( 'desktop_mode_register_widget' ) ) {
91 +function openstation_register_jazz_quote_widget() {
92 + if ( ! function_exists( 'openstation_register_widget' ) ) {
102 93 return;
103 94 }
104 - desktop_mode_register_widget(
95 + openstation_register_widget(
105 96 'desktop-mode/jazz-quote',
106 97 array(
107 98 'label' => __( 'Jazz Quote', 'desktop-mode' ),
108 99 'description' => __( 'A daily quote from the jazz musician behind your WordPress version.', 'desktop-mode' ),
109 100 'icon' => 'dashicons-format-audio',
110 - 'script' => 'desktop-mode-jazz-quote-widget',
101 + 'script' => 'os-jazz-quote-widget',
111 102 'movable' => true,
112 103 'resizable' => true,
113 104 'min_width' => 220,
114 105 'min_height' => 160,
@@ -116,5 +107,5 @@
116 107 'default_height' => 220,
117 108 )
118 109 );
119 110 }
120 -add_action( 'init', 'desktop_mode_register_jazz_quote_widget', 6 );
111 +add_action( 'init', 'openstation_register_jazz_quote_widget', 6 );