WordPress.org

Make WordPress Core

Ticket #43587: 43587.diff

File 43587.diff, 6.6 KB (added by nfmohit, 19 months ago)
  • wp-admin/css/common.css

    diff --git wp-admin/css/common.css wp-admin/css/common.css
    index cbae1c5..61afdc5 100644
    html.wp-toolbar { 
    21112111#pass-strength-result.short,
    21122112#ed_reply_toolbar #ed_reply_strong,
    21132113.item-controls .item-order a,
    2114 .feature-filter .feature-name {
     2114.feature-filter .feature-name, #comment-status-display {
    21152115        font-weight: 600;
    21162116}
    21172117
  • wp-admin/css/edit.css

    diff --git wp-admin/css/edit.css wp-admin/css/edit.css
    index 9c7c257..af9b7e7 100644
    form#tags-filter { 
    448448#post-body #visibility:before,
    449449.curtime #timestamp:before,
    450450#post-body .misc-pub-revisions:before,
    451 span.wp-media-buttons-icon:before {
     451span.wp-media-buttons-icon:before,
     452#post-body .misc-pub-response-to:before,
     453#post-body .misc-pub-comment-status:before {
    452454        color: #82878c;
    453455}
    454456
    455457#post-body .misc-pub-post-status:before,
    456458#post-body #visibility:before,
    457459.curtime #timestamp:before,
    458 #post-body .misc-pub-revisions:before {
     460#post-body .misc-pub-revisions:before,
     461#post-body .misc-pub-response-to:before,
     462#post-body .misc-pub-comment-status:before {
    459463        font: normal 20px/1 dashicons;
    460464        speak: none;
    461465        display: inline-block;
    span.wp-media-buttons-icon:before { 
    466470        -moz-osx-font-smoothing: grayscale;
    467471}
    468472
    469 #post-body .misc-pub-post-status:before {
     473#post-body .misc-pub-post-status:before,
     474#post-body .misc-pub-comment-status:before {
    470475        content: "\f173";
    471476}
    472477
    span.wp-media-buttons-icon:before { 
    484489        content: "\f321";
    485490}
    486491
     492#post-body .misc-pub-response-to:before {
     493        content: "\f101";
     494}
     495
    487496#timestampdiv {
    488497        padding-top: 5px;
    489498        line-height: 23px;
    span.wp-media-buttons-icon:before { 
    607616        line-height: 1.4;
    608617}
    609618
     619#poststuff .stuffbox > h2 {
     620    border-bottom: 1px solid #eee;
     621}
     622
    610623#poststuff .inside {
    611624        margin: 6px 0 0 0;
    612625}
    span.wp-media-buttons-icon:before { 
    630643        font-weight: 600;
    631644}
    632645
    633 #post-visibility-select {
     646#post-visibility-select,
     647#comment-status-select {
    634648        line-height: 1.5em;
    635649        margin-top: 3px;
    636650}
  • wp-admin/edit-form-comment.php

    diff --git wp-admin/edit-form-comment.php wp-admin/edit-form-comment.php
    index e043908..765e2e1 100644
    if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ 
    8181
    8282<div id="postbox-container-1" class="postbox-container">
    8383<div id="submitdiv" class="stuffbox" >
    84 <h2><?php _e( 'Status' ); ?></h2>
     84<h2><?php _e( 'Save' ); ?></h2>
    8585<div class="inside">
    8686<div class="submitbox" id="submitcomment">
    8787<div id="minor-publishing">
    8888
    8989<div id="misc-publishing-actions">
    9090
    91 <fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
    92 <legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
    93 <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
    94 <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
    95 <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
    96 </fieldset>
     91<div class="misc-pub-section misc-pub-comment-status" id="comment-status">
     92<?php _e( 'Status:' ); ?> <span id="comment-status-display">
     93                        <?php
     94
     95                        switch ( $comment->comment_approved ) {
     96                                case '1':
     97                                        _e( 'Approved' );
     98                                        break;
     99                                case '0':
     100                                        _e( 'Pending' );
     101                                        break;
     102                                case 'spam':
     103                                        _e( 'Spam' );
     104                                        break;
     105                        }
     106?>
     107</span>
     108<a href="#comment-status" class="edit-comment-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit Comment Status' ); ?></span></a>
     109
     110<div id="comment-status-select" class="hide-if-js">
     111        <fieldset>
     112                <legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
     113                <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
     114                <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
     115                <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
     116        </fieldset>
     117<p>
     118        <a href="#comment-status" class="save-comment-status hide-if-no-js button"><?php _e( 'OK' ); ?></a>
     119        <a href="#comment-status" class="cancel-comment-status hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
     120</p>
     121</div>
     122
     123</div><!-- .misc-pub-section -->
    97124
    98125<div class="misc-pub-section curtime misc-pub-curtime">
    99126<?php
  • wp-admin/js/comment.js

    diff --git wp-admin/js/comment.js wp-admin/js/comment.js
    index 6308d8e..2356ccf 100644
    jQuery(document).ready( function($) { 
    1111
    1212        postboxes.add_postbox_toggles('comment');
    1313
     14        // Comment Status
     15
     16        var $commentStatusSelect = $('#comment-status-select');
     17
     18        if ( $('#submitdiv').length ) {
     19                commentStatus = $('#comment-status-display').html();
     20                       
     21
     22                // Show the comment status options and hide the toggle button when opened.
     23                $( '#comment-status .edit-comment-status').click( function( e ) {
     24                        e.preventDefault();
     25                        if ( $commentStatusSelect.is(':hidden') ) {
     26                                $commentStatusSelect.slideDown( 'fast', function() {
     27                                        $commentStatusSelect.find( 'input[type="radio"]' ).first().focus();
     28                                } );
     29                                $(this).hide();
     30                        }
     31                });
     32
     33                // Cancel comment status selection area and hide it from view.
     34                $commentStatusSelect.find('.cancel-comment-status').click( function( event ) {
     35                        $commentStatusSelect.slideUp('fast');
     36                        $('#comment-status-display').html(commentStatus);
     37                        $('#comment-status .edit-comment-status').show().focus();
     38                        event.preventDefault();
     39                });
     40
     41                // Set the selected comment status as current.
     42                $commentStatusSelect.find('.save-comment-status').click( function( event ) {
     43                        $commentStatusSelect.slideUp('fast');
     44                        $('#comment-status .edit-comment-status').show().focus();
     45
     46                        $('#comment-status-display').html( $commentStatusSelect.find('input:radio:checked').parent().text() );
     47
     48                        event.preventDefault();
     49                });
     50
     51        };
     52
    1453        var $timestampdiv = $('#timestampdiv'),
    1554                $timestamp = $( '#timestamp' ),
    1655                stamp = $timestamp.html(),
    jQuery(document).ready( function($) { 
    94133                $edittimestamp.show().focus();
    95134                $timestampdiv.slideUp( 'fast' );
    96135        });
     136
    97137});