- global $content_width;
- $post = get_post();
-
- $width = isset( $content_width ) && 800 > $content_width ? $content_width : 800;
- $width = $width + 22; // compensate for the padding and border
- $dfw_width = get_user_setting( 'dfw_width', $width );
- $save = isset( $post->post_status ) && $post->post_status == 'publish' ? __('Update') : __('Save');
-
- ?>
- <div id="wp-fullscreen-body" class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>" data-theme-width="<?php echo (int) $width; ?>" data-dfw-width="<?php echo (int) $dfw_width; ?>">
- <div id="fullscreen-topbar">
- <div id="wp-fullscreen-toolbar">
- <div id="wp-fullscreen-close"><a href="#" onclick="wp.editor.fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div>
- <div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?>px;">
-
- <div id="wp-fullscreen-mode-bar">
- <div id="wp-fullscreen-modes" class="button-group">
- <a class="button wp-fullscreen-mode-tinymce" href="#" onclick="wp.editor.fullscreen.switchmode( 'tinymce' ); return false;"><?php _e( 'Visual' ); ?></a>
- <a class="button wp-fullscreen-mode-html" href="#" onclick="wp.editor.fullscreen.switchmode( 'html' ); return false;"><?php _ex( 'Text', 'Name for the Text editor tab (formerly HTML)' ); ?></a>
- </div>
- </div>
-
- <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="mce-toolbar">
- <?php
-
- $buttons = array(
- // format: title, onclick, show in both editors
- 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'both' => false ),
- 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'both' => false ),
- 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'both' => false ),
- 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'both' => false ),
- 'blockquote' => array( 'title' => __('Blockquote (Alt + Shift + Q)'), 'both' => false ),
- 'wp-media-library' => array( 'title' => __('Media library (Alt + Shift + M)'), 'both' => true ),
- 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'both' => true ),
- 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'both' => false ),
- 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'both' => false ),
- );
-
- /**
- * Filter the list of TinyMCE buttons for the fullscreen
- * 'Distraction Free Writing' editor.
- *
- * @since 3.2.0
- *
- * @param array $buttons An array of TinyMCE buttons for the DFW editor.
- */
- $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons );
-
- foreach ( $buttons as $button => $args ) {
- if ( 'separator' == $args ) {
- continue;
- }
-
- $onclick = ! empty( $args['onclick'] ) ? ' onclick="' . $args['onclick'] . '"' : '';
- $title = esc_attr( $args['title'] );
- ?>
-
- <div class="mce-widget mce-btn<?php if ( $args['both'] ) { ?> wp-fullscreen-both<?php } ?>">
- <button type="button" aria-label="<?php echo $title; ?>" title="<?php echo $title; ?>"<?php echo $onclick; ?> id="wp_fs_<?php echo $button; ?>">
- <i class="mce-ico mce-i-<?php echo $button; ?>"></i>
- </button>
- </div>
- <?php
- }
-
- ?>
-
- </div></div>
-
- <div id="wp-fullscreen-save">
- <input type="button" class="button button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" />
- <span class="wp-fullscreen-saved-message"><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
- <span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span>
- <span class="spinner"></span>
- </div>
-
- </div>
- </div>
- </div>
- <div id="wp-fullscreen-statusbar">
- <div id="wp-fullscreen-status">
- <div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div>
- <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div>
- </div>
- </div>
- </div>
-
- <div class="fullscreen-overlay" id="fullscreen-overlay"></div>
- <div class="fullscreen-overlay fullscreen-fader fade-300" id="fullscreen-fader"></div>
- <?php