Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/15/2012 12:23:31 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Iterate on #1917.

  • Remove fullscreen editor from teeny editor buttons.
  • Introduce tabfocus plugin, with some approximate values.
  • Props ethitter.
  • Note: theme-side tinymce tabfocus still not working as intended.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/common/template-tags.php

    r4573 r4576  
    16301630                // Parse arguments against default values
    16311631                $r = bbp_parse_args( $args, array(
    1632                         'context'       => 'topic',
    1633                         'before'        => '<div class="bbp-the-content-wrapper">',
    1634                         'after'         => '</div>',
    1635                         'wpautop'       => true,
    1636                         'media_buttons' => false,
    1637                         'textarea_rows' => '12',
    1638                         'tabindex'      => bbp_get_tab_index(),
    1639                         'editor_class'  => 'bbp-the-content',
    1640                         'tinymce'       => true,
    1641                         'teeny'         => true,
    1642                         'quicktags'     => true
     1632                        'context'           => 'topic',
     1633                        'before'            => '<div class="bbp-the-content-wrapper">',
     1634                        'after'             => '</div>',
     1635                        'wpautop'           => true,
     1636                        'media_buttons'     => false,
     1637                        'textarea_rows'     => '12',
     1638                        'tabindex'          => bbp_get_tab_index(),
     1639                        'tabfocus_elements' => '#bbp_topic_title,#bbp_topic_tags',
     1640                        'editor_class'      => 'bbp-the-content',
     1641                        'tinymce'           => true,
     1642                        'teeny'             => true,
     1643                        'quicktags'         => true,
     1644                        'dfw'               => false
    16431645                ), 'get_the_content' );
    16441646
     
    16561658                // Use TinyMCE if available
    16571659                if ( bbp_use_wp_editor() ) :
     1660
     1661                        // Enable additional TinyMCE plugins before outputting the editor
     1662                        add_filter( 'tiny_mce_plugins',  'bbp_get_tiny_mce_plugins' );
     1663                        add_filter( 'teeny_mce_plugins', 'bbp_get_tiny_mce_plugins' );
     1664
     1665                        // Output the editor
    16581666                        wp_editor( htmlspecialchars_decode( $post_content, ENT_QUOTES ), 'bbp_' . $r['context'] . '_content', array(
    1659                                 'wpautop'       => $r['wpautop'],
    1660                                 'media_buttons' => $r['media_buttons'],
    1661                                 'textarea_rows' => $r['textarea_rows'],
    1662                                 'tabindex'      => $r['tabindex'],
    1663                                 'editor_class'  => $r['editor_class'],
    1664                                 'tinymce'       => $r['tinymce'],
    1665                                 'teeny'         => $r['teeny'],
    1666                                 'quicktags'     => $r['quicktags']
     1667                                'wpautop'           => $r['wpautop'],
     1668                                'media_buttons'     => $r['media_buttons'],
     1669                                'textarea_rows'     => $r['textarea_rows'],
     1670                                'tabindex'          => $r['tabindex'],
     1671                                'tabfocus_elements' => $r['tabfocus_elements'],
     1672                                'editor_class'      => $r['editor_class'],
     1673                                'tinymce'           => $r['tinymce'],
     1674                                'teeny'             => $r['teeny'],
     1675                                'quicktags'         => $r['quicktags'],
     1676                                'dfw'               => $r['dfw'],
    16671677                        ) );
     1678
     1679                        // Remove additional TinyMCE plugins after outputting the editor
     1680                        remove_filter( 'tiny_mce_plugins',  'bbp_get_tiny_mce_plugins' );
     1681                        remove_filter( 'teeny_mce_plugins', 'bbp_get_tiny_mce_plugins' );
    16681682
    16691683                /**
     
    16921706                return apply_filters( 'bbp_get_the_content', $output, $args, $post_content );
    16931707        }
     1708
     1709/**
     1710 * Edit TinyMCE plugins to match core behaviour
     1711 *
     1712 * @since bbPress (r4574)
     1713 *
     1714 * @param array $plugins
     1715 * @see tiny_mce_plugins, teeny_mce_plugins
     1716 * @return array
     1717 */
     1718function bbp_get_tiny_mce_plugins( $plugins = array() ) {
     1719
     1720        // Unset fullscreen
     1721        foreach ( $plugins as $key => $value ) {
     1722                if ( 'fullscreen' == $value ) {
     1723                        unset( $plugins[$key] );
     1724                        break;
     1725                }
     1726        }
     1727
     1728        // Add the tabfocus plugin
     1729        $plugins[] = 'tabfocus';
     1730
     1731        return apply_filters( 'bbp_get_tiny_mce_plugins', $plugins );
     1732}
    16941733
    16951734/** Views *********************************************************************/
Note: See TracChangeset for help on using the changeset viewer.