Make WordPress Core

Changeset 30002


Ignore:
Timestamp:
10/24/2014 01:20:42 AM (12 years ago)
Author:
azaozz
Message:

Editor: use <button> instead of <a> for the Visual/Text buttons, make them focusable. Props afercia, fixes #27553

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/edit.css

    r29832 r30002  
    14331433        }
    14341434
    1435         a.wp-switch-editor {
     1435        button.wp-switch-editor {
    14361436                font-size: 16px;
    14371437                line-height: 1em;
    1438                 margin: 3px 0 0 7px;
    1439                 padding: 12px 15px;
     1438                margin: 7px 0 0 7px;
     1439                padding: 8px 12px;
    14401440        }
    14411441
  • trunk/src/wp-admin/edit-form-advanced.php

    r29671 r30002  
    505505        'dfw' => true,
    506506        'drag_drop_upload' => true,
    507         'tabfocus_elements' => 'insert-media-button,save-post',
     507        'tabfocus_elements' => 'content-html,save-post',
    508508        'editor_height' => 300,
    509509        'tinymce' => array(
  • trunk/src/wp-includes/class-wp-editor.php

    r29994 r30002  
    178178                        }
    179179
    180                         $buttons .= '<a id="' . $editor_id . '-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</a>\n";
    181                         $buttons .= '<a id="' . $editor_id . '-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">' . __('Visual') . "</a>\n";
     180                        $buttons .= '<button type="button" id="' . $editor_id . '-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">' . __('Visual') . "</button>\n";
     181                        $buttons .= '<button type="button" id="' . $editor_id . '-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</button>\n";
    182182                }
    183183
  • trunk/src/wp-includes/css/editor.css

    r29773 r30002  
    828828
    829829.wp-switch-editor {
     830        float: left;
     831        box-sizing: content-box;
     832        position: relative;
     833        top: 1px;
    830834        background: #ebebeb;
    831         border: 1px solid #dedede;
    832835        color: #777;
    833836        cursor: pointer;
    834         float: right;
    835837        font: 13px/19px "Open Sans", sans-serif;
    836         height: 19px;
     838        height: 20px;
    837839        margin: 5px 0 0 5px;
    838840        padding: 3px 8px 4px;
    839         position: relative;
    840         top: 1px;
     841        border: 1px solid #e5e5e5;
     842}
     843
     844.wp-switch-editor:focus {
     845        -webkit-box-shadow:
     846                0 0 0 1px #5b9dd9,
     847                0 0 2px 1px rgba(30, 140, 190, .8);
     848        box-shadow:
     849                0 0 0 1px #5b9dd9,
     850                0 0 2px 1px rgba(30, 140, 190, .8);
     851        outline: none;
     852        color: #222;
     853}
     854
     855.wp-switch-editor:active,
     856.html-active .switch-html:focus,
     857.tmce-active .switch-tmce:focus {
     858        -webkit-box-shadow: none;
     859        box-shadow: none;
    841860}
    842861
    843862.wp-switch-editor:active {
    844         background-color: #f1f1f1;
    845 }
    846 
    847 .wp-switch-editor:hover {
    848         text-decoration: none !important;
    849         background: #fff;
     863        background-color: #f5f5f5;
     864        -webkit-box-shadow: none;
     865        box-shadow: none;
    850866}
    851867
     
    862878        background: #f5f5f5;
    863879        color: #555;
    864         height: 20px;
    865         border-bottom: none;
     880        border-bottom-color: #f5f5f5;
    866881}
    867882
Note: See TracChangeset for help on using the changeset viewer.