WordPress.org

Make WordPress Core

Changeset 21894


Ignore:
Timestamp:
09/18/2012 06:45:44 PM (6 years ago)
Author:
nacin
Message:

Replace QuickPress labels with gray prompt texts. Stylish, but also done for localization purposes (string lengths). props ocean90. fixes #21754.

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/ie-rtl.css

    r21592 r21894  
    7777    padding-right: 0;
    7878    padding-left: 1px;
    79 }
    80 
    81 #dashboard_quick_press h4 {
    82     text-align: right;
    8379}
    8480
  • trunk/wp-admin/css/wp-admin-rtl.css

    r21878 r21894  
    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;
     
    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
  • trunk/wp-admin/css/wp-admin.css

    r21878 r21894  
    28112811    margin-bottom: 10px;
    28122812}
    2813 #titlediv label { cursor: text; }
     2813
     2814#titlediv label {
     2815    cursor: text;
     2816}
    28142817
    28152818#titlediv div.inside {
     
    60506053
    60516054/* QuickPress */
    6052 #dashboard_quick_press h4 {
    6053     font-family: sans-serif;
    6054     float: left;
    6055     width: 5em;
    6056     clear: both;
    6057     font-weight: normal;
    6058     text-align: right;
    6059     font-size: 12px;
    6060 }
    6061 
    6062 #dashboard_quick_press h4 label {
    6063     margin-right: 10px;
     6055#dashboard_quick_press .input-text-wrap {
     6056    position: relative;
     6057}
     6058
     6059#dashboard_quick_press .prompt {
     6060    color: #bbb;
     6061    position: absolute;
     6062}
     6063
     6064#title-wrap label,
     6065#tags-input-wrap label {
     6066    cursor: text;
     6067}
     6068
     6069#title-wrap #title {
     6070    padding: 2px 6px;
     6071    font-size: 1.3em;
     6072    line-height: 100%;
     6073    outline: none;
     6074}
     6075
     6076#tags-input-wrap #tags-input {
     6077    outline: none;
     6078}
     6079
     6080#title-wrap #title-prompt-text {
     6081    font-size: 1.3em;
     6082    padding: 5px 8px;
     6083}
     6084
     6085#tags-input-wrap #tags-input-prompt-text {
     6086    font-size: 1em;
     6087    padding: 4px 8px;
    60646088}
    60656089
    60666090#dashboard_quick_press .input-text-wrap,
    60676091#dashboard_quick_press .textarea-wrap {
    6068     margin: 0 0 1em 5em;
     6092    margin: 0 0 1em 0;
    60696093}
    60706094
    60716095#dashboard_quick_press .wp-media-buttons {
    6072     margin: 0 0 .5em 5em;
     6096    margin: 0 0 .2em 8px;
    60736097    padding: 0;
    60746098}
     
    60786102}
    60796103
    6080 #dashboard-widgets #dashboard_quick_press form p.submit {
    6081     margin-left: 4.6em;
    6082 }
    6083 
    60846104#dashboard-widgets #dashboard_quick_press form p.submit input {
    60856105    float: left;
     
    60876107
    60886108#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
    6089     margin: 0 0.3em 0 5px;
     6109    margin: 0 1em 0 0;
    60906110}
    60916111
     
    81108130
    81118131/* ru_RU: Text needs more room to breathe. */
    8112 .locale-ru-ru #dashboard_quick_press .input-text-wrap,
    8113 .locale-ru-ru #dashboard_quick_press .textarea-wrap,
    8114 .locale-ru-ru #dashboard_quick_press .wp-media-buttons  {
    8115     margin-left: 5.7em; /* default 5em + 0.7em */
    8116 }
    8117 .locale-ru-ru #dashboard_quick_press h4 {
    8118     width: 5.7em; /* default 5.5em + 0.2em */
    8119 }
    8120 .locale-ru-ru #dashboard-widgets #dashboard_quick_press form p.submit {
    8121     margin-left: 5.3em; /* default 4.6em + 0.7em */
    8122 }
    81238132.locale-ru-ru .inline-edit-row fieldset label span.title {
    81248133    width: auto; /* default 5em */
     
    81358144}
    81368145
    8137 /* lt_LT: QuickPress + QuickEdit */
    8138 .locale-lt-lt #dashboard_quick_press .input-text-wrap,
    8139 .locale-lt-lt #dashboard_quick_press .textarea-wrap,
    8140 .locale-lt-lt #dashboard_quick_press .wp-media-buttons  {
    8141     margin-left: 7em;
    8142 }
    8143 .locale-lt-lt #dashboard_quick_press h4 {
    8144     width: 7em;
    8145 }
     8146/* lt_LT: QuickEdit */
    81468147.locale-lt-lt .inline-edit-row fieldset label span.title {
    81478148    width: 8em;
  • trunk/wp-admin/includes/dashboard.php

    r21838 r21894  
    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>
     
    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>
     
    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>
  • trunk/wp-admin/js/dashboard.js

    r21592 r21894  
    8888        $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
    8989
     90        $('#title, #tags-input').each( function() {
     91            var input = $(this), prompt = $('#' + this.id + '-prompt-text');
     92
     93            if ( '' === this.value )
     94                prompt.removeClass('screen-reader-text');
     95
     96            prompt.click( function() {
     97                $(this).addClass('screen-reader-text');
     98                input.focus();
     99            });
     100
     101            input.blur( function() {
     102                if ( '' === this.value )
     103                    prompt.removeClass('screen-reader-text');
     104            });
     105
     106            input.focus( function() {
     107                prompt.addClass('screen-reader-text');
     108            });
     109        });
    90110    };
    91111    quickPressLoad();
Note: See TracChangeset for help on using the changeset viewer.