Ticket #34255: 34255.patch
File 34255.patch, 4.8 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/edit.css
104 104 105 105 #edit-slug-box .cancel { 106 106 margin-right: 10px; 107 padding: 0; 107 108 font-size: 11px; 109 text-decoration: undeline; 110 color: #0073aa; 108 111 } 109 112 110 113 #comment-link-box { -
src/wp-admin/includes/post.php
1346 1346 $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n"; 1347 1347 $return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n"; 1348 1348 $return .= '‎'; // Fix bi-directional text display defect in RTL languages. 1349 $return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" >' . __( 'Edit' ) . "</button></span>\n";1349 $return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" aria-label="' . __( 'Edit permalink' ) . '">' . __( 'Edit' ) . "</button></span>\n"; 1350 1350 $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n"; 1351 1351 } 1352 1352 -
src/wp-admin/js/post.js
741 741 $el = $( '#editable-post-name' ); 742 742 revert_e = $el.html(); 743 743 744 buttons.html( '<button type="button" class="save button button-small">'+postL10n.ok+'</button> <a class="cancel" href="#">'+postL10n.cancel+'</a>');745 buttons.children( '.save').click( function( e) {744 buttons.html( '<button type="button" class="save button button-small">' + postL10n.ok + '</button> <button type="button" class="cancel button-link">' + postL10n.cancel + '</button>' ); 745 buttons.children( '.save' ).click( function() { 746 746 var new_slug = $el.children( 'input' ).val(); 747 e.preventDefault(); 747 748 748 if ( new_slug == $('#editable-post-name-full').text() ) { 749 749 buttons.children('.cancel').click(); 750 750 return; … … 768 768 permalink.html(permalinkOrig); 769 769 real_slug.val(new_slug); 770 770 $( '.edit-slug' ).focus(); 771 wp.a11y.speak( postL10n.permalinkSaved ); 771 772 }); 772 773 }); 773 774 774 buttons.children('.cancel').click( function( e ) { 775 e.preventDefault(); 775 buttons.children( '.cancel' ).click( function() { 776 776 $('#view-post-btn').show(); 777 777 $el.html(revert_e); 778 778 buttons.html(buttonsOrig); … … 787 787 } 788 788 789 789 slug_value = ( c > full.length / 4 ) ? '' : full; 790 $el.html( '<input type="text" id="new-post-slug" value="' +slug_value+'" autocomplete="off" />').children('input').keypress(function(e) {791 var key = e. keyCode || 0;792 // on enter, just save the new slug, don't save the post793 if ( 13 == key ) {794 buttons.children('.save').click();795 return false;790 $el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ).keydown( function( e ) { 791 var key = e.which; 792 // On enter, just save the new slug, don't save the post. 793 if ( 13 === key ) { 794 e.preventDefault(); 795 buttons.children( '.save' ).click(); 796 796 } 797 if ( 27 == key ) { 798 buttons.children('.cancel').click(); 799 return false; 797 if ( 27 === key ) { 798 buttons.children( '.cancel' ).click(); 800 799 } 801 800 } ).keyup( function() { 802 real_slug.val( this.value);801 real_slug.val( this.value ); 803 802 }).focus(); 804 803 } 805 804 806 $( '#edit-slug-box').on( 'click', '.edit-slug', function() {805 $( '#titlediv' ).on( 'click', '.edit-slug', function() { 807 806 editPermalink(); 808 807 }); 809 808 -
src/wp-includes/script-loader.php
500 500 'tagDelimiter' => _x( ',', 'tag delimiter' ), 501 501 ) ); 502 502 503 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count' ), false, 1 );503 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y' ), false, 1 ); 504 504 did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array( 505 505 'ok' => __('OK'), 506 506 'cancel' => __('Cancel'), … … 524 524 'published' => __('Published'), 525 525 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), 526 526 'savingText' => __('Saving Draft…'), 527 'permalinkSaved' => __( 'Permalink saved' ), 527 528 ) ); 528 529 529 530 $scripts->add( 'press-this', "/wp-admin/js/press-this$suffix.js", array( 'jquery', 'tags-box' ), false, 1 );