Make WordPress Core

Ticket #21754: 21754.2.patch

File 21754.2.patch, 7.3 KB (added by ocean90, 13 years ago)
  • wp-admin/includes/dashboard.php

     
    503503?>
    504504
    505505        <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press">
    506                 <h4 id="quick-post-title"><label for="title"><?php _e('Title') ?></label></h4>
    507                 <div class="input-text-wrap">
     506                <div class="input-text-wrap" id="title-wrap">
     507                        <label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( 'Enter title here' ); ?></label>
    508508                        <input type="text" name="post_title" id="title" autocomplete="off" value="<?php echo esc_attr( $post->post_title ); ?>" />
    509509                </div>
    510510
     
    514514                </div>
    515515                <?php endif; ?>
    516516
    517                 <h4 id="content-label"><label for="content"><?php _e('Content') ?></label></h4>
    518517                <div class="textarea-wrap">
     518                        <label class="screen-reader-text" for="content"><?php _e( 'Content' ); ?></label>
    519519                        <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"><?php echo esc_textarea( $post->post_content ); ?></textarea>
    520520                </div>
    521521
    522522                <script type="text/javascript">edCanvas = document.getElementById('content');edInsertContent = null;</script>
    523523
    524                 <h4><label for="tags-input"><?php _e('Tags') ?></label></h4>
    525                 <div class="input-text-wrap">
     524                <div class="input-text-wrap" id="tags-input-wrap">
     525                        <label class="screen-reader-text prompt" for="tags-input" id="tags-input-prompt-text"><?php _e( 'Tags (separate with commas)' ); ?></label>
    526526                        <input type="text" name="tags_input" id="tags-input" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
    527527                </div>
    528528
  • wp-admin/js/dashboard.js

     
    1 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
     1var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad, quickPressHint;
    22
    33jQuery(document).ready( function($) {
    44        /* Dashboard Welcome Panel */
     
    6363        postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
    6464
    6565        /* QuickPress */
     66        quickPressHint = function(id) {
     67                id = id || 'title';
     68
     69                var input = $('#' + id), prompt = $('#' + id + '-prompt-text');
     70
     71                if ( input.val() == '' )
     72                        prompt.removeClass('screen-reader-text');
     73
     74                prompt.click(function(){
     75                        $(this).addClass('screen-reader-text');
     76                        input.focus();
     77                });
     78
     79                input.blur(function(){
     80                        if ( this.value == '' )
     81                                prompt.removeClass('screen-reader-text');
     82                }).focus(function(){
     83                        prompt.addClass('screen-reader-text');
     84                }).keydown(function(e){
     85                        prompt.addClass('screen-reader-text');
     86                        $(this).unbind(e);
     87                });
     88        }
     89
    6690        quickPressLoad = function() {
    6791                var act = $('#quickpost-action'), t;
    6892                t = $('#quick-press').submit( function() {
     
    87111
    88112                $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
    89113
     114                quickPressHint();
     115                quickPressHint('tags-input');
     116
    90117        };
    91118        quickPressLoad();
    92119
  • wp-admin/css/wp-admin.css

     
    28052805        position: relative;
    28062806        margin-bottom: 20px;
    28072807}
    2808 #titlediv label { cursor: text; }
    28092808
     2809#titlediv label {
     2810        cursor: text;
     2811}
     2812
    28102813#titlediv div.inside {
    28112814        margin: 0;
    28122815}
     
    60186021}
    60196022
    60206023/* QuickPress */
    6021 #dashboard_quick_press h4 {
    6022         font-family: sans-serif;
    6023         float: left;
    6024         width: 5em;
    6025         clear: both;
    6026         font-weight: normal;
    6027         text-align: right;
    6028         font-size: 12px;
     6024#dashboard_quick_press .input-text-wrap {
     6025        position: relative;
    60296026}
    60306027
    6031 #dashboard_quick_press h4 label {
    6032         margin-right: 10px;
     6028#dashboard_quick_press .prompt {
     6029        color: #bbb;
     6030        position: absolute;
    60336031}
    60346032
     6033#title-wrap label,
     6034#tags-input-wrap label {
     6035        cursor: text;
     6036}
     6037
     6038#title-wrap #title {
     6039        padding: 2px 6px;
     6040        font-size: 1.3em;
     6041        line-height: 100%;
     6042        outline: none;
     6043}
     6044
     6045#tags-input-wrap #tags-input {
     6046        outline: none;
     6047}
     6048
     6049#title-wrap #title-prompt-text {
     6050        font-size: 1.3em;
     6051        padding: 5px 8px;
     6052}
     6053
     6054#tags-input-wrap #tags-input-prompt-text {
     6055        font-size: 1em;
     6056        padding: 4px 8px;
     6057}
     6058
    60356059#dashboard_quick_press .input-text-wrap,
    60366060#dashboard_quick_press .textarea-wrap {
    6037         margin: 0 0 1em 5em;
     6061        margin: 0 0 1em 0;
    60386062}
    60396063
    60406064#dashboard_quick_press .wp-media-buttons {
    6041         margin: 0 0 .5em 5em;
     6065        margin: 0 0 .2em 8px;
    60426066        padding: 0;
    60436067}
    60446068
     
    60466070        color: #777;
    60476071}
    60486072
    6049 #dashboard-widgets #dashboard_quick_press form p.submit {
    6050         margin-left: 4.6em;
    6051 }
    6052 
    60536073#dashboard-widgets #dashboard_quick_press form p.submit input {
    60546074        float: left;
    60556075}
    60566076
    60576077#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
    6058         margin: 0 1em 0 10px;
     6078        margin: 0 1em 0 0;
    60596079}
    60606080
    60616081#dashboard-widgets #dashboard_quick_press form p.submit #publish {
     
    80798099.locale-zh-cn #sort-buttons { font-size: 1em !important; }
    80808100
    80818101/* ru_RU: Text needs more room to breathe. */
    8082 .locale-ru-ru #dashboard_quick_press .input-text-wrap,
    8083 .locale-ru-ru #dashboard_quick_press .textarea-wrap,
    8084 .locale-ru-ru #dashboard_quick_press .wp-media-buttons  {
    8085         margin-left: 5.7em; /* default 5em + 0.7em */
    8086 }
    8087 .locale-ru-ru #dashboard_quick_press h4 {
    8088         width: 5.7em; /* default 5.5em + 0.2em */
    8089 }
    8090 .locale-ru-ru #dashboard-widgets #dashboard_quick_press form p.submit {
    8091         margin-left: 5.3em; /* default 4.6em + 0.7em */
    8092 }
    80938102.locale-ru-ru .inline-edit-row fieldset label span.title {
    80948103        width: auto; /* default 5em */
    80958104        min-width: 5em;
     
    81048113        width: 245px; /* default 200px + 45px */
    81058114}
    81068115
    8107 /* lt_LT: QuickPress + QuickEdit */
    8108 .locale-lt-lt #dashboard_quick_press .input-text-wrap,
    8109 .locale-lt-lt #dashboard_quick_press .textarea-wrap,
    8110 .locale-lt-lt #dashboard_quick_press .wp-media-buttons  {
    8111         margin-left: 7em;
    8112 }
    8113 .locale-lt-lt #dashboard_quick_press h4 {
    8114         width: 7em;
    8115 }
     8116/* lt_LT: QuickEdit */
    81168117.locale-lt-lt .inline-edit-row fieldset label span.title {
    81178118        width: 8em;
    81188119}
  • wp-admin/css/ie-rtl.css

     
    7878        padding-left: 1px;
    7979}
    8080
    81 #dashboard_quick_press h4 {
    82         text-align: right;
    83 }
    84 
    8581.tagchecklist span a {
    8682        margin: 4px -9px 0 0;
    8783}
  • wp-admin/css/wp-admin-rtl.css

     
    18501850}
    18511851
    18521852/* QuickPress */
    1853 #dashboard_quick_press h4 {
    1854         float: right;
    1855         text-align: left;
    1856 }
    1857 
    1858 #dashboard_quick_press .wp-media-buttons {
    1859         margin: 0 5em 0.5em 0;
    1860 }
    1861 
    1862 #dashboard_quick_press h4 label {
    1863         margin-right: 0;
    1864         margin-left: 10px;
    1865 }
    1866 
    1867 #dashboard_quick_press .input-text-wrap,
    1868 #dashboard_quick_press .textarea-wrap {
    1869         margin: 0 5em 1em 0;
    1870 }
    1871 
    1872 #dashboard_quick_press #media-buttons {
    1873         margin: 0 5em .5em 0;
    1874         padding: 0;
    1875 }
    1876 
    1877 #dashboard-widgets #dashboard_quick_press form p.submit {
    1878         margin-left: 0;
    1879         margin-right: 4.6em;
    1880 }
    1881 
    18821853#dashboard-widgets #dashboard_quick_press form p.submit input {
    18831854        float: right;
    18841855}
    18851856
    18861857#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
    1887         margin: 0 10px 0 1em;
     1858        margin: 0 0 0 1em;
    18881859}
    18891860
    18901861#dashboard-widgets #dashboard_quick_press form p.submit #publish {