From a855814939540a5bb3081ac99cb652716a2f1fde Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 22 Sep 2006 22:24:50 +0000 Subject: [PATCH] Tabbed editor fixes from skeltoac. #2829 git-svn-id: http://svn.automattic.com/wordpress/trunk@4210 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 10 ---------- wp-admin/comment.php | 3 +-- wp-includes/general-template.php | 13 +++++++++++-- .../js/tinymce/plugins/wordpress/editor_plugin.js | 9 ++++++++- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 738b57b82..71b1f9222 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1963,16 +1963,6 @@ function wp_import_handle_upload() { return array('file' => $file, 'id' => $id); } -function user_can_richedit() { - if ( 'true' != get_user_option('rich_editing') ) - return false; - - if ( preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) ) - return false; - - return true; // Best guess -} - function the_attachment_links($id = false) { $id = (int) $id; $post = & get_post($id); diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 94e2f48eb..1610e3008 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -12,8 +12,7 @@ if ( isset( $_POST['deletecomment'] ) ) switch($action) { case 'editcomment': $title = __('Edit Comment'); - if ( user_can_richedit() ) - wp_enqueue_script( 'wp_tiny_mce' ); + require_once ('admin-header.php'); $comment = (int) $_GET['comment']; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index c4c2627e2..6436b4b5f 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -735,6 +735,15 @@ function noindex() { echo "\n"; } +function user_can_richedit() { + $can = true; + + if ( 'true' != get_user_option('rich_editing') || preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) ) + $can = false; + + return apply_filters('user_can_richedit', $can); +} + function the_editor($content, $id = 'content', $prev_id = 'title') { $rows = get_option('default_post_edit_rows'); if (($rows < 3) || ($rows > 100)) @@ -747,11 +756,11 @@ function the_editor($content, $id = 'content', $prev_id = 'title') { // The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it. ?> - +