Version Description
- Code clean up, 3.1 testing
Download this release
Release Info
Developer | jakemgold |
Plugin | MCE Table Buttons |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- mce_table_buttons.php +36 -34
- readme.txt +7 -4
mce_table_buttons.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
Plugin Name: MCE Table Buttons
|
4 |
-
Plugin URI: http://www.
|
5 |
Description: Add <strong>buttons for table editing</strong> to the WordPress WYSIWYG editor with this very <strong>light weight</strong> plug-in.
|
6 |
-
Version: 1.0.
|
7 |
-
Author:
|
8 |
-
Author URI: http://www.
|
9 |
|
10 |
-
Plugin: Copyright
|
11 |
|
12 |
This program is free software; you can redistribute it and/or modify
|
13 |
it under the terms of the GNU General Public License as published by
|
@@ -24,37 +24,39 @@
|
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
function mce_table_buttons_setup()
|
30 |
{
|
31 |
-
|
32 |
{
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
{
|
40 |
-
$plugin_array['table'] = WP_PLUGIN_URL . '/' . basename( dirname(__FILE__) ) .'/mce-table/editor_plugin.js';
|
41 |
-
return $plugin_array;
|
42 |
-
}
|
43 |
-
|
44 |
-
function mce_table_buttons($buttons)
|
45 |
-
{
|
46 |
-
array_push( $buttons, "tablecontrols" );
|
47 |
-
return $buttons;
|
48 |
-
}
|
49 |
-
|
50 |
-
// fix for improper save your changes requests
|
51 |
-
|
52 |
-
add_action( 'content_save_pre', 'mce_table_ender', 100 );
|
53 |
-
|
54 |
-
function mce_table_ender( $content )
|
55 |
-
{
|
56 |
-
if ( substr( $content, -8 ) == '</table>' )
|
57 |
-
$content = $content . "\n<br />";
|
58 |
-
|
59 |
-
return $content;
|
60 |
-
}
|
1 |
<?php
|
2 |
/**
|
3 |
Plugin Name: MCE Table Buttons
|
4 |
+
Plugin URI: http://www.thinkoomph.com/plugins-modules/wordpress-mce-table-buttons/
|
5 |
Description: Add <strong>buttons for table editing</strong> to the WordPress WYSIWYG editor with this very <strong>light weight</strong> plug-in.
|
6 |
+
Version: 1.0.3
|
7 |
+
Author: Jake Goldman (Oomph, Inc)
|
8 |
+
Author URI: http://www.thinkoomph.com
|
9 |
|
10 |
+
Plugin: Copyright 2011 Oomph, Inc (email : jake@thinkoomph.com)
|
11 |
|
12 |
This program is free software; you can redistribute it and/or modify
|
13 |
it under the terms of the GNU General Public License as published by
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
+
class mce_table_buttons
|
|
|
|
|
28 |
{
|
29 |
+
function __construct()
|
30 |
{
|
31 |
+
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
32 |
+
add_action( 'content_save_pre', array( $this, 'content_save_pre'), 100 );
|
33 |
+
}
|
34 |
+
|
35 |
+
function admin_init()
|
36 |
+
{
|
37 |
+
add_filter( 'mce_external_plugins', array( $this, 'mce_external_plugins' ) );
|
38 |
+
add_filter( 'mce_buttons_3', array( $this, 'mce_buttons_3' ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
function mce_external_plugins( $plugin_array )
|
42 |
+
{
|
43 |
+
$plugin_array['table'] = plugin_dir_url( __FILE__ ) . 'mce-table/editor_plugin.js';
|
44 |
+
return $plugin_array;
|
45 |
+
}
|
46 |
+
|
47 |
+
function mce_buttons_3( $buttons )
|
48 |
+
{
|
49 |
+
array_push( $buttons, 'tablecontrols' );
|
50 |
+
return $buttons;
|
51 |
+
}
|
52 |
+
|
53 |
+
function content_save_pre( $content )
|
54 |
+
{
|
55 |
+
if ( substr( $content, -8 ) == '</table>' )
|
56 |
+
$content = $content . "\n<br />";
|
57 |
+
|
58 |
+
return $content;
|
59 |
}
|
60 |
}
|
61 |
|
62 |
+
$mce_table_buttons = new mce_table_buttons;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== MCE Table Buttons ===
|
2 |
-
Contributors:
|
3 |
-
Donate link: http://www.
|
4 |
Tags: tables, table, editor, WYSIWYG, buttons, tinymce
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.0.
|
8 |
|
9 |
Adds table editing buttons to a new, third row in the WordPress WYSIWYG editor.
|
10 |
|
@@ -30,6 +30,9 @@ Hoping to add the ability to hide the new table editing toolbar with the "kitche
|
|
30 |
|
31 |
== Changelog ==
|
32 |
|
|
|
|
|
|
|
33 |
= 1.0.2 =
|
34 |
* Fixed editor save warning appearing for unchanged content when the table is at the bottom of the editor
|
35 |
* Minor code clean up
|
1 |
=== MCE Table Buttons ===
|
2 |
+
Contributors: jakemgold
|
3 |
+
Donate link: http://www.thinkoomph.com/plugins-modules/wordpress-mce-table-buttons/
|
4 |
Tags: tables, table, editor, WYSIWYG, buttons, tinymce
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 3.1
|
7 |
+
Stable tag: 1.0.3
|
8 |
|
9 |
Adds table editing buttons to a new, third row in the WordPress WYSIWYG editor.
|
10 |
|
30 |
|
31 |
== Changelog ==
|
32 |
|
33 |
+
= 1.0.3 =
|
34 |
+
* Code clean up, 3.1 testing
|
35 |
+
|
36 |
= 1.0.2 =
|
37 |
* Fixed editor save warning appearing for unchanged content when the table is at the bottom of the editor
|
38 |
* Minor code clean up
|