WordPress.org

Make WordPress Core

Ticket #7643: table-hotkeys.2.diff

File table-hotkeys.2.diff, 6.6 KB (added by nbachiyski, 6 years ago)

Rev 2: Better hightlight colour

  • wp-includes/script-loader.php

     
    7272        $scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' ); 
    7373        $scripts->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('jquery'), '1.1b'); 
    7474        $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20'); 
     75        $scripts->add( 'jquery-hotkeys', '/wp-includes/js/jquery/jquery.hotkeys.js', array('jquery'), '0.0.2' ); 
     76        $scripts->add( 'jquery-table-hotkeys', '/wp-includes/js/jquery/jquery.table-hotkeys.js', array('jquery', 'jquery-hotkeys'), '20080829' ); 
    7577        $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430'); 
    7678        $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2-20080430'); 
    7779        $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 
     
    224226 
    225227        $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); 
    226228 
    227         $styles->add( 'wp-admin', '/wp-admin/wp-admin.css' ); 
     229        $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20080829' ); 
    228230        $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); 
    229231 
    230232        $styles->add( 'ie', '/wp-admin/css/ie.css' ); 
  • wp-admin/edit-comments.php

     
    1212$title = __('Edit Comments'); 
    1313wp_enqueue_script( 'admin-comments' ); 
    1414wp_enqueue_script( 'admin-forms' ); 
     15wp_enqueue_script( 'jquery-table-hotkeys' ); 
    1516 
    1617if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) { 
    1718        check_admin_referer('bulk-comments'); 
  • wp-admin/wp-admin.css

     
    20792079.metabox-prefs label input { 
    20802080        margin: 0 5px 0 2px; 
    20812081} 
     2082 
     2083/* table vim shorcuts */ 
     2084.vim-current { 
     2085        background-color: #E4F2FD !important; 
     2086} 
     2087 No newline at end of file 
  • wp-admin/includes/template.php

     
    10161016        $actions = array(); 
    10171017 
    10181018        if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    1019                 $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . "</a> | "; 
    1020                 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . "</a> | "; 
     1019                $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . "</a> | "; 
     1020                $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . "</a> | "; 
    10211021                $actions['edit']      = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | '; 
    10221022                if ( 'spam' != $the_comment_status ) 
    1023                         $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 
    1024                 $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; 
     1023                        $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 
     1024                $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 
    10251025 
    10261026                if ( $comment_status ) { // not looking at all comments 
    10271027                        if ( 'approved' == $the_comment_status ) { 
    1028                                 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     1028                                $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
    10291029                                unset($actions['approve']); 
    10301030                        } else { 
    1031                                 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     1031                                $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    10321032                                unset($actions['unapprove']); 
    10331033                        } 
    10341034                } 
    10351035 
    10361036                if ( 'spam' != $the_comment_status ) 
    1037                         $actions['reply'] = '<span class="hide-if-no-js"> | <a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a></span>'; 
     1037                        $actions['reply'] = '<span class="hide-if-no-js"> | <a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a></span>'; 
    10381038 
    10391039                $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 
    10401040 
  • wp-admin/js/edit-comments.js

     
    235235$(document).ready(function(){ 
    236236        if ( typeof QTags != 'undefined' ) 
    237237                ed_reply = new QTags('ed_reply', 'replycontent', 'replycontainer', 'more'); 
     238        jQuery.table_hotkeys(jQuery('table.widefat'), ['a', 'u', 's', 'd', 'r']); 
    238239}); 
    239240 
    240241})(jQuery);