WordPress.org

Make WordPress Core

Ticket #6352: edit-tabindex.diff

File edit-tabindex.diff, 2.3 KB (added by westi, 6 years ago)

Adds tabindex to the permalink edit but doesn't work correctly

  • C:/xampp/htdocs/wordpress/trunk/wp-admin/includes/post.php

     
    655655        $post_name_html = '<span id="editable-post-name" title="'.$title.'">'.$post_name_abridged.'</span><span id="editable-post-name-full">'.$post_name.'</span>'; 
    656656        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); 
    657657        $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $display_link . "</span>\n"; 
    658         $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug" onclick="edit_permalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n"; 
     658        $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug" onclick="edit_permalink(' . $id . '); return false;" tabindex="1">' . __('Edit') . "</a></span>\n"; 
    659659        return $return; 
    660660} 
    661661 
  • C:/xampp/htdocs/wordpress/trunk/wp-admin/js/slug.js

     
    88        var revert_b = b.html(); 
    99        var full = jQuery('#editable-post-name-full').html(); 
    1010 
    11         b.html('<a href="" class="save">'+slugL10n.save+'</a> <a class="cancel" href="">'+slugL10n.cancel+'</a>'); 
     11        b.html('<a href="" class="save" tabindex="1">'+slugL10n.save+'</a> <a class="cancel" href="" tabindex="1">'+slugL10n.cancel+'</a>'); 
    1212        b.children('.save').click(function() { 
    1313                var new_slug = e.children('input').val(); 
    1414                jQuery.post(slugL10n.requestFile, { 
     
    3434                if ('%' == full.charAt(i)) c++; 
    3535        } 
    3636        slug_value = (c > full.length/4)? '' : full; 
    37         e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){ 
     37        e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" tabindex="1" />').children('input').keypress(function(e){ 
    3838                var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; 
    3939                // on enter, just save the new slug, don't save the post 
    4040                if (13 == key) {b.children('.save').click();return false;}