Make WordPress Core

Changeset 9297


Ignore:
Timestamp:
10/23/2008 04:34:21 PM (17 years ago)
Author:
ryan
Message:

Bring back Quick Edit links

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r9291 r9297  
    124124        $actions = array();
    125125        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     126        $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    126127        if ( $default_cat_id != $category->term_id )
    127128            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     
    292293        $actions = array();
    293294        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     295        $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    294296        if ( $default_cat_id != $category->term_id )
    295297            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&amp;cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     
    607609                    $actions = array();
    608610                    $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     611                    $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    609612                    $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    610613                    $action_count = count($actions);
     
    12721275            if ( current_user_can('edit_post', $post->ID) ) {
    12731276                $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . attribute_escape(__('Edit this post')) . '">' . __('Edit') . '</a>';
     1277                $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . attribute_escape(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>';
    12741278                $actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    12751279            }
     
    14561460        $actions = array();
    14571461        $actions['edit'] = '<a href="' . $edit_link . '" title="' . attribute_escape(__('Edit this page')) . '">' . __('Edit') . '</a>';
     1462        $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    14581463        $actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    14591464        if ( in_array($post->post_status, array('pending', 'draft')) )
     
    19031908                    $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    19041909                    $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
     1910                    $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
    19051911                    if ( 'spam' != $the_comment_status )
    19061912                        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
  • trunk/wp-admin/js/edit-comments.js

    r9225 r9297  
    110110        r.each(function() {
    111111            $(this).dblclick(function(){
    112                 commentReply.toggle_edit(this);
     112                commentReply.toggle(this);
    113113            });
    114114        });
    115115    },
    116116
    117     toggle_edit : function(el) {
    118         if ( $(el).css('display') != 'none' ) {
    119             var id = $(el).attr('id').substr(8);
    120             if (id) this.open(id, '', 'edit');
    121         }
     117    toggle : function(el) {
     118        if ( $(el).css('display') != 'none' )
     119            $(el).find('a.vim-q').click();
    122120    },
    123121
    124122    revert : function() {
    125123
    126         if ( $('#the-comment-list #replyrow').length > 0 ) {
    127             $('#replyrow').fadeOut('fast', function(){
    128                 commentReply.close();
    129             });
    130         }
     124        if ( $('#the-comment-list #replyrow').length < 1 )
     125            return false;
     126
     127        $('#replyrow').fadeOut('fast', function(){
     128            commentReply.close();
     129        });
    131130
    132131        return false;
     
    148147    open : function(id, p, a) {
    149148        var t = this;
    150 
    151         if ( $('#the-comment-list #replyrow').length > 0 )
    152             t.close();
    153 
     149        t.close();
    154150        t.o = '#comment-'+id;
    155151
     
    321317            }
    322318        };
    323         $.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', ['e', edit_comment],
     319        $.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', 'q', ['e', edit_comment],
    324320                ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')],
    325321                ['shift+d', make_bulk('delete')], ['shift+x', toggle_all],
  • trunk/wp-admin/js/inline-edit-post.js

    r9162 r9297  
    2727        // add events
    2828        t.rows.dblclick(function() { inlineEditPost.toggle(this); });
     29        t.addEvents(t.rows);
    2930
    3031        $('#bulk-title-div').after(
     
    7980    },
    8081
     82    addEvents : function(r) {
     83        r.each(function() {
     84            var row = $(this);
     85            $('a.editinline', row).click(function() { inlineEditPost.edit(this); return false; });
     86            row.attr('title', inlineEditL10n.edit);
     87        });
     88    },
     89
    8190    setBulk : function() {
    8291        var te = '', c = '';
     
    9099                var id = $(this).val();
    91100                c = c == '' ? ' class="alternate"' : '';
    92                 te += '<div'+c+' id="ttle'+id+'"><a id="_'+id+'" title="'+inlineEditL10n.rem_title+'" class="ntdelbutton">X</a>'+$('#inline_'+id+' .post_title').text()+'</div>';
     101                te += '<div'+c+' id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton">X</a>'+$('#inline_'+id+' .post_title').text()+'</div>';
    93102            }
    94103        });
     
    200209                        .animate( { backgroundColor: '#CCEEBB' }, 500)
    201210                        .animate( { backgroundColor: '#eefee7' }, 500);
     211                    inlineEditPost.addEvents(row);
    202212                } else {
    203213                    $('#edit-'+id+' .quick-edit-save').append('<span class="error">'+inlineEditL10n.error+'</span>');
  • trunk/wp-admin/js/inline-edit-tax.js

    r9162 r9297  
    2121        // add events
    2222        t.rows.dblclick(function() { inlineEditTax.toggle(this); });
     23        t.addEvents(t.rows);
    2324
    2425        $('#doaction, #doaction2, #post-query-submit').click(function(e){
     
    3233
    3334        $(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
     35    },
     36
     37    addEvents : function(r) {
     38        r.each(function() {
     39            var row = $(this);
     40            $('a.editinline', row).click(function() { inlineEditTax.edit(this); return false; });
     41            row.attr('title', inlineEditL10n.edit);
     42        });
    3443    },
    3544
     
    104113                            .animate( { backgroundColor: '#CCEEBB' }, 500)
    105114                            .animate( { backgroundColor: '#eefee7' }, 500);
     115                        inlineEditTax.addEvents(row);
    106116                    } else
    107117                        $('#edit-'+id+' .quick-edit-save .error').html(r).show();
  • trunk/wp-includes/script-loader.php

    r9291 r9297  
    244244        $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' );
    245245
    246         $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081014' );
     246        $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081007' );
    247247        $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
    248             'error' => __('Error while saving the changes.'),
    249             'rem_title' => __('Remove from batch edit')
    250         ) );
    251 
    252         $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081014' );
     248            'edit' => __('Double-click to edit'),
     249            'error' => __('Error while saving the changes.')
     250        ) );
     251
     252        $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081007' );
    253253        $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
     254            'edit' => __('Double-click to edit'),
    254255            'error' => __('Error while saving the changes.')
    255256        ) );
Note: See TracChangeset for help on using the changeset viewer.