Ticket #32395: 32395.6.diff
File 32395.6.diff, 21.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/list-tables.css
428 428 content: '\f140'; 429 429 } 430 430 431 .wp-list-table .toggle-row { 432 position: absolute; 433 right: 8px; 434 top: 10px; 435 display: none; 436 padding: 0; 437 width: 40px; 438 height: 40px; 439 border: none; 440 outline: none; 441 background: transparent; 442 } 443 444 .wp-list-table .toggle-row:hover { 445 cursor: pointer; 446 } 447 448 .wp-list-table .toggle-row:focus { 449 -webkit-box-shadow: 450 0 0 0 1px #5b9dd9, 451 0 0 2px 1px rgba(30, 140, 190, .8); 452 box-shadow: 453 0 0 0 1px #5b9dd9, 454 0 0 2px 1px rgba(30, 140, 190, .8); 455 } 456 457 .ie8 .wp-list-table .toggle-row:focus { 458 outline: #5b9dd9 solid 1px; 459 } 460 461 .wp-list-table .toggle-row:active { 462 -webkit-box-shadow: none; 463 box-shadow: none; 464 } 465 466 .wp-list-table .toggle-row:before { 467 position: absolute; 468 top: 0; 469 left: 10px; 470 display: block; 471 padding: 0; 472 color: #666; 473 content: '\f140'; 474 font: normal 20px/1 'dashicons'; 475 line-height: 10px; 476 -webkit-font-smoothing: antialiased; 477 -moz-osx-font-smoothing: grayscale; 478 speak: none; 479 } 480 481 .wp-list-table .is-expanded .toggle-row:before { 482 content: '\f142'; 483 } 484 431 485 tr.wp-locked .locked-indicator { 432 486 margin-left: 6px; 433 487 height: 20px; … … 1676 1730 font-size: 14px; 1677 1731 } 1678 1732 1679 /* Columns to hide */ 1680 .fixed .column-date, 1681 .fixed .column-author, 1682 .column-categories, 1683 .column-tags, 1684 .tags .column-description, 1685 .media .column-parent, 1686 .media .column-comments, 1687 .users .column-email, 1688 .users .column-name, 1689 .sites .column-registered, 1690 .sites .column-users { 1733 .wp-list-table th:not(.column-primary), 1734 .wp-list-table th:not(.column-primary), 1735 .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary):not(.check-column) { 1691 1736 display: none; 1692 1737 } 1693 1738 1739 /* Checkboxes need to show */ 1740 .wp-list-table tr th.check-column { 1741 display: table-cell; 1742 width: 35px; 1743 } 1744 1745 .wp-list-table .toggle-row { 1746 display: block; 1747 } 1748 1749 .wp-list-table tr:not(.inline-edit-row) td:not(.check-column) { 1750 position: relative; 1751 clear: both; 1752 display: block; 1753 width: auto !important; /* needs to override some columns that are more specifically targeted */ 1754 } 1755 1756 .wp-list-table td.column-primary { 1757 padding-right: 50px; /* space for toggle button */ 1758 } 1759 1760 .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary):not(.check-column) { 1761 padding: 3px 8px 3px 35% !important; /* space for the label */ 1762 } 1763 1764 .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary)::before { 1765 position: absolute; 1766 left: 10px; /* match padding of regular table cell */ 1767 display: block; 1768 overflow: hidden; 1769 width: 32%; /* leave a little space for a gutter */ 1770 content: attr(data-colname); 1771 white-space: nowrap; 1772 text-overflow: ellipsis; 1773 } 1774 1775 .wp-list-table .is-expanded td:not(.hidden) { 1776 display: block !important; 1777 overflow: hidden; /* clearfix */ 1778 } 1779 1780 /* Special cases */ 1781 .widefat .num, 1782 .column-posts { 1783 text-align: left; 1784 } 1785 1786 #comments-form .fixed .column-author { 1787 display: none !important; 1788 } 1789 1694 1790 .fixed .column-comment .comment-author { 1695 1791 display: block; 1696 1792 } 1697 1793 1698 /* Posts */1699 .column-title {1700 width: 85%;1794 #the-comment-list .is-expanded td { 1795 -webkit-box-shadow: none; 1796 box-shadow: none; 1701 1797 } 1702 1798 1703 .fixed .column-comments, .widefat .check-column { 1704 width: 35px 1799 #the-comment-list .is-expanded td:last-child { 1800 -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1); 1801 box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1); 1705 1802 } 1706 1803 1707 1804 .widefat thead .check-column, .widefat tfoot .check-column { … … 1712 1809 word-wrap: normal; 1713 1810 } 1714 1811 1715 /* Media */1716 .media .column-title {1717 width: auto;1718 }1719 1720 1812 /* Quick Edit and Bulk Edit */ 1721 1813 #wpbody-content .quick-edit-row-post .inline-edit-col-left, 1722 1814 #wpbody-content .quick-edit-row-post .inline-edit-col-right, … … 1792 1884 height: 22px; 1793 1885 } 1794 1886 1795 /* Taxonomies */1796 .tags .column-posts {1797 width: 74px;1798 }1799 1800 .tags .column-slug {1801 width: 30%;1802 }1803 1804 /* Comments */1805 .comments .column-response {1806 width: 35%;1807 }1808 1809 /* Users */1810 .users .column-role {1811 width: 35%;1812 }1813 1814 /* Network admin sites */1815 .sites .column-blogname {1816 width: 55%;1817 }1818 1819 1887 /* Updates */ 1820 1888 #wpbody-content #update-themes-table .plugin-title { 1821 1889 width: auto; -
src/wp-admin/includes/class-wp-comments-list-table.php
395 395 $this->display_tablenav( 'top' ); 396 396 397 397 ?> 398 <table class=" <?php echo implode( ' ', $this->get_table_classes() ); ?>">398 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> 399 399 <thead> 400 400 <tr> 401 401 <?php $this->print_column_headers(); ?> … … 466 466 return; 467 467 } 468 468 469 if ( $primary !== $column_name ) { 470 return ''; 471 } 472 469 473 $post = get_post(); 470 474 471 475 $the_comment_status = wp_get_comment_status( $comment->comment_ID ); 472 476 473 477 $out = ''; 474 478 475 if ( $primary === $column_name ) { 476 $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); 477 $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); 479 $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); 480 $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); 478 481 479 482 $url = "comment.php?c=$comment->comment_ID"; 480 483 481 482 483 484 485 486 487 484 $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" ); 485 $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" ); 486 $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" ); 487 $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" ); 488 $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" ); 489 $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" ); 490 $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" ); 488 491 489 490 491 492 493 494 495 496 497 492 // Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash. 493 $actions = array( 494 'approve' => '', 'unapprove' => '', 495 'reply' => '', 496 'quickedit' => '', 497 'edit' => '', 498 'spam' => '', 'unspam' => '', 499 'trash' => '', 'untrash' => '', 'delete' => '' 500 ); 498 501 499 // Not looking at all comments. 500 if ( $comment_status && 'all' != $comment_status ) { 501 if ( 'approved' == $the_comment_status ) { 502 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 503 } elseif ( 'unapproved' == $the_comment_status ) { 504 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 505 } 506 } else { 507 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 508 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 502 // Not looking at all comments. 503 if ( $comment_status && 'all' != $comment_status ) { 504 if ( 'approved' == $the_comment_status ) { 505 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 506 } elseif ( 'unapproved' == $the_comment_status ) { 507 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 509 508 } 509 } else { 510 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 511 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 512 } 510 513 511 512 513 514 515 514 if ( 'spam' != $the_comment_status ) { 515 $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>'; 516 } elseif ( 'spam' == $the_comment_status ) { 517 $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>'; 518 } 516 519 517 518 519 520 if ( 'trash' == $the_comment_status ) { 521 $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive'>" . __( 'Restore' ) . '</a>'; 522 } 520 523 521 522 523 524 525 524 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) { 525 $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>'; 526 } else { 527 $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>'; 528 } 526 529 527 528 530 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { 531 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>'; 529 532 530 533 $format = '<a data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s" title="%s" href="#">%s</a>'; 531 534 532 535 $actions['quickedit'] = sprintf( $format, $comment->comment_ID, $post->ID, 'edit', 'vim-q comment-inline',esc_attr__( 'Edit this item inline' ), __( 'Quick Edit' ) ); 533 536 534 535 537 $actions['reply'] = sprintf( $format, $comment->comment_ID, $post->ID, 'replyto', 'vim-r comment-inline', esc_attr__( 'Reply to this comment' ), __( 'Reply' ) ); 538 } 536 539 537 538 540 /** This filter is documented in wp-admin/includes/dashboard.php */ 541 $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment ); 539 542 540 541 542 543 544 543 $i = 0; 544 $out .= '<div class="row-actions">'; 545 foreach ( $actions as $action => $link ) { 546 ++$i; 547 ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; 545 548 546 547 548 549 550 551 552 553 554 549 // Reply and quickedit need a hide-if-no-js span when not added with ajax 550 if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') ) 551 $action .= ' hide-if-no-js'; 552 elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) { 553 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) 554 $action .= ' approve'; 555 else 556 $action .= ' unapprove'; 557 } 555 558 556 $out .= "<span class='$action'>$sep$link</span>"; 557 } 558 $out .= '</div>'; 559 $out .= "<span class='$action'>$sep$link</span>"; 559 560 } 561 $out .= '</div>'; 560 562 563 $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>'; 564 561 565 return $out; 562 566 } 563 567 -
src/wp-admin/includes/class-wp-list-table.php
497 497 } 498 498 $out .= '</div>'; 499 499 500 $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>'; 501 500 502 return $out; 501 503 } 502 504 … … 943 945 * @param bool $with_id Whether to set the id attribute or not 944 946 */ 945 947 public function print_column_headers( $with_id = true ) { 946 list( $columns, $hidden, $sortable ) = $this->get_column_info();948 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 947 949 948 950 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 949 951 $current_url = remove_query_arg( 'paged', $current_url ); … … 977 979 elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) 978 980 $class[] = 'num'; 979 981 982 if ( $column_key === $primary ) { 983 $class[] = 'column-primary'; 984 } 985 980 986 if ( isset( $sortable[$column_key] ) ) { 981 987 list( $orderby, $desc_first ) = $sortable[$column_key]; 982 988 … … 1163 1169 $classes .= ' hidden'; 1164 1170 } 1165 1171 1166 $attributes = "class='$classes'"; 1172 // Comments column uses HTML in the display name with screen reader text. 1173 // Instead of using esc_attr(), we strip tags to get closer to a user-friendly string. 1174 $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"'; 1167 1175 1176 $attributes = "class='$classes' $data"; 1177 1168 1178 if ( 'cb' == $column_name ) { 1169 1179 echo '<th scope="row" class="check-column">'; 1170 1180 echo $this->column_cb( $item ); -
src/wp-admin/includes/class-wp-ms-sites-list-table.php
403 403 $classes .= ' hidden'; 404 404 } 405 405 406 $ attributes = "class='$classes'";406 $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"'; 407 407 408 $attributes = "class='$classes' $data"; 409 408 410 if ( 'cb' === $column_name ) { 409 411 echo '<th scope="row" class="check-column">'; 410 412 -
src/wp-admin/includes/class-wp-ms-users-list-table.php
336 336 $classes .= ' hidden'; 337 337 } 338 338 339 $ attributes = "class='$classes'";339 $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"'; 340 340 341 $attributes = "class='$classes' $data"; 342 341 343 if ( 'cb' === $column_name ) { 342 344 echo '<th scope="row" class="check-column">'; 343 345 -
src/wp-admin/includes/class-wp-posts-list-table.php
973 973 $classes .= ' hidden'; 974 974 } 975 975 976 $attributes = "class='$classes'"; 976 // Comments column uses HTML in the display name with screen reader text. 977 // Instead of using esc_attr(), we strip tags to get closer to a user-friendly string. 978 $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"'; 977 979 980 $attributes = "class='$classes' $data"; 981 978 982 if ( 'cb' === $column_name ) { 979 983 echo '<th scope="row" class="check-column">'; 980 984 -
src/wp-admin/includes/class-wp-users-list-table.php
419 419 $classes .= ' hidden'; 420 420 } 421 421 422 $ attributes = "class='$classes'";422 $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"'; 423 423 424 $attributes = "class='$classes' $data"; 425 424 426 if ( 'cb' === $column_name ) { 425 427 $r .= "<th scope='row' class='check-column'>$checkbox</th>"; 426 428 } else { -
src/wp-admin/js/common.js
487 487 } 488 488 }, 'td.has-row-actions' ); 489 489 490 // Toggle list table rows on small screens 491 $( 'tbody' ).on( 'click', '.toggle-row', function() { 492 $( this ).closest( 'tr' ).toggleClass( 'is-expanded' ); 493 }); 494 490 495 $('#default-password-nag-no').click( function() { 491 496 setUserSetting('default_password_nag', 'hide'); 492 497 $('div.default-password-nag').hide(); -
src/wp-admin/js/inline-edit-post.js
133 133 editRow = $('#inline-edit').clone(true); 134 134 $('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length); 135 135 136 $(t.what+id). hide().after(editRow).after('<tr class="hidden"></tr>');136 $(t.what+id).removeClass('is-expanded').hide().after(editRow).after('<tr class="hidden"></tr>'); 137 137 138 138 // populate the data 139 139 rowData = $('#inline_'+id);