Changeset 9098

Show
Ignore:
Timestamp:
10/08/08 01:18:16 (2 months ago)
Author:
azaozz
Message:

Convert the comment reply popup to a temp table row for consistency, add Quick Edit for comments, see #7435

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-ajax.php

    r9083 r9098  
    445445        $comment_author_email = $wpdb->escape($user->user_email); 
    446446        $comment_author_url   = $wpdb->escape($user->user_url); 
    447         $comment_content      = trim($_POST['comment']); 
     447        $comment_content      = trim($_POST['content']); 
    448448        if ( current_user_can('unfiltered_html') ) { 
    449449            if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { 
     
    482482    $x->add( array( 
    483483        'what' => 'comment', 
     484        'id' => $comment->comment_ID, 
     485        'data' => $comment_list_item, 
     486        'position' => $position 
     487    )); 
     488 
     489    $x->send(); 
     490    break; 
     491case 'edit-comment' : 
     492    check_ajax_referer( 'replyto-comment' ); 
     493 
     494    $comment_post_ID = (int) $_POST['comment_post_ID']; 
     495    if ( ! current_user_can( 'edit_post', $comment_post_ID ) ) 
     496        die('-1'); 
     497 
     498    if ( '' == $_POST['content'] ) 
     499        die( __('Error: please type a comment.') ); 
     500 
     501    $comment_id = (int) $_POST['comment_ID']; 
     502    $_POST['comment_status'] = $_POST['status']; 
     503    edit_comment(); 
     504 
     505    $mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail'; 
     506    $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1'; 
     507    $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0; 
     508 
     509    if ( get_option('show_avatars') && 'single' != $mode ) 
     510        add_filter( 'comment_author', 'floated_admin_avatar' ); 
     511 
     512    $x = new WP_Ajax_Response(); 
     513 
     514    ob_start(); 
     515        _wp_comment_row( $comment_id, $mode, false, $checkbox ); 
     516        $comment_list_item = ob_get_contents(); 
     517    ob_end_clean(); 
     518 
     519    $x->add( array( 
     520        'what' => 'edit_comment', 
    484521        'id' => $comment->comment_ID, 
    485522        'data' => $comment_list_item, 
  • trunk/wp-admin/css/colors-classic.css

    r9063 r9098  
    2727div#current-widgets, #postcustomstuff table, #your-profile fieldset, 
    2828a.page-numbers, #rightnow, div.dashboard-widget, 
    29 #dashboard-widgets p.dashboard-widget-links, .widefat { 
     29#dashboard-widgets p.dashboard-widget-links, .widefat, 
     30#replyrow #ed_reply_toolbar input { 
    3031    border-color: #ccc; 
    3132} 
     
    6465.form-table tr, #poststuff h3, #replyhandle, 
    6566.login form, h3.info-box-title, #post-status-info, #edit-settings-wrap, 
    66 #wpbody-content .describe tr
     67#wpbody-content .describe tr, #edithead, #replyhead
    6768    background-color: #cfebf7; 
    6869} 
     
    861862/* inline editor */ 
    862863.inline-editor input, 
    863 .inline-editor textarea { 
     864.inline-editor textarea, 
     865#replyrow input { 
    864866    border-color: #ddd; 
    865867} 
     
    881883    background-color: #CFEBF7; 
    882884} 
     885 
     886#replyrow #ed_reply_toolbar input:hover { 
     887    border-color: #aaa; 
     888    background: #ddd; 
     889} 
  • trunk/wp-admin/css/colors-fresh.css

    r9063 r9098  
    2727div#current-widgets, #postcustomstuff table, #your-profile fieldset, 
    2828a.page-numbers, #rightnow, div.dashboard-widget, 
    29 #dashboard-widgets p.dashboard-widget-links, .widefat { 
     29#dashboard-widgets p.dashboard-widget-links, .widefat, 
     30#replyrow #ed_reply_toolbar input { 
    3031    border-color: #ccc; 
    3132} 
     
    6465.form-table tr, #poststuff h3, #replyhandle, 
    6566.login form, h3.info-box-title, #post-status-info, #edit-settings-wrap, 
    66 #wpbody-content .describe tr
     67#wpbody-content .describe tr, #edithead, #replyhead
    6768    background-color: #eaf3fa; 
    6869} 
     
    840841/* inline editor */ 
    841842.inline-editor input, 
    842 .inline-editor textarea { 
     843.inline-editor textarea, 
     844#replyrow input { 
    843845    border-color: #ddd; 
    844846} 
     
    860862    background-color: #EAF3FA; 
    861863} 
     864 
     865#replyrow #ed_reply_toolbar input:hover { 
     866    border-color: #aaa; 
     867    background: #ddd; 
     868} 
  • trunk/wp-admin/includes/template.php

    r9083 r9098  
    192192 * 
    193193 * @since 2.7 
    194  *  
     194 * 
    195195 * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit. 
    196196 * 
    197197 * @param string $type "tag", "category" or "link-category" 
    198  * @return  
     198 * @return 
    199199 */ 
    200200function inline_edit_term_row($type) { 
     
    260260        <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a> 
    261261        <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a> 
    262         <span class="hidden error"></span> 
     262        <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /> 
     263        <span class="error" style="display:none;"></span> 
    263264        <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?> 
    264265    </div> 
     
    893894 * {@internal Missing Short Description}} 
    894895 * 
    895  * Outputs the quick edit and bulk edit table rows 
    896  *   
     896 * Outputs the quick edit and bulk edit table rows for posts and pages 
     897 * 
    897898 * @since 2.7 
    898899 * 
     
    11301131        <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a> 
    11311132        <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a> 
    1132         <?php if ( ! $bulk ) wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?> 
     1133        <?php if ( ! $bulk ) { 
     1134            wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?> 
     1135            <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /> 
     1136        <?php } ?> 
    11331137        <input type="hidden" name="post_view" value="<?php echo $m; ?>" /> 
    11341138    </div> 
     
    11411145} 
    11421146 
    1143 // adds hidden fields with the data for use in the inline editor 
     1147// adds hidden fields with the data for use in the inline editor for posts and pages 
    11441148/** 
    11451149 * {@internal Missing Short Description}} 
     
    19701974            case 'comment': 
    19711975                echo "<td $attributes>"; 
    1972                 if ( 'detail' == $mode || 'single' == $mode ) comment_text(); 
    1973  
     1976                if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?> 
     1977                <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden"> 
     1978                <textarea class="comment"><?php echo $comment->comment_content; ?></textarea> 
     1979                <div class="author-email"><?php echo attribute_escape( $comment->comment_author_email ); ?></div> 
     1980                <div class="author"><?php echo attribute_escape( $comment->comment_author ); ?></div> 
     1981                <div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div> 
     1982                <div class="comment_status"><?php echo $comment->comment_approved; ?></div> 
     1983                </div> 
     1984                <?php 
    19741985                $actions = array(); 
    19751986 
     
    19902001                    $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 
    19912002                    $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>'; 
     2003                    $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>'; 
    19922004                    if ( 'spam' != $the_comment_status ) 
    1993                         $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>'; 
     2005                        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>'; 
    19942006 
    19952007                    $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 
    19962008 
    1997                     $action_count = count($actions); 
    19982009                    $i = 0; 
    19992010                    foreach ( $actions as $action => $link ) { 
    20002011                        ++$i; 
    2001                         ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 
    2002                         // The action before reply shouldn't output a sep 
    2003                         if ( 'edit' == $action ) 
    2004                             $sep = ''; 
    2005                         // Reply needs a hide-if-no-js span 
    2006                         if ( 'reply' == $action ) 
    2007                             echo "<span class='$action'><span class='hide-if-no-js'> | $link</span>$sep</span>"; 
    2008                         else 
    2009                             echo "<span class='$action'>$link$sep</span>"; 
     2012                        ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; 
     2013 
     2014                        // Reply and quickedit need a hide-if-no-js span 
     2015                        if ( 'reply' == $action || 'quickedit' == $action ) 
     2016                            $action .= ' hide-if-no-js'; 
     2017 
     2018                        echo "<span class='$action'>$sep$link</span>"; 
    20102019                    } 
    20112020                } 
     
    20542063 
    20552064    // allow plugin to replace the popup content 
    2056     $content = apply_filters( 'wp_comment_reply', '', array('position'=>$position, 'checkbox'=>$checkbox, 'mode'=>$mode) ); 
     2065    $content = apply_filters( 'wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode) ); 
    20572066 
    20582067    if ( ! empty($content) ) { 
     
    20612070    } 
    20622071?> 
    2063     <div id="replyerror" style="display:none;"> 
    2064     <img src="images/logo.gif" /> 
    2065     <h3 class="info-box-title"><?php _e('Comment Reply Error'); ?></h3> 
    2066     <p id="replyerrtext"></p> 
    2067     <p class="submit"><button id="close-button" onclick="commentReply.close();" class="button"><?php _e('Close'); ?></button> 
    2068     <button id="back-button" onclick="commentReply.back();" class="button"><?php _e('Go back'); ?></button></p> 
     2072<form method="get" action=""><table style="display:none;"><tbody id="com-reply"> 
     2073    <tr id="replyrow"><td colspan="6"> 
     2074    <div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div> 
     2075 
     2076    <div id="edithead" style="display:none;"> 
     2077        <div id="edittitle"><?php _e('Edit Comment'); ?></div> 
     2078 
     2079        <div class="inside"> 
     2080        <label for="author"><?php _e('Name') ?></label> 
     2081        <input type="text" name="newcomment_author" size="50" value="" tabindex="101" id="author" /> 
     2082        </div> 
     2083 
     2084        <div class="inside"> 
     2085        <label for="author-email"><?php _e('E-mail') ?></label> 
     2086        <input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" /> 
     2087        </div> 
     2088 
     2089        <div class="inside"> 
     2090        <label for="author-url"><?php _e('URL') ?></label> 
     2091        <input type="text" id="author-url" name="newcomment_author_url" size="103" value="" tabindex="103" /> 
     2092        </div> 
     2093        <div style="clear:both;"></div> 
    20692094    </div> 
    20702095 
    2071     <div id="replydiv" style="display:none;"> 
    2072     <p id="replyhandle"><?php _e('Reply'); ?></p> 
    2073     <form action="" method="post" id="replyform"> 
     2096    <div id="replycontainer"><textarea rows="8" cols="40" name="replycontent" tabindex="104" id="replycontent"></textarea></div> 
     2097 
     2098    <p id="replysubmit"> 
     2099    <a href="#comments-form" class="cancel button" tabindex="106"><?php _e('Cancel'); ?></a> 
     2100    <a href="#comments-form" class="save button" tabindex="105"> 
     2101    <span id="savebtn" style="display:none;"><?php _e('Save'); ?></span> 
     2102    <span id="replybtn" style="display:none;"><?php _e('Submit Reply'); ?></span></a> 
     2103    <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /> 
     2104    <span class="error" style="display:none;"></span> 
     2105    </p> 
     2106 
    20742107    <input type="hidden" name="user_ID" id="user_ID" value="<?php echo $current_user->ID; ?>" /> 
    2075     <input type="hidden" name="action" value="replyto-comment" /> 
     2108    <input type="hidden" name="action" id="action" value="" /> 
    20762109    <input type="hidden" name="comment_ID" id="comment_ID" value="" /> 
    20772110    <input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" /> 
     2111    <input type="hidden" name="status" id="status" value="" /> 
    20782112    <input type="hidden" name="position" id="position" value="<?php echo $position; ?>" /> 
    20792113    <input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" /> 
     
    20812115    <?php wp_nonce_field( 'replyto-comment', '_ajax_nonce', false ); ?> 
    20822116    <?php wp_comment_form_unfiltered_html_nonce(); ?> 
    2083  
    2084     <?php echo apply_filters( 'wp_comment_reply_content', ' 
    2085     <div id="replycontainer"><textarea rows="5" cols="40" name="replycontent" tabindex="1000" id="replycontent"></textarea></div> 
    2086     '); ?> 
    2087  
    2088     <p id="replysubmit"><input type="button" onclick="commentReply.close();" class="button" tabindex="1002" value="<?php _e('Cancel'); ?>" /> 
    2089     <input type="button" onclick="commentReply.send();" class="button" tabindex="1001" value="<?php _e('Submit Reply'); ?>" /></p> 
    2090     </form> 
    2091     </div> 
     2117    </td></tr> 
     2118</tbody></table></form> 
    20922119<?php 
    20932120} 
     
    29873014/** 
    29883015 * Display the post password. 
    2989  *  
     3016 * 
    29903017 * The password is passed through {@link attribute_escape()} to ensure that it 
    29913018 * is safe for placing in an html attribute. 
     
    30243051/** 
    30253052 * Get the post title. 
    3026  *  
     3053 * 
    30273054 * The post title is fetched and if it is blank then a default string is 
    30283055 * returned. 
     
    30303057 * @since 2.7.0 
    30313058 * @param int $id The post id. If not supplied the global $post is used. 
    3032  *  
     3059 * 
    30333060 */ 
    30343061function _draft_or_post_title($post_id = 0) 
     
    30423069/** 
    30433070 * Display the search query. 
    3044  *  
     3071 * 
    30453072 * A simple wrapper to display the "s" parameter in a GET URI. This function 
    30463073 * should only be used when {@link the_search_query()} cannot. 
     
    30483075 * @uses attribute_escape 
    30493076 * @since 2.7.0 
    3050  *  
     3077 * 
    30513078 */ 
    30523079function _admin_search_query() { 
  • trunk/wp-admin/js/edit-comments.js

    r8988 r9098  
    3030        }); 
    3131    }; 
    32      
     32 
    3333    var delAfter = function( r, settings ) { 
    3434        $('li span.comment-count').each( function() { 
     
    6868            a.html( n.toString() ); 
    6969        }); 
    70      
     70 
    7171        if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) { 
    7272            return; 
    7373        } 
    74      
     74 
    7575        theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); 
    7676        $('#get-extra-comments').submit(); 
     
    7979    theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } ); 
    8080    theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ); 
     81 
    8182}; 
    8283 
     
    8788commentReply = { 
    8889 
    89     open : function(c, p) { 
    90         var d = $('#comment-'+c).offset(), H = $('#replydiv').height(), top = 200, left = 100, h = 120; 
    91  
    92         if ( d && H ) { 
    93             top = (d.top - H) < 10 ? 10 : d.top - H - 5; 
    94             left = d.left; 
    95         } 
    96  
    97         $('#replydiv #comment_post_ID').val(p); 
    98         $('#replydiv #comment_ID').val(c); 
    99  
    100         $('#replydiv').draggable({ 
    101             handle : '#replyhandle', 
    102             containment : '#wpwrap' 
    103         }).resizable({ 
    104             handles : 'se', 
    105             minHeight : 200, 
    106             minWidth : 400, 
    107             containment : '#wpwrap', 
    108             resize : function(e,o) { 
    109                 h = o.size.height - 80 - $('#ed_reply_qtags').height(); 
    110                 $('#replycontainer').height(h); 
    111             }, 
    112             stop : function(e,o) { 
     90    init : function() { 
     91        this.rows = $('#the-comment-list tr'); 
     92        var row = $('#replyrow'); 
     93 
     94        $('a.cancel', row).click(function() { return commentReply.revert(); }); 
     95        $('a.save', row).click(function() { return commentReply.send(this); }); 
     96 
     97        // add events 
     98        this.addEvents(this.rows); 
     99 
     100        $('#doaction, #doaction2, #post-query-submit').click(function(e){ 
     101            if ( $('#the-comment-list #replyrow').length > 0 ) 
     102                t.close(); 
     103        }); 
     104 
     105    }, 
     106 
     107    addEvents : function(r) { 
     108        r.each(function() { 
     109            $(this).dblclick(function(){ 
     110                commentReply.toggle(this); 
     111            }); 
     112        }); 
     113    }, 
     114 
     115    toggle : function(el) { 
     116        if ( $(el).css('display') != 'none' ) 
     117            $(el).find('a.vim-q').click(); 
     118    }, 
     119 
     120    revert : function() { 
     121 
     122        if ( $('#the-comment-list #replyrow').length < 1 ) 
     123            return false; 
     124 
     125        $('#replyrow').fadeOut('fast', function(){ 
     126            commentReply.close(); 
     127        }); 
     128 
     129        return false; 
     130    }, 
     131 
     132    close : function() { 
     133        $(this.o).fadeIn('fast').css('backgroundColor', ''); 
     134        $('#com-reply').append( $('#replyrow') ); 
     135        $('#replycontent').val(''); 
     136        $('#edithead input').val(''); 
     137        $('#replysubmit .error').html('').hide(); 
     138        $('#replysubmit .waiting').hide(); 
     139        if ( $.browser.msie ) 
     140            $('#replycontainer, #replycontent').css('height', '120px'); 
     141        else 
     142            $('#replycontainer').resizable('destroy').css('height', '120px'); 
     143    }, 
     144 
     145    open : function(id, p, a) { 
     146        var t = this; 
     147        t.close(); 
     148        t.o = '#comment-'+id; 
     149 
     150        $('#replyrow td').attr('colspan', $('.widefat tfoot th:visible').length); 
     151        var editRow = $('#replyrow'), rowData = $('#inline-'+id); 
     152        var act = t.act = (a == 'edit') ? 'edit-comment' : 'replyto-comment'; 
     153 
     154        $('#action', editRow).val(act); 
     155        $('#comment_post_ID', editRow).val(p); 
     156        $('#comment_ID', editRow).val(id); 
     157 
     158        if ( a == 'edit' ) { 
     159            $('#author', editRow).val( $('div.author', rowData).text() ); 
     160            $('#author-email', editRow).val( $('div.author-email', rowData).text() ); 
     161            $('#author-url', editRow).val( $('div.author-url', rowData).text() ); 
     162            $('#status', editRow).val( $('div.comment_status', rowData).text() ); 
     163            $('#replycontent', editRow).val( $('textarea.comment', rowData).val() ); 
     164            $('#edithead, #savebtn', editRow).show(); 
     165            $('#replyhead, #replybtn', editRow).hide(); 
     166 
     167            var h = $(t.o).height(); 
     168            if ( h > 220 ) 
    113169                if ( $.browser.msie ) 
    114                     $('#replycontent').height(h); 
    115             } 
    116         }); 
    117  
    118         $('.ui-resizable-se').css({ 
    119             border: '0 none', 
    120             width: '11px', 
    121             height: '12px', 
    122             background: 'transparent url(images/se.png) no-repeat scroll 0 0' 
    123         }); 
    124  
    125         $('#replydiv').css({ 
    126             'position' : 'absolute', 
    127             'top' : top, 
    128             'left' : left 
    129         }).show(); 
    130  
    131         $('#replycontent').focus().keyup(function(e){ 
    132             if (e.which == 27) commentReply.close(); // close on Escape 
    133         }); 
    134          
    135         // emulate the Safari/Opera scrollIntoView 
    136         var to = $('#replydiv').offset(); 
    137         var scr = document.documentElement.scrollTop ? document.documentElement.scrollTop : 0; 
    138  
    139         if ( scr - 20 > to.top ) 
    140             window.scroll(0, to.top - 100); 
    141     }, 
    142  
    143     close : function() { 
    144         $('#replycontent').val(''); 
    145         $('#replyerror').hide(); 
    146  
    147         $('#replydiv').draggable('destroy').resizable('destroy').css('position','relative'); 
    148         $('#replydiv').hide(); 
     170                    $('#replycontainer, #replycontent', editRow).height(h-105); 
     171                else 
     172                    $('#replycontainer', editRow).height(h-105); 
     173 
     174            $(t.o).after(editRow.hide()).fadeOut('fast', function(){ 
     175                $('#replyrow').fadeIn('fast'); 
     176            }); 
     177        } else { 
     178            $('#edithead, #savebtn', editRow).hide(); 
     179            $('#replyhead, #replybtn', editRow).show(); 
     180            $(t.o).after(editRow).animate( { backgroundColor: '#eefee7' }, 800); 
     181            $('#replyrow').hide().fadeIn('fast'); 
     182        } 
     183 
     184        if ( ! $.browser.msie ) 
     185            $('#replycontainer').resizable({ 
     186                handles : 's', 
     187                axis : 'y', 
     188                minHeight : 80, 
     189                stop : function() { 
     190                    $('#replycontainer').width('auto'); 
     191                } 
     192            }); 
     193 
     194        setTimeout(function() { 
     195            var rtop = $('#replyrow').offset().top; 
     196            var rbottom = rtop + $('#replyrow').height(); 
     197            var scrollTop = window.pageYOffset || document.documentElement.scrollTop; 
     198            var vp = document.documentElement.clientHeight || self.innerHeight || 0; 
     199            var scrollBottom = scrollTop + vp; 
     200 
     201            if ( scrollBottom - 20 < rbottom ) 
     202                window.scroll(0, rbottom - vp + 35); 
     203            else if ( rtop - 20 < scrollTop ) 
     204                window.scroll(0, rtop - 35); 
     205 
     206            $('#replycontent').focus().keyup(function(e){ 
     207                if (e.which == 27) commentReply.revert(); // close on Escape 
     208            }); 
     209        }, 600); 
     210 
    149211        return false; 
    150212    }, 
     
    153215        var post = {}; 
    154216 
    155         $('#replyform input').each(function() { 
     217        $('#replysubmit .waiting').show(); 
     218 
     219        $('#replyrow input').each(function() { 
    156220            post[ $(this).attr('name') ] = $(this).val(); 
    157221        }); 
    158222 
    159         post.comment = $('#replycontent').val(); 
     223        post.content = $('#replycontent').val(); 
    160224        post.id = post.comment_post_ID; 
    161225 
     
    167231            error : function(r) { commentReply.error(r); } 
    168232        }); 
     233 
     234        return false; 
    169235    }, 
    170236 
     
    173239        if ( typeof(xml) == 'string' ) { 
    174240            this.error({'responseText': xml}); 
    175             return
     241            return false
    176242        } 
    177243 
    178244        var r = wpAjax.parseAjaxResponse(xml); 
    179         if ( r.errors ) 
     245        if ( r.errors ) { 
    180246            this.error({'responseText': wpAjax.broken}); 
     247            return false; 
     248        } 
     249 
     250        if ( 'edit-comment' == this.act ) 
     251            $(this.o).remove(); 
    181252 
    182253        r = r.responses[0]; 
    183         this.close(); 
    184 //      var scr1 = $('#the-comment-list').offset(), scr2 = $('#the-comment-list').height(); 
    185  
    186         if ( r.position == -1 ) { 
    187 //          window.scroll(0, scr1.top - 100); // Scroll to the new comment? Seems annoing.. 
    188             $('#the-comment-list').prepend(r.data); 
    189         } else { 
    190 //          window.scroll(0, scr1.top + scr2 + 200); 
    191             $('#the-comment-list').append(r.data); 
    192         } 
    193  
    194         $('#comment-'+r.id+' .hide-if-no-js').removeClass('hide-if-no-js'); 
    195  
    196         $('#comment-'+r.id) 
     254        var c = r.data; 
     255 
     256        $(c).hide() 
     257        $('#replyrow').after(c); 
     258        this.o = id = '#comment-'+r.id; 
     259        $(id+' .hide-if-no-js').removeClass('hide-if-no-js'); 
     260        this.revert(); 
     261        this.addEvents($(id)); 
     262 
     263        $(id) 
    197264            .animate( { backgroundColor:"#CCEEBB" }, 600 ) 
    198265            .animate( { backgroundColor:"transparent" }, 600 ); 
    199          
     266 
     267        theList = theExtraList = null; 
     268        $("#get-extra-comments, a[className*=':']").unbind(); 
    200269        setCommentsList(); 
     270 
    201271    }, 
    202272 
     
    204274        var er = r.statusText; 
    205275 
     276        $('#replysubmit .waiting').hide(); 
     277 
    206278        if ( r.responseText ) 
    207279            er = r.responseText.replace( /<.[^<>]*?>/g, '' ); 
    208280 
    209         if ( er ) { 
    210             var o = $('#replydiv').offset(); 
    211             $('#replydiv').hide(); 
    212  
    213             $('#replyerror').css({ 
    214                 'top' : o.top + 60 + 'px', 
    215                 'left' : o.left + 'px' 
    216             }).show().draggable(); 
    217  
    218             $('#replyerrtext').html(er) 
    219             $('#close-button').css('outline','none').focus().keyup(function(e) { 
    220                 if (e.which == 27) commentReply.close(); // close on Escape 
    221             }); 
    222         } 
    223     }, 
    224      
    225     back : function() { 
    226         if ( $('#replydiv').is(':hidden') && $('#replyerror').is(':visible') ) { 
    227             $('#replyerror').hide(); 
    228             $('#replydiv').show(); 
    229         } 
     281        if ( er ) 
     282            $('#replysubmit .error').html(er).show(); 
     283 
    230284    } 
    231285}; 
     
    233287$(document).ready(function(){ 
    234288    columns.init('comment'); 
     289    commentReply.init(); 
    235290 
    236291    if ( typeof QTags != 'undefined' ) 
     
    240295        var make_hotkeys_redirect = function(which) { 
    241296            return function() { 
    242                 var first_last = 'next' == which? 'first' : 'last';  
     297                var first_last = 'next' == which? 'first' : 'last'; 
    243298                var l=$('.'+which+'.page-numbers'); 
    244299                if (l.length) 
     
    260315            } 
    261316        }; 
    262         $.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', ['e', edit_comment], 
     317        $.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', 'q', ['e', edit_comment], 
    263318                ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')], 
    264319                ['shift+d', make_bulk('delete')], ['shift+x', toggle_all]], 
  • trunk/wp-admin/js/inline-edit-post.js

    r9083 r9098  
    187187            id = this.getId(id); 
    188188 
    189         $('#edit-'+id+'.quick-edit-save').append('<img style="padding:0 15px;" src="images/loading.gif" alt="" />'); 
     189        $('table.widefat .quick-edit-save .waiting').show(); 
    190190 
    191191        var params = { 
     
    226226 
    227227        if ( id = $('table.widefat tr.inline-editor').attr('id') ) { 
     228            $('table.widefat .quick-edit-save .waiting').hide(); 
     229 
    228230            if ( 'bulk-edit' == id ) { 
    229231                $('table.widefat #bulk-edit').removeClass('inline-editor').hide(); 
  • trunk/wp-admin/js/inline-edit-tax.js

    r9083 r9098  
    9191            id = this.getId(id); 
    9292 
    93         $('#edit-'+id+'.quick-edit-save').append('<img style="padding:0 15px;" src="images/loading.gif" alt="" />'); 
     93        $('table.widefat .quick-edit-save .waiting').show(); 
    9494 
    9595        var params = { 
     
    127127 
    128128        if ( id ) { 
     129            $('table.widefat .quick-edit-save .waiting').hide(); 
    129130            $('#'+id).remove(); 
    130131            id = id.substr( id.lastIndexOf('-') + 1 ); 
  • trunk/wp-admin/wp-admin.css

    r9083 r9098  
    330330} 
    331331 
    332 #ed_toolbar input, 
    333 #ed_reply_toolbar input { 
     332#ed_toolbar input { 
    334333    margin: 3px 2px 2px; 
    335334    padding: 2px 4px; 
     
    513512.column-comment p { 
    514513    margin-top: 0; 
    515 } 
    516  
    517 .column-comment { 
    518     width: 50%; 
    519 } 
    520  
    521 .column-author, 
    522 .column-response { 
    523     width: 20%; 
    524514} 
    525515 
     
    19611951 
    19621952/* reply to comments */ 
    1963 #replydiv { 
    1964     width: 700px; 
     1953#replyrow { 
     1954    font-size: 11px; 
     1955
     1956 
     1957#replyrow input { 
    19651958    border-width: 1px; 
    19661959    border-style: solid; 
     1960} 
     1961 
     1962#replyrow td { 
    19671963    padding: 2px; 
    1968     left: 20px; 
    1969     top: 200px; 
    1970     z-index: 100; 
    1971 
    1972  
    1973 #replydiv #editorcontainer { 
     1964
     1965 
     1966#replyrow #editorcontainer { 
    19741967    border: 0 none; 
    19751968} 
     
    19771970#replysubmit { 
    19781971    margin: 0; 
    1979     padding: 3px 5px; 
     1972    padding: 5px; 
    19801973    border-top-width: 1px; 
    19811974    border-top-style: solid; 
    19821975} 
    19831976 
    1984 #replysubmit .button, 
    1985 #replyerror .button { 
     1977#replysubmit img.waiting, 
     1978.quick-edit-save img.waiting { 
     1979    padding: 0 10px; 
     1980    vertical-align: top; 
     1981
     1982 
     1983#replysubmit .button { 
    19861984    margin-right: 5px; 
    19871985} 
    19881986 
    1989 #replydiv #editor-toolbar { 
     1987#replyrow #editor-toolbar { 
    19901988    display: none; 
    19911989} 
    19921990 
    1993 #replydiv #replyhandle { 
    1994     cursor: move; 
    1995     margin: 0; 
    1996     font-size: 14px; 
     1991#replyhead { 
     1992    font-size: 12px; 
    19971993    font-weight: bold; 
    1998     padding: 7px; 
     1994    padding: 2px 10px 4px; 
     1995
     1996 
     1997#edithead #edittitle { 
     1998    float: left; 
     1999    font-size: 12px; 
     2000    font-weight: bold; 
     2001    height: 20px; 
     2002    line-height: 19px; 
     2003    margin: 0 4px 0 0; 
     2004    padding: 4px 10px; 
     2005
     2006 
     2007#edithead .inside { 
     2008    float: left; 
     2009    margin: 0 4px 2px 0; 
     2010    padding: 3px 0 2px; 
     2011    text-align: center; 
     2012    width: 260px; 
     2013    font-size: 11px; 
     2014
     2015 
     2016#edithead .inside input { 
     2017    width: 200px; 
     2018    font-size: 11px; 
     2019
     2020 
     2021#edithead label { 
     2022    padding: 2px; 
    19992023} 
    20002024 
    20012025#replycontainer { 
    2002     padding: 6px; 
     2026    padding: 5px; 
    20032027    border: 0 none; 
    2004     height: 100%
     2028    height: 120px
    20052029    overflow: hidden; 
     2030    position: relative; 
    20062031} 
    20072032 
     
    20152040    border: 0 none; 
    20162041    outline: none; 
    2017 
    2018  
    2019 #ed_reply_toolbar { 
    2020     margin: 0; 
    2021     padding: 2px 4px; 
    2022 
    2023  
    2024 #replyerror { 
    2025     border-width: 5px; 
    2026     border-style: solid; 
    2027     position: absolute; 
    2028     padding: 15px 15px 10px; 
    2029     width: 500px; 
    2030     z-index: 1000; 
    2031     display: none; 
    2032 
    2033  
    2034 #replyerror img { 
    2035     float: right; 
    2036     margin: 15px; 
    2037 
    2038  
    2039 #replyerror p.submit { 
    2040     padding: 10px 0 0; 
    2041 
    2042  
    2043 #replyerror .error { 
    2044     margin: 15px 0 0; 
     2042    font-size: 12px; 
     2043
     2044 
     2045#replyrow #ed_reply_toolbar { 
     2046    margin: 0; 
     2047    padding: 2px 3px; 
     2048
     2049 
     2050#replyrow #ed_reply_toolbar input { 
     2051    margin: 1px 2px 1px 1px; 
     2052    min-width: 26px; 
     2053    padding: 3px 4px; 
     2054    font-size: 12px; 
     2055    -moz-border-radius: 3px; 
     2056    -khtml-border-radius: 3px; 
     2057    -webkit-border-radius: 3px; 
     2058    border-radius: 3px; 
    20452059} 
    20462060 
  • trunk/wp-includes/js/jquery/jquery.table-hotkeys.js

    r9048 r9098  
    6666        }; 
    6767        var first_row = get_first_row(); 
    68         if (!first_row.length) return;      
     68        if (!first_row.length) return; 
    6969        if (opts.highlight_first) 
    7070            set_current_row(first_row); 
     
    8484            } 
    8585        }); 
    86          
     86 
    8787    }; 
    8888    $.table_hotkeys.current_row = null; 
  • trunk/wp-includes/script-loader.php

    r9083 r9098  
    159159            'strong' => __('Strong') 
    160160        ) ); 
    161         $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-draggable', 'jquery-ui-resizable', 'quicktags', 'columns', 'settings-box'), '20080925' ); 
     161        $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags', 'columns', 'settings-box'), '20081007' ); 
    162162        $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 
    163163            'pending' => __('%i% pending'), // must look like: "# blah blah" 
     
    243243        $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); 
    244244 
    245         $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080930' ); 
     245        $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081007' ); 
    246246        $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 
    247             'edit' => __('Double-click to edit') 
    248         ) ); 
    249  
    250         $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081003' ); 
     247            'edit' => __('Double-click to edit'), 
     248            'error' => __('Error while saving the changes.') 
     249        ) ); 
     250 
     251        $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081007' ); 
    251252        $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array( 
    252253            'edit' => __('Double-click to edit'),