Make WordPress Core

Changeset 10258


Ignore:
Timestamp:
12/27/2008 12:18:38 PM (14 years ago)
Author:
azaozz
Message:

Faster hide-if-no-js, if-js-closed, etc. needed when loading scripts in the footer.

Location:
trunk
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r10172 r10258  
    7373do_action('admin_head');
    7474
    75 if ( $is_iphone ) { ?>
     75wp_print_styles('no-js');
     76?>
     77<script type="text/javascript">
     78(function(){
     79    var nojs = document.getElementById('no-js');
     80    nojs.parentNode.removeChild(nojs);
     81})();
     82</script>
     83
     84<?php if ( $is_iphone ) { ?>
    7685<style type="text/css">.row-actions{visibility:visible;}</style>
    7786<?php } ?>
  • trunk/wp-admin/css/global.css

    r10150 r10258  
    179179.hidden,
    180180.closed .inside,
    181 .hide-if-no-js {
     181.hide-if-js {
    182182    display: none;
    183183}
  • trunk/wp-admin/includes/post.php

    r10256 r10258  
    872872    if ( $closed = get_user_option('closedpostboxes_'.$page, 0, false ) ) {
    873873        if ( !is_array( $closed ) ) return '';
    874         return in_array( $id, $closed )? 'if-js-closed' : '';
     874        return in_array( $id, $closed )? 'closed' : '';
    875875    } else {
    876876        return '';
  • trunk/wp-admin/js/comment.js

    r10064 r10258  
    11jQuery(document).ready( function($) {
    2     jQuery('.hide-if-no-js').show();
    3     jQuery('.hide-if-js').hide();
    42
    53    var stamp = $('#timestamp').html();
  • trunk/wp-admin/js/common.js

    r10232 r10258  
    133133    // pulse
    134134    $('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);
    135 
    136     // show things that should be visible, hide what should be hidden
    137     $('.hide-if-no-js').removeClass('hide-if-no-js');
    138     $('.hide-if-js').hide();
    139135
    140136    // Basic form validation
  • trunk/wp-admin/js/dashboard.js

    r10125 r10258  
    11
    22jQuery( function($) {
    3 
    4 // close postboxes that should be closed
    5 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
    63
    74// These widgets are sometimes populated via ajax
     
    3835                $('#dashboard_recent_drafts ul').prepend( this );
    3936            } ).end().remove();
    40             $(this).find('.hide-if-no-js').removeClass('hide-if-no-js');
    4137            tb_init('a.thickbox');
    4238            quickPressLoad();
  • trunk/wp-admin/js/edit-comments.js

    r10204 r10258  
    304304        $('#replyrow').after(c);
    305305        this.o = id = '#comment-'+r.id;
    306         $(id+' .hide-if-no-js').removeClass('hide-if-no-js');
    307306        this.revert();
    308307        this.addEvents($(id));
  • trunk/wp-admin/js/inline-edit-post.js

    r10101 r10258  
    221221                            row.find('td.column-comments').hide();
    222222
    223                         row.find('.hide-if-no-js').removeClass('hide-if-no-js');
    224223                        inlineEditPost.addEvents(row);
    225224                        row.fadeIn();
  • trunk/wp-admin/js/inline-edit-tax.js

    r10150 r10258  
    3737        r.each(function() {
    3838            $(this).find('a.editinline').click(function() { inlineEditTax.edit(this); return false; });
    39             $(this).find('.hide-if-no-js').removeClass('hide-if-no-js');
    4039        });
    4140    },
     
    117116                        row.hide();
    118117
    119                         row.find('.hide-if-no-js').removeClass('hide-if-no-js');
    120118                        inlineEditTax.addEvents(row);
    121119                        row.fadeIn();
  • trunk/wp-admin/js/link.js

    r9703 r10258  
    11jQuery(document).ready( function($) {
    2     // close postboxes that should be closed
    3     jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
    42
    53    jQuery('#link_name').focus();
  • trunk/wp-admin/js/page.js

    r9956 r10258  
    22    postboxes.add_postbox_toggles('page');
    33    make_slugedit_clickable();
    4 
    5     // close postboxes that should be closed
    6     jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
    74
    85    jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );
  • trunk/wp-admin/js/post.js

    r10255 r10258  
    151151jQuery(document).ready( function($) {
    152152    tagCloud.init();
    153 
    154     // close postboxes that should be closed
    155     jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
    156153
    157154    // postboxes
     
    468465                    if ( 'object' == typeof r && r.responses[0] ) {
    469466                        $('#the-comment-list').append( r.responses[0].data );
    470                         $('#the-comment-list .hide-if-no-js').removeClass('hide-if-no-js');
    471467
    472468                        theList = theExtraList = null;
  • trunk/wp-admin/wp-admin.css

    r10237 r10258  
    671671}
    672672
    673 .tablenav .tablenav-pages a, .tablenav-pages span.current  {
     673.tablenav .tablenav-pages a,
     674.tablenav-pages span.current  {
    674675    text-decoration: none;
    675676    border: none;
     
    705706}
    706707
    707 #update-nag, .plugin-update {
     708#update-nag,
     709.plugin-update {
    708710    line-height: 29px;
    709711    font-size: 12px;
     
    715717}
    716718
    717 #update-nag a, .plugin-update a {
     719#update-nag a,
     720.plugin-update a {
    718721    font-size: 1.1em;
    719722}
  • trunk/wp-includes/class.wp-styles.php

    r9002 r10258  
    4040
    4141        $href = $this->_css_href( $this->registered[$handle]->src, $ver, $handle );
     42        $rel = isset($this->registered[$handle]->extra['alt']) && $this->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
     43        $title = isset($this->registered[$handle]->extra['title']) ? "title='" . attribute_escape( $this->registered[$handle]->extra['title'] ) . "'" : '';
    4244
    4345        $end_cond = '';
     
    4749        }
    4850
    49         echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$href' type='text/css' media='$media' />\n", $handle );
     51        echo apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle' $title href='$href' type='text/css' media='$media' />\n", $handle );
    5052        if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) {
    5153            if ( is_bool( $this->registered[$handle]->extra['rtl'] ) )
     
    5456                $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" );
    5557
    56             echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$rtl_href' type='text/css' media='$media' />\n", $handle );
     58            echo apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle );
    5759        }
    5860
  • trunk/wp-includes/script-loader.php

    r10222 r10258  
    4242    $scripts->default_version = get_bloginfo( 'version' );
    4343
    44     $scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081210' );
     44    $scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081226' );
    4545    $scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
    4646
     
    162162            'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
    163163        ) );
    164         $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20081211' );
     164        $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20081226' );
    165165        $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
    166166            'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
     
    180180            'l10n_print_after' => 'try{convertEntities(slugL10n);}catch(e){};'
    181181        ) );
    182         $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20081217' );
     182        $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20081226' );
    183183        $scripts->localize( 'post', 'postL10n', array(
    184184            'tagsUsed' =>  __('Tags used on this post:'),
     
    206206            'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};'
    207207        ) );
    208         $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'wp-lists', 'postbox'), '20081210' );
     208        $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'wp-lists', 'postbox'), '20081226' );
    209209        $scripts->localize( 'page', 'postL10n', array(
    210210            'cancel' => __('Cancel'),
     
    227227            'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};'
    228228        ) );
    229         $scripts->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20081210' );
    230         $scripts->add( 'comment', '/wp-admin/js/comment.js', array('jquery'), '20081210' );
     229        $scripts->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20081226' );
     230        $scripts->add( 'comment', '/wp-admin/js/comment.js', array('jquery'), '20081226' );
    231231        $scripts->localize( 'comment', 'commentL10n', array(
    232232            'cancel' => __('Cancel'),
     
    263263        $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20081210' );
    264264
    265         $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081210' );
     265        $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081226' );
    266266        $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
    267267            'error' => __('Error while saving the changes.'),
     
    271271        ) );
    272272
    273         $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081210' );
     273        $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081226' );
    274274        $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
    275275            'error' => __('Error while saving the changes.'),
     
    285285        $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
    286286
    287         $scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox' ), '20081210' );
     287        $scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox' ), '20081226' );
    288288
    289289        $scripts->add( 'hoverIntent', '/wp-includes/js/hoverIntent.js', array('jquery'), '20081210' );
     
    322322
    323323    $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20081210' );
    324     $styles->add_data( 'ie', 'conditional', 'gte IE 6' );
     324    $styles->add_data( 'ie', 'conditional', 'lte IE 7' );
    325325
    326326    $styles->add( 'colors', true, array(), '20081210' ); // Register "meta" stylesheet for admin colors
     
    330330    $styles->add_data( 'colors-classic', 'rtl', true );
    331331
    332     $styles->add( 'global', '/wp-admin/css/global.css', array(), '20081210' );
     332    $styles->add( 'global', '/wp-admin/css/global.css', array(), '20081226' );
    333333    $styles->add( 'media', '/wp-admin/css/media.css', array(), '20081210' );
    334334    $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20081210' );
     
    341341    $styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20081210' );
    342342    $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
     343    $styles->add( 'no-js', '/wp-admin/css/no-js.css', array(), '20081225' );
    343344
    344345    foreach ( $rtl_styles as $rtl_style )
Note: See TracChangeset for help on using the changeset viewer.