Make WordPress Core

Changeset 8767


Ignore:
Timestamp:
08/29/2008 05:07:40 AM (18 years ago)
Author:
azaozz
Message:

Reply to comments from admin, small improvements and fixes, see #7435

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/colors-classic.css

    r8733 r8767  
    781781        border-bottom-color: #14568A;
    782782}
     783
     784#replydiv {
     785        border-color: #EBEBEB #CCC #CCC #EBEBEB;
     786        background-color: #fff;
     787}
     788
     789#replysubmit {
     790        background-color: #EAF3FA;
     791        border-top-color: #ddd;
     792}
     793
     794#replyerror {
     795        border-color: #ddd;
     796        background-color: #f8f8f8;
     797}
  • trunk/wp-admin/css/colors-fresh.css

    r8733 r8767  
    764764        border-bottom-color: #E4F2FD;
    765765}
     766
     767#replydiv {
     768        border-color: #EBEBEB #CCC #CCC #EBEBEB;
     769        background-color: #fff;
     770}
     771
     772#replysubmit {
     773        background-color: #EAF3FA;
     774        border-top-color: #ddd;
     775}
     776
     777#replyerror {
     778        border-color: #ddd;
     779        background-color: #f8f8f8;
     780}
  • trunk/wp-admin/edit-comments.php

    r8765 r8767  
    1313wp_enqueue_script( 'admin-comments' );
    1414wp_enqueue_script( 'admin-forms' );
    15 wp_enqueue_script( 'quicktags' );
    1615
    1716if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) {
  • trunk/wp-admin/edit-form-advanced.php

    r8732 r8767  
    334334?>
    335335<p>
    336         <input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label>
     336        <label for="post_status_private2" class="selectit"><input id="post_status_private2" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label>
    337337</p>
    338338<h4><?php _e( 'Post Password' ); ?></h4>
  • trunk/wp-admin/edit-page-form.php

    r8757 r8767  
    300300</p>
    301301<?php if ( current_user_can( 'publish_posts' ) ) : ?>
    302 <p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
     302<p><label for="post_status_private2" class="selectit"><input id="post_status_private2" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
    303303<?php endif; ?>
    304304
  • trunk/wp-admin/edit.php

    r8720 r8767  
    5454list($post_stati, $avail_post_stati) = wp_edit_posts_query();
    5555
    56 if ( 1 == count($posts) && is_singular() ) {
     56if ( 1 == count($posts) && is_singular() )
    5757        wp_enqueue_script( 'admin-comments' );
    58         wp_enqueue_script( 'quicktags' );
    59 }
    6058
    6159require_once('admin-header.php');
  • trunk/wp-admin/includes/template.php

    r8765 r8767  
    10821082        <h3 class="info-box-title"><?php _e('Comment Reply Error'); ?></h3>
    10831083        <p id="replyerrtext"></p>
    1084         <p class="submit"><button id="close-button" onclick="commentReply.close();" class="button"><?php _e('Close'); ?></button></p>
     1084        <p class="submit"><button id="close-button" onclick="commentReply.close();" class="button"><?php _e('Close'); ?></button>
     1085        <button id="back-button" onclick="commentReply.back();" class="button"><?php _e('Go back'); ?></button></p>
    10851086        </div>
    10861087       
    … …  
    10981099        <?php wp_comment_form_unfiltered_html_nonce(); ?>
    10991100
    1100         <div id="replycontainer"><textarea rows="5" cols="50" name="replycontent" tabindex="10" id="replycontent"></textarea></div>
     1101        <?php echo apply_filters( 'wp_comment_reply_content', '
     1102        <div id="replycontainer"><textarea rows="5" cols="40" name="replycontent" tabindex="10" id="replycontent"></textarea></div>
     1103        '); ?>
    11011104
    11021105        <p id="replysubmit"><input type="button" onclick="commentReply.close();" class="button" value="<?php _e('Cancel'); ?>" />
  • trunk/wp-admin/js/edit-comments.js

    r8720 r8767  
    11var theList; var theExtraList;
    2 jQuery(function($) {
    3 
    4 var dimAfter = function( r, settings ) {
    5         $('li span.comment-count').each( function() {
    6                 var a = $(this);
    7                 var n = parseInt(a.html(),10);
    8                 n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
    9                 if ( n < 0 ) { n = 0; }
    10                 a.html( n.toString() );
    11                 $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    12         });
    13         $('.post-com-count span.comment-count').each( function() {
    14                 var a = $(this);
    15                 var n = parseInt(a.html(),10);
    16                 var t = parseInt(a.parent().attr('title'), 10);
    17                 if ( $('#' + settings.element).is('.unapproved') ) { // we unapproved a formerly approved comment
    18                         n = n - 1;
    19                         t = t + 1;
    20                 } else { // we approved a formerly unapproved comment
    21                         n = n + 1;
    22                         t = t - 1;
    23                 }
    24                 if ( n < 0 ) { n = 0; }
    25                 if ( t < 0 ) { t = 0; }
    26                 if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); }
    27                 if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); }
    28                 a.html( n.toString() );
    29         });
    30 }
    31 
    32 var delAfter = function( r, settings ) {
    33         $('li span.comment-count').each( function() {
    34                 var a = $(this);
    35                 var n = parseInt(a.html(),10);
    36                 if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
    37                         n = n - 1;
    38                 } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
    39                         n = n + 1;
    40                 }
    41                 if ( n < 0 ) { n = 0; }
    42                 a.html( n.toString() );
    43                 $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    44         });
    45         $('.post-com-count span.comment-count').each( function() {
    46                 var a = $(this);
    47                 if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
     2(function($) {
     3
     4setCommentsList = function() {
     5        var dimAfter = function( r, settings ) {
     6                $('li span.comment-count').each( function() {
     7                        var a = $(this);
     8                        var n = parseInt(a.html(),10);
     9                        n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
     10                        if ( n < 0 ) { n = 0; }
     11                        a.html( n.toString() );
     12                        $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
     13                });
     14                $('.post-com-count span.comment-count').each( function() {
     15                        var a = $(this);
     16                        var n = parseInt(a.html(),10);
    4817                        var t = parseInt(a.parent().attr('title'), 10);
    49                         if ( t < 1 ) { return; }
    50                         t = t - 1;
    51                         a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) );
     18                        if ( $('#' + settings.element).is('.unapproved') ) { // we unapproved a formerly approved comment
     19                                n = n - 1;
     20                                t = t + 1;
     21                        } else { // we approved a formerly unapproved comment
     22                                n = n + 1;
     23                                t = t - 1;
     24                        }
     25                        if ( n < 0 ) { n = 0; }
     26                        if ( t < 0 ) { t = 0; }
     27                        if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); }
    5228                        if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); }
     29                        a.html( n.toString() );
     30                });
     31        };
     32       
     33        var delAfter = function( r, settings ) {
     34                $('li span.comment-count').each( function() {
     35                        var a = $(this);
     36                        var n = parseInt(a.html(),10);
     37                        if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
     38                                n = n - 1;
     39                        } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
     40                                n = n + 1;
     41                        }
     42                        if ( n < 0 ) { n = 0; }
     43                        a.html( n.toString() );
     44                        $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
     45                });
     46                $('.post-com-count span.comment-count').each( function() {
     47                        var a = $(this);
     48                        if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
     49                                var t = parseInt(a.parent().attr('title'), 10);
     50                                if ( t < 1 ) { return; }
     51                                t = t - 1;
     52                                a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) );
     53                                if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); }
     54                                return;
     55                        }
     56                        var n = parseInt(a.html(),10) - 1;
     57                        a.html( n.toString() );
     58                });
     59                $('li span.spam-comment-count' ).each( function() {
     60                        var a = $(this);
     61                        var n = parseInt(a.html(),10);
     62                        if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam
     63                                n = n + 1;
     64                        } else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam
     65                                n = n - 1;
     66                        }
     67                        if ( n < 0 ) { n = 0; }
     68                        a.html( n.toString() );
     69                });
     70       
     71                if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
    5372                        return;
    5473                }
    55                 var n = parseInt(a.html(),10) - 1;
    56                 a.html( n.toString() );
    57         });
    58         $('li span.spam-comment-count' ).each( function() {
    59                 var a = $(this);
    60                 var n = parseInt(a.html(),10);
    61                 if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam
    62                         n = n + 1;
    63                 } else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam
    64                         n = n - 1;
    65                 }
    66                 if ( n < 0 ) { n = 0; }
    67                 a.html( n.toString() );
    68         });
    69 
    70         if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
    71                 return;
    72         }
    73 
    74         theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
    75         $('#get-extra-comments').submit();
    76 }
    77 
    78 theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
    79 theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } );
    80 
     74       
     75                theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
     76                $('#get-extra-comments').submit();
     77        };
     78
     79        theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
     80        theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } );
     81};
     82
     83$(document).ready(function(){
     84        setCommentsList();
    8185});
     86
     87})(jQuery);
    8288
    8389(function($){
    … …  
    9399                }
    94100
    95                 $('#replydiv').show();
    96101                $('#replydiv #comment_post_ID').val(p);
    97102                $('#replydiv #comment_ID').val(c);
    … …  
    100105                        handle : '#replyhandle',
    101106                        containment : '#wpwrap'
    102                 });
    103 
    104                 $('#replydiv').resizable({
     107                }).resizable({
    105108                        handles : 'se',
    106109                        minHeight : 200,
    … …  
    128131                        'top' : top,
    129132                        'left' : left
    130                 });
     133                }).show();
    131134
    132135                $('#replycontent').focus().keyup(function(e){
    … …  
    196199                        .animate( { backgroundColor:"#CFEBF7" }, 600 )
    197200                        .animate( { backgroundColor:"transparent" }, 600 );
     201               
     202                setCommentsList();
    198203        },
    199204
    … …  
    218223                        });
    219224                }
     225        },
     226       
     227        back : function() {
     228                if ( $('#replydiv').is(':hidden') && $('#replyerror').is(':visible') ) {
     229                        $('#replyerror').hide();
     230                        $('#replydiv').show();
     231                }
    220232        }
    221 }
     233};
    222234
    223235$(document).ready(function(){
  • trunk/wp-admin/upload.php

    r8720 r8767  
    1111add_thickbox();
    1212wp_enqueue_script( 'media-upload' );
    13 wp_enqueue_script( 'quicktags' );
    1413
    1514if (!current_user_can('upload_files'))
  • trunk/wp-admin/wp-admin.css

    r8733 r8767  
    19181918#replydiv {
    19191919        width: 700px;
    1920         border-color: #EBEBEB #CCC #CCC #EBEBEB;
    19211920        border-width: 1px;
    19221921        border-style: solid;
    19231922        padding: 2px;
    1924         background-color: #fff;
    19251923        left: 20px;
    1926         top: 300px;
     1924        top: 200px;
     1925        z-index: 100;
    19271926}
    19281927
    … …  
    19341933        margin: 0;
    19351934        padding: 3px 5px;
    1936         background-color: #EAF3FA;
    1937         border-top: 1px solid #ddd;
     1935        border-top-width: 1px;
     1936        border-top-style: solid;
     1937}
     1938
     1939#replysubmit .button,
     1940#replyerror .button {
     1941        margin-right: 5px;
    19381942}
    19391943
    … …  
    19741978
    19751979#replyerror {
    1976         border: 5px solid #ddd;
    1977         background-color: #f8f8f8;
     1980        border-width: 5px;
     1981        border-style: solid;
    19781982        position: absolute;
    19791983        padding: 15px 15px 10px;
    … …  
    20292033
    20302034#edit-settings {
    2031         padding: 28px 0 0;
     2035        padding: 29px 0 0;
    20322036        margin: 0 0 20px;
    20332037}
    … …  
    20422046        -moz-border-radius: 4px 0 4px 4px;
    20432047        -khtml-border-radius: 4px;
     2048        -khtml-border-top-right-radius: 0;
    20442049        -webkit-border-radius: 4px;
    2045         border-radius: 4px 0 4px 4px;
     2050        -webkit-border-top-right-radius: 0;
     2051        border-radius: 4px;
     2052        border-top-right-radius: 0;
    20462053        border-width: 1px;
    20472054        border-style: solid;
    20482055}
    20492056
    2050 .show-settings-opened {
     2057#show-settings.show-settings-opened {
    20512058        -moz-border-radius: 4px 4px 0 0;
    2052         -khtml-border-radius: 4px;
    2053         -webkit-border-radius: 4px;
    2054         border-radius: 4px 4px 0 0;
     2059        -webkit-border-bottom-left-radius: 0;
     2060        -webkit-border-bottom-right-radius: 0;
     2061        -khtml-border-bottom-left-radius: 0;
     2062        -khtml-border-bottom-right-radius: 0;
     2063        border-bottom-left-radius: 0;
     2064        border-bottom-right-radius: 0;
    20552065}
    20562066
  • trunk/wp-includes/script-loader.php

    r8760 r8767  
    125125                        'strong' => __('Strong')
    126126                ) );
    127                 $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-draggable', 'jquery-ui-resizable'), '20080821' );
     127                $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-draggable', 'jquery-ui-resizable', 'quicktags'), '20080828' );
    128128                $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
    129129                        'pending' => __('%i% pending') // must look like: "# blah blah"
Note: See TracChangeset for help on using the changeset viewer.