TinyMCE: add the <hr> plugin and button, see #27159
Built from https://develop.svn.wordpress.org/trunk@27428 git-svn-id: http://core.svn.wordpress.org/trunk@27275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
79441fc1c1
commit
f0bfa77a4a
@ -231,6 +231,7 @@ final class _WP_Editors {
|
|||||||
*/
|
*/
|
||||||
$plugins = array_unique( apply_filters( 'tiny_mce_plugins', array(
|
$plugins = array_unique( apply_filters( 'tiny_mce_plugins', array(
|
||||||
'charmap',
|
'charmap',
|
||||||
|
'hr',
|
||||||
'link',
|
'link',
|
||||||
'media',
|
'media',
|
||||||
'paste',
|
'paste',
|
||||||
@ -390,7 +391,7 @@ final class _WP_Editors {
|
|||||||
$mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
|
$mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
|
||||||
$mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
|
$mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
|
||||||
} else {
|
} else {
|
||||||
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'image', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
|
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
|
||||||
$mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id);
|
$mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id);
|
||||||
$mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
|
$mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
|
||||||
$mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
|
$mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
|
||||||
|
30
wp-includes/js/tinymce/plugins/hr/plugin.js
Normal file
30
wp-includes/js/tinymce/plugins/hr/plugin.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* plugin.js
|
||||||
|
*
|
||||||
|
* Copyright, Moxiecode Systems AB
|
||||||
|
* Released under LGPL License.
|
||||||
|
*
|
||||||
|
* License: http://www.tinymce.com/license
|
||||||
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*global tinymce:true */
|
||||||
|
|
||||||
|
tinymce.PluginManager.add('hr', function(editor) {
|
||||||
|
editor.addCommand('InsertHorizontalRule', function() {
|
||||||
|
editor.execCommand('mceInsertContent', false, '<hr />');
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.addButton('hr', {
|
||||||
|
icon: 'hr',
|
||||||
|
tooltip: 'Horizontal line',
|
||||||
|
cmd: 'InsertHorizontalRule'
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.addMenuItem('hr', {
|
||||||
|
icon: 'hr',
|
||||||
|
text: 'Horizontal line',
|
||||||
|
cmd: 'InsertHorizontalRule',
|
||||||
|
context: 'insert'
|
||||||
|
});
|
||||||
|
});
|
1
wp-includes/js/tinymce/plugins/hr/plugin.min.js
vendored
Normal file
1
wp-includes/js/tinymce/plugins/hr/plugin.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"<hr />")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user