Add hotkeys.js to all pages that list comments and prevent error if not loaded, see #7643
git-svn-id: https://develop.svn.wordpress.org/trunk@8780 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c6f94a0dd4
commit
8dfe80eefb
@ -66,8 +66,10 @@ $query_str = "post_type=page&orderby=menu_order title&what_to_show=posts$post_st
|
|||||||
$query_str = apply_filters('manage_pages_query', $query_str);
|
$query_str = apply_filters('manage_pages_query', $query_str);
|
||||||
wp($query_str);
|
wp($query_str);
|
||||||
|
|
||||||
if ( is_singular() )
|
if ( is_singular() ) {
|
||||||
wp_enqueue_script( 'admin-comments' );
|
wp_enqueue_script( 'admin-comments' );
|
||||||
|
wp_enqueue_script( 'jquery-table-hotkeys' );
|
||||||
|
}
|
||||||
|
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
|
|
||||||
|
@ -53,8 +53,10 @@ wp_enqueue_script('admin-forms');
|
|||||||
|
|
||||||
list($post_stati, $avail_post_stati) = wp_edit_posts_query();
|
list($post_stati, $avail_post_stati) = wp_edit_posts_query();
|
||||||
|
|
||||||
if ( 1 == count($posts) && is_singular() )
|
if ( 1 == count($posts) && is_singular() ) {
|
||||||
wp_enqueue_script( 'admin-comments' );
|
wp_enqueue_script( 'admin-comments' );
|
||||||
|
wp_enqueue_script( 'jquery-table-hotkeys' );
|
||||||
|
}
|
||||||
|
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
|
|
||||||
|
@ -235,7 +235,8 @@ commentReply = {
|
|||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
if ( typeof QTags != 'undefined' )
|
if ( typeof QTags != 'undefined' )
|
||||||
ed_reply = new QTags('ed_reply', 'replycontent', 'replycontainer', 'more');
|
ed_reply = new QTags('ed_reply', 'replycontent', 'replycontainer', 'more');
|
||||||
jQuery.table_hotkeys(jQuery('table.widefat'), ['a', 'u', 's', 'd', 'r']);
|
if ( typeof $.table_hotkeys != 'undefined' )
|
||||||
|
$.table_hotkeys($('table.widefat'), ['a', 'u', 's', 'd', 'r']);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
@ -131,6 +131,7 @@ case 'edit':
|
|||||||
wp_enqueue_script('media-upload');
|
wp_enqueue_script('media-upload');
|
||||||
wp_enqueue_script('word-count');
|
wp_enqueue_script('word-count');
|
||||||
wp_enqueue_script( 'admin-comments' );
|
wp_enqueue_script( 'admin-comments' );
|
||||||
|
wp_enqueue_script( 'jquery-table-hotkeys' );
|
||||||
|
|
||||||
if ( current_user_can('edit_post', $post_ID) ) {
|
if ( current_user_can('edit_post', $post_ID) ) {
|
||||||
if ( $last = wp_check_post_lock( $post->ID ) ) {
|
if ( $last = wp_check_post_lock( $post->ID ) ) {
|
||||||
|
@ -51,8 +51,10 @@ wp_enqueue_script( 'admin-forms' );
|
|||||||
|
|
||||||
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
|
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
|
||||||
|
|
||||||
if ( is_singular() )
|
if ( is_singular() ) {
|
||||||
wp_enqueue_script( 'admin-comments' );
|
wp_enqueue_script( 'admin-comments' );
|
||||||
|
wp_enqueue_script( 'jquery-table-hotkeys' );
|
||||||
|
}
|
||||||
|
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user