Make WordPress Core


Ignore:
Timestamp:
04/25/2011 01:01:34 AM (14 years ago)
Author:
azaozz
Message:

Distraction Free Writing mode, see #17136

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r17630 r17695  
    14111411        $ext_plugins = '';
    14121412    } else {
    1413         $plugins = array( 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'fullscreen', 'media', 'wpeditimage', 'wpgallery', 'tabfocus', 'wplink', 'wpdialogs' );
     1413        $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'wordpress', 'wpfullscreen', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
    14141414
    14151415        /*
     
    15621562        'extended_valid_elements' => 'article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr',
    15631563        'wpeditimage_disable_captions' => $no_captions,
     1564        'wp_fullscreen_content_css' => "$baseurl/plugins/wpfullscreen/css/content.css",
    15641565        'plugins' => implode( ',', $plugins ),
    15651566    );
     
    16451646    }
    16461647
    1647     $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?>
     1648    $mce_options = rtrim( trim($mce_options), '\n\r,' );
     1649
     1650    wp_print_scripts('editor'); ?>
    16481651
    16491652<script type="text/javascript">
     
    16861689<?php
    16871690
    1688     // Load additional inline scripts based on active plugins.
    1689     if ( in_array( 'wpdialogs', $plugins ) ) {
    1690         wp_print_scripts( array( 'wpdialogs-popup' ) );
     1691do_action('tiny_mce_preload_dialogs', $plugins);
     1692}
     1693
     1694// Load additional inline scripts based on active plugins.
     1695function wp_preload_dialogs($plugins) {
     1696
     1697    if ( in_array( 'wpdialogs', $plugins, true ) ) {
     1698        wp_print_scripts('wpdialogs-popup');
    16911699        wp_print_styles('wp-jquery-ui-dialog');
    16921700    }
    1693     if ( in_array( 'wplink', $plugins ) ) {
     1701
     1702    if ( in_array( 'wplink', $plugins, true ) ) {
    16941703        require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
    1695         add_action('tiny_mce_preload_dialogs', 'wp_link_dialog');
     1704        ?><div style="display:none;"><?php wp_link_dialog(); ?></div><?php
    16961705        wp_print_scripts('wplink');
    16971706        wp_print_styles('wplink');
    16981707    }
    1699 }
    1700 function wp_tiny_mce_preload_dialogs() { ?>
    1701     <div id="preloaded-dialogs" style="display:none;">
    1702 <?php   do_action('tiny_mce_preload_dialogs'); ?>
     1708
     1709    // Distraction Free Writing mode
     1710    if ( in_array( 'wpfullscreen', $plugins, true ) ) {
     1711        wp_fullscreen_html();
     1712        wp_print_scripts('wp-fullscreen');
     1713    }
     1714
     1715    wp_print_scripts('word-count');
     1716}
     1717
     1718function wp_quicktags() {
     1719    wp_preload_dialogs( array( 'wpdialogs', 'wplink', 'wp_fullscreen' ) );
     1720}
     1721
     1722function wp_fullscreen_html() {
     1723    global $content_width, $post;
     1724
     1725    $width = isset($content_width) && 800 > $content_width ? $content_width : 800;
     1726    $width = $width + 10; // compensate for the padding
     1727    $save = $post->post_status == 'publish' ? __('Update') : __('Save');
     1728?>
     1729<div id="wp-fullscreen-body">
     1730<div id="fullscreen-topbar" class="fade-600">
     1731    <div id="wp-fullscreen-info">
     1732        <span id="wp-fullscreen-saved"> </span>
     1733        <span class="autosave-message">&nbsp;</span>
     1734        <span id="wp-fullscreen-last-edit"> </span>
    17031735    </div>
    1704 <?php }
     1736
     1737    <div id="wp-fullscreen-toolbar">
     1738        <div id="wp-fullscreen-close"><a href="#" onclick="fullscreen.off();return false;"><?php _e('Back'); ?></a></div>
     1739        <div id="wp-fullscreen-save"><input type="button" class="button-primary" value="<?php echo $save; ?>" onclick="fullscreen.save();" /></div>
     1740        <div id="wp-fullscreen-buttons" style="width:<?php echo $width; ?>px;" class="wp_themeSkin">
     1741            <div>
     1742            <a title="<?php _e('Bold (Ctrl + B)'); ?>" aria-labelledby="wp_fs_bold_voice" onclick="fullscreen.b();return false;" class="mceButton mceButtonEnabled mce_bold" href="javascript:;" id="wp_fs_bold" role="button" tabindex="-1" aria-pressed="false">
     1743            <span class="mceIcon mce_bold"></span>
     1744            <span id="wp_fs_bold_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Bold (Ctrl + B)'); ?></span>
     1745            </a>
     1746            </div>
     1747
     1748            <div>
     1749            <a title="<?php _e('Italic (Ctrl + I)'); ?>" aria-labelledby="wp_fs_italic_voice" onclick="fullscreen.i();return false;" class="mceButton mceButtonEnabled mce_italic" href="javascript:;" id="wp_fs_italic" role="button" tabindex="-1" aria-pressed="false">
     1750            <span class="mceIcon mce_italic"></span>
     1751            <span id="wp_fs_italic_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Italic (Ctrl + I)'); ?></span>
     1752            </a>
     1753            </div>
     1754
     1755            <div>
     1756            <span tabindex="-1" aria-orientation="vertical" role="separator" class="mceSeparator"></span>
     1757            </div>
     1758
     1759            <div>
     1760            <a title="<?php _e('Unordered list (Alt + Shift + U)'); ?>" aria-labelledby="wp_fs_bullist_voice" onclick="fullscreen.ul();return false;" onmousedown="return false;" class="mceButton mceButtonEnabled mce_bullist" href="javascript:;" id="wp_fs_bullist" role="button" tabindex="-1" aria-pressed="false">
     1761            <span class="mceIcon mce_bullist"></span>
     1762            <span id="wp_fs_bullist_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Unordered list (Alt + Shift + U)'); ?></span>
     1763            </a>
     1764            </div>
     1765
     1766            <div>
     1767            <a title="<?php _e('Ordered list (Alt + Shift + O)'); ?>" aria-labelledby="wp_fs_numlist_voice" onclick="fullscreen.ol();return false;" class="mceButton mceButtonEnabled mce_numlist" href="javascript:;" id="wp_fs_numlist" role="button" tabindex="-1" aria-pressed="false">
     1768            <span class="mceIcon mce_numlist"></span>
     1769            <span id="wp_fs_numlist_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Ordered list (Alt + Shift + O)'); ?></span>
     1770            </a>
     1771            </div>
     1772
     1773            <div>
     1774            <span tabindex="-1" aria-orientation="vertical" role="separator" class="mceSeparator"></span>
     1775            </div>
     1776
     1777            <div>
     1778            <a title="<?php _e('Insert/edit image (Alt + Shift + M)'); ?>" aria-labelledby="wp_fs_image_voice" onclick="jQuery('#add_image').click();return false;" class="mceButton mceButtonEnabled mce_image" href="javascript:;" id="wp_fs_image" role="button" tabindex="-1">
     1779            <span class="mceIcon mce_image"></span>
     1780            <span id="wp_fs_image_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Insert/edit image (Alt + Shift + M)'); ?></span>
     1781            </a>
     1782            </div>
     1783
     1784            <div>
     1785            <span tabindex="-1" aria-orientation="vertical" role="separator" class="mceSeparator"></span>
     1786            </div>
     1787
     1788            <div>
     1789            <a title="<?php _e('Insert/edit link (Alt + Shift + A)'); ?>" aria-labelledby="wp_fs_link_voice" onclick="fullscreen.link();return false;" class="mceButton mce_link mceButtonEnabled" href="javascript:;" id="wp_fs_link" role="button" tabindex="-1" aria-pressed="false">
     1790            <span class="mceIcon mce_link"></span>
     1791            <span id="wp_fs_link_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Insert/edit link (Alt + Shift + A)'); ?></span>
     1792            </a>
     1793            </div>
     1794
     1795            <div>
     1796            <a title="<?php _e('Unlink (Alt + Shift + S)'); ?>" aria-labelledby="wp_fs_unlink_voice" onclick="fullscreen.unlink();return false;" class="mceButton mce_unlink mceButtonEnabled" href="javascript:;" id="wp_fs_unlink" role="button" tabindex="-1" aria-pressed="false">
     1797            <span class="mceIcon mce_unlink"></span>
     1798            <span id="wp_fs_unlink_voice" style="display: none;" class="mceVoiceLabel mceIconOnly"><?php _e('Unlink (Alt + Shift + S)'); ?></span>
     1799            </a>
     1800            </div>
     1801
     1802            <div id="wp-fullscreen-count"><?php _e('Word Count:'); ?> <span class="word-count">0</span></div>
     1803        </div>
     1804    </div>
     1805</div>
     1806
     1807<div id="wp-fullscreen-wrap" style="width:<?php echo $width; ?>px;">
     1808    <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
     1809    <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" />
     1810
     1811    <div id="wp-fullscreen-container">
     1812        <textarea id="wp_mce_fullscreen"></textarea>
     1813    </div>
     1814</div>
     1815</div>
     1816
     1817<div class="fullscreen-overlay" id="fullscreen-overlay"></div>
     1818<div class="fullscreen-overlay fullscreen-fader fade-600" id="fullscreen-fader"></div>
     1819<?php
     1820}
     1821
     1822
Note: See TracChangeset for help on using the changeset viewer.