Plugin Directory

Changeset 971853


Ignore:
Timestamp:
08/24/2014 07:56:18 PM (12 years ago)
Author:
jakemgold
Message:

WordPress 4.0 support, including a much newer TinyMCE plugin, with many new features, including background color and horizontal alignment. Dramatically improved support for paragraphed content inside of a cell (paragraph breaks no longer disappear on save).

Location:
mce-table-buttons/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • mce-table-buttons/trunk/mce_table_buttons.php

    r924343 r971853  
    44 Plugin URI: http://10up.com/plugins-modules/wordpress-mce-table-buttons/
    55 Description: Add <strong>controls for table editing</strong> to the visual content editor with this <strong>light weight</strong> plug-in.
    6  Version: 3.1
     6 Version: 3.2
    77 Author: Jake Goldman, 10up, Oomph
    88 Author URI: http://10up.com
     
    4040        add_filter( 'mce_external_plugins', array( __CLASS__, 'mce_external_plugins' ) );
    4141        add_filter( 'mce_buttons_2', array( __CLASS__, 'mce_buttons_2' ) );
    42         add_action( 'content_save_pre', array( __CLASS__, 'content_save_pre'), 100 );
     42        add_filter( 'content_save_pre', array( __CLASS__, 'content_save_pre' ), 20 );
    4343    }
    4444
     
    5151    public static function mce_external_plugins( $plugin_array ) {
    5252        global $tinymce_version;
     53        $variant = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
    5354
    5455        if ( version_compare( $tinymce_version, '400', '<' ) ) {
     
    6162            $plugin_array['mcetablebuttons'] = $plugin_dir_url . 'tinymce3-assets/mce-table-buttons.js';
    6263
     64        } elseif ( version_compare( $tinymce_version, '4100', '<' ) ) {
     65
     66            $plugin_array['table'] = plugin_dir_url( __FILE__ ) . 'tinymce4-table/plugin' . $variant . '.js';
     67
    6368        } else {
    6469
    65             $variant = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
    66             $plugin_array['table'] = plugin_dir_url( __FILE__ ) . 'tinymce4-table/plugin' . $variant . '.js';
     70            $plugin_array['table'] = plugin_dir_url( __FILE__ ) . 'tinymce41-table/plugin' . $variant . '.js';
    6771
    6872        }
     
    117121     */
    118122    public static function content_save_pre( $content ) {
    119         if ( substr( $content, -8 ) == '</table>' )
    120             $content .= "\n<br />";
     123        if ( false !== strpos( $content, '<table' ) ) {
     124            // paragraphed content inside of a td requires first paragraph to have extra line breaks (or else autop breaks)
     125            $content  = preg_replace( "/<td([^>]*)>(.+\r?\n\r?\n)/m", "<td$1>\n\n$2", $content );
     126
     127            // make sure there's space around the table
     128            if ( substr( $content, -8 ) == '</table>' ) {
     129                $content .= "\n<br />";
     130            }
     131        }
    121132       
    122133        return $content;
  • mce-table-buttons/trunk/readme.txt

    r924343 r971853  
    44Tags: tables, table, editor, WYSIWYG, buttons, tinymce
    55Requires at least: 3.4
    6 Tested up to: 3.9
    7 Stable tag: 3.1
     6Tested up to: 4.0
     7Stable tag: 3.2
    88
    99Adds table editing controls to the visual content editor (TinyMCE).
     
    3030
    3131== Changelog ==
     32
     33= 3.2 =
     34* WordPress 4.0 support, including a much newer TinyMCE plugin, with many new features, including background color and horizontal alignment
     35* Dramatically improved support for paragraphed content inside of a cell (paragraph breaks no longer disappear on save)
    3236
    3337= 3.1 =
Note: See TracChangeset for help on using the changeset viewer.