Make WordPress Core

Changeset 22396


Ignore:
Timestamp:
11/06/2012 01:01:52 AM (12 years ago)
Author:
azaozz
Message:

Kill use of colons in class names, props SergeyBiryukov, fixes #21152

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-comments-list-table.php

    r22085 r22396  
    292292    </tfoot>
    293293
    294     <tbody id="the-comment-list" class="list:comment">
     294    <tbody id="the-comment-list" data-wp-lists="list:comment">
    295295        <?php $this->display_rows_or_placeholder(); ?>
    296296    </tbody>
    297297
    298     <tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
     298    <tbody id="the-extra-comment-list" data-wp-lists="list:comment" style="display: none;">
    299299        <?php $this->items = $this->extra_items; $this->display_rows(); ?>
    300300    </tbody>
     
    397397            if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
    398398                if ( 'approved' == $the_comment_status )
    399                     $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
     399                    $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    400400                else if ( 'unapproved' == $the_comment_status )
    401                     $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     401                    $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    402402            } else {
    403                 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    404                 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
     403                $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     404                $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    405405            }
    406406
    407407            if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
    408                 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
     408                $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
    409409            } elseif ( 'spam' == $the_comment_status ) {
    410                 $actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
     410                $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
    411411            } elseif ( 'trash' == $the_comment_status ) {
    412                 $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
     412                $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
    413413            }
    414414
    415415            if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
    416                 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';
     416                $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';
    417417            } else {
    418                 $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
     418                $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
    419419            }
    420420
     
    553553?>
    554554<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;">
    555     <tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
     555    <tbody id="the-comment-list"<?php if ( $singular ) echo " data-wp-lists='list:$singular'"; ?>>
    556556        <?php if ( ! $output_empty ) $this->display_rows_or_placeholder(); ?>
    557557    </tbody>
  • trunk/wp-admin/includes/class-wp-list-table.php

    r22376 r22396  
    733733    </tfoot>
    734734
    735     <tbody id="the-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
     735    <tbody id="the-list"<?php if ( $singular ) echo " data-wp-lists='list:$singular'"; ?>>
    736736        <?php $this->display_rows_or_placeholder(); ?>
    737737    </tbody>
  • trunk/wp-admin/includes/dashboard.php

    r22379 r22396  
    618618
    619619    if ( $comments ) {
    620         echo '<div id="the-comment-list" class="list:comment">';
     620        echo '<div id="the-comment-list" data-wp-lists="list:comment">';
    621621        foreach ( $comments as $comment )
    622622            _wp_dashboard_recent_comments_row( $comment );
     
    661661        $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
    662662
    663         $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    664         $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
     663        $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     664        $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    665665        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>". __('Edit') . '</a>';
    666666        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.esc_attr__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    667         $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
     667        $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
    668668        if ( !EMPTY_TRASH_DAYS )
    669             $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
     669            $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
    670670        else
    671             $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
     671            $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
    672672
    673673        $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
  • trunk/wp-admin/includes/meta-boxes.php

    r22364 r22396  
    424424            echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    425425            ?>
    426             <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear">
     426            <ul id="<?php echo $taxonomy; ?>checklist" data-wp-lists="list:<?php echo $taxonomy?>" class="categorychecklist form-no-clear">
    427427                <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
    428428            </ul>
     
    445445                    </label>
    446446                    <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;' ) ); ?>
    447                     <input type="button" id="<?php echo $taxonomy; ?>-add-submit" class="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
     447                    <input type="button" id="<?php echo $taxonomy; ?>-add-submit" data-wp-lists="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
    448448                    <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?>
    449449                    <span id="<?php echo $taxonomy; ?>-ajax-response"></span>
     
    756756
    757757    <div id="categories-all" class="tabs-panel">
    758         <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
     758        <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
    759759            <?php
    760760            if ( isset($link->link_id) )
     
    777777            <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
    778778            <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
    779             <input type="button" id="link-category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
     779            <input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
    780780            <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
    781781            <span id="category-ajax-response"></span>
  • trunk/wp-admin/includes/nav-menu.php

    r22234 r22396  
    698698            </p>
    699699
    700             <ul id="<?php echo $post_type_name; ?>-search-checklist" class="list:<?php echo $post_type_name?> categorychecklist form-no-clear">
     700            <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
    701701            <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
    702702                <?php
     
    720720                </div>
    721721            <?php endif; ?>
    722             <ul id="<?php echo $post_type_name; ?>checklist" class="list:<?php echo $post_type_name?> categorychecklist form-no-clear">
     722            <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
    723723                <?php
    724724                $args['walker'] = $walker;
     
    897897                </div>
    898898            <?php endif; ?>
    899             <ul id="<?php echo $taxonomy_name; ?>checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear">
     899            <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
    900900                <?php
    901901                $args['walker'] = $walker;
     
    928928            </p>
    929929
    930             <ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear">
     930            <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
    931931            <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
    932932                <?php
  • trunk/wp-admin/includes/template.php

    r22373 r22396  
    422422    </tr>
    423423    </thead>
    424     <tbody id="the-list" class="list:meta">
     424    <tbody id="the-list" data-wp-lists="list:meta">
    425425    <tr><td></td></tr>
    426426    </tbody>
     
    437437    </tr>
    438438    </thead>
    439     <tbody id='the-list' class='list:meta'>
     439    <tbody id='the-list' data-wp-lists='list:meta'>
    440440<?php
    441441    foreach ( $meta as $entry )
     
    493493
    494494    $r .= "\n\t\t<div class='submit'>";
    495     $r .= get_submit_button( __( 'Delete' ), "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta small", "deletemeta[{$entry['meta_id']}]", false );
     495    $r .= get_submit_button( __( 'Delete' ), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array( 'data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce" ) );
    496496    $r .= "\n\t\t";
    497     $r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta small" , "meta-{$entry['meta_id']}-submit", false );
     497    $r .= get_submit_button( __( 'Update' ), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array( 'data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce" ) );
    498498    $r .= "</div>";
    499499    $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
     
    557557<tr><td colspan="2">
    558558<div class="submit">
    559 <?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta secondary', 'addmeta', false, array( 'id' => 'newmeta-submit' ) ); ?>
     559<?php submit_button( __( 'Add Custom Field' ), 'secondary', 'addmeta', false, array( 'id' => 'newmeta-submit', 'data-wp-lists' => 'add:the-list:newmeta' ) ); ?>
    560560</div>
    561561<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
  • trunk/wp-admin/js/cat.js

    r21592 r22396  
    11jQuery(document).ready( function($) {
    22    var myConfirm = function() { return '' !== $('#newcat').val(); };
    3     $('#jaxcat').prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" class="add:categorychecklist:jaxcat" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span><span id="cat-ajax-response"></span>');
     3    $('#jaxcat').prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" data-wp-lists="add:categorychecklist:jaxcat" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span><span id="cat-ajax-response"></span>');
    44    $('#categorychecklist').wpList( { alt: '', response: 'cat-ajax-response', confirm: myConfirm } );
    55} );
  • trunk/wp-admin/js/edit-comments.js

    r22019 r22396  
    3636    // Send current total, page, per_page and url
    3737    delBefore = function( settings, list ) {
    38         var cl = $(settings.target).attr('class'), id, el, n, h, a, author, action = false;
     38        var wpListsData = $(settings.target).attr('data-wp-lists'), id, el, n, h, a, author, action = false;
    3939
    4040        settings.data._total = totalInput.val() || 0;
     
    4444        settings.data.comment_status = $('input[name="comment_status"]', '#comments-form').val();
    4545
    46         if ( cl.indexOf(':trash=1') != -1 )
     46        if ( wpListsData.indexOf(':trash=1') != -1 )
    4747            action = 'trash';
    48         else if ( cl.indexOf(':spam=1') != -1 )
     48        else if ( wpListsData.indexOf(':spam=1') != -1 )
    4949            action = 'spam';
    5050
    5151        if ( action ) {
    52             id = cl.replace(/.*?comment-([0-9]+).*/, '$1');
     52            id = wpListsData.replace(/.*?comment-([0-9]+).*/, '$1');
    5353            el = $('#comment-' + id);
    5454            note = $('#' + action + '-undo-holder').html();
     
    7373            a = $('.undo a', '#undo-' + id);
    7474            a.attr('href', 'comment.php?action=un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce);
    75             a.attr('class', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1 vim-z vim-destructive');
     75            a.attr('data-wp-lists', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1');
     76            a.attr('class', 'vim-z vim-destructive');
    7677            $('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
    7778
     
    280281    theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
    281282        .bind('wpListDelEnd', function(e, s){
    282             var id = s.element.replace(/[^0-9]+/g, '');
    283 
    284             if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1 )
     283            var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
     284
     285            if ( wpListsData.indexOf(':trash=1') != -1 || wpListsData.indexOf(':spam=1') != -1 )
    285286                $('#undo-' + id).fadeIn(300, function(){ $(this).show() });
    286287        });
  • trunk/wp-admin/js/inline-edit-tax.js

    r22019 r22396  
    66        var t = this, row = $('#inline-edit');
    77
    8         t.type = $('#the-list').attr('class').substr(5);
     8        t.type = $('#the-list').attr('data-wp-lists').substr(5);
    99        t.what = '#'+t.type+'-';
    1010
  • trunk/wp-admin/press-this.php

    r22291 r22396  
    507507
    508508                    <div id="category-all" class="tabs-panel">
    509                         <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
     509                        <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
    510510                            <?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?>
    511511                        </ul>
     
    529529                                </label>
    530530                                <?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;' ) ); ?>
    531                                 <input type="button" id="category-add-submit" class="add:categorychecklist:category-add button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
     531                                <input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
    532532                                <?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?>
    533533                                <span id="category-ajax-response"></span>
  • trunk/wp-admin/user-new.php

    r21362 r22396  
    268268    }
    269269?>
    270 <form action="" method="post" name="adduser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
     270<form action="" method="post" name="adduser" id="adduser" class="validate"<?php do_action('user_new_form_tag');?>>
    271271<input name="action" type="hidden" value="adduser" />
    272272<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
     
    301301?>
    302302<p><?php _e('Create a brand new user and add it to this site.'); ?></p>
    303 <form action="" method="post" name="createuser" id="createuser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
     303<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action('user_new_form_tag');?>>
    304304<input name="action" type="hidden" value="createuser" />
    305305<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ) ?>
  • trunk/wp-includes/js/wp-lists.js

    r21781 r22396  
    2222    },
    2323
    24     parseClass: function(e,t) {
    25         var c = [], cl;
     24    parseData: function(e,t) {
     25        var d = [], wpListsData;
    2626
    2727        try {
    28             cl = $(e).attr('class') || '';
    29             cl = cl.match(new RegExp(t+':[\\S]+'));
    30 
    31             if ( cl )
    32                 c = cl[0].split(':');
     28            wpListsData = $(e).attr('data-wp-lists') || '';
     29            wpListsData = wpListsData.match(new RegExp(t+':[\\S]+'));
     30
     31            if ( wpListsData )
     32                d = wpListsData[0].split(':');
    3333        } catch(r) {}
    3434
    35         return c;
     35        return d;
    3636    },
    3737
     
    6565        e = $(e);
    6666        s = s || {};
    67         var list = this, cls = wpList.parseClass(e,'add'), es, valid, formData, res, rres;
     67        var list = this, data = wpList.parseData(e,'add'), es, valid, formData, res, rres;
    6868
    6969        s = wpList.pre.call( list, e, s, 'add' );
    7070
    71         s.element = cls[2] || e.attr( 'id' ) || s.element || null;
    72 
    73         if ( cls[3] )
    74             s.addColor = '#' + cls[3];
     71        s.element = data[2] || e.attr( 'id' ) || s.element || null;
     72
     73        if ( data[3] )
     74            s.addColor = '#' + data[3];
    7575        else
    7676            s.addColor = s.addColor || '#FFFF33';
     
    9595            return false;
    9696
    97         s.data = $.param( $.extend( { _ajax_nonce: s.nonce, action: s.action }, wpAjax.unserialize( cls[4] || '' ) ) );
     97        s.data = $.param( $.extend( { _ajax_nonce: s.nonce, action: s.action }, wpAjax.unserialize( data[4] || '' ) ) );
    9898        formData = $.isFunction(es.fieldSerialize) ? es.fieldSerialize() : es.serialize();
    9999
     
    148148        e = $(e);
    149149        s = s || {};
    150         var list = this, cls = wpList.parseClass(e,'delete'), element, res, rres;
     150        var list = this, data = wpList.parseData(e,'delete'), element, res, rres;
    151151
    152152        s = wpList.pre.call( list, e, s, 'delete' );
    153153
    154         s.element = cls[2] || s.element || null;
    155 
    156         if ( cls[3] )
    157             s.delColor = '#' + cls[3];
     154        s.element = data[2] || s.element || null;
     155
     156        if ( data[3] )
     157            s.delColor = '#' + data[3];
    158158        else
    159159            s.delColor = s.delColor || '#faa';
     
    168168        s.data = $.extend(
    169169            { action: s.action, id: s.element.split('-').pop(), _ajax_nonce: s.nonce },
    170             wpAjax.unserialize( cls[4] || '' )
     170            wpAjax.unserialize( data[4] || '' )
    171171        );
    172172
     
    222222        s = s || {};
    223223
    224         var list = this, cls = wpList.parseClass(e,'dim'), element, isClass, color, dimColor, res, rres;
     224        var list = this, data = wpList.parseData(e,'dim'), element, isClass, color, dimColor, res, rres;
    225225
    226226        s = wpList.pre.call( list, e, s, 'dim' );
    227227
    228         s.element = cls[2] || s.element || null;
    229         s.dimClass =  cls[3] || s.dimClass || null;
    230 
    231         if ( cls[4] )
    232             s.dimAddColor = '#' + cls[4];
     228        s.element = data[2] || s.element || null;
     229        s.dimClass =  data[3] || s.dimClass || null;
     230
     231        if ( data[4] )
     232            s.dimAddColor = '#' + data[4];
    233233        else
    234234            s.dimAddColor = s.dimAddColor || '#FFFF33';
    235235
    236         if ( cls[5] )
    237             s.dimDelColor = '#' + cls[5];
     236        if ( data[5] )
     237            s.dimDelColor = '#' + data[5];
    238238        else
    239239            s.dimDelColor = s.dimDelColor || '#FF3333';
     
    248248        s.data = $.extend(
    249249            { action: s.action, id: s.element.split('-').pop(), dimClass: s.dimClass, _ajax_nonce : s.nonce },
    250             wpAjax.unserialize( cls[6] || '' )
     250            wpAjax.unserialize( data[6] || '' )
    251251        );
    252252
     
    394394            $el = $(el || document);
    395395
    396         $el.delegate( 'form[class^="add:' + list.id + ':"]', 'submit', function(){
     396        $el.delegate( 'form[data-wp-lists^="add:' + list.id + ':"]', 'submit', function(){
    397397            return list.wpList.add(this);
    398398        });
    399399
    400         $el.delegate( 'a[class^="add:' + list.id + ':"], input[class^="add:' + list.id + ':"]', 'click', function(){
     400        $el.delegate( 'a[data-wp-lists^="add:' + list.id + ':"], input[data-wp-lists^="add:' + list.id + ':"]', 'click', function(){
    401401            return list.wpList.add(this);
    402402        });
    403403
    404         $el.delegate( '[class^="delete:' + list.id + ':"]', 'click', function(){
     404        $el.delegate( '[data-wp-lists^="delete:' + list.id + ':"]', 'click', function(){
    405405            return list.wpList.del(this);
    406406        });
    407407
    408         $el.delegate( '[class^="dim:' + list.id + ':"]', 'click', function(){
     408        $el.delegate( '[data-wp-lists^="dim:' + list.id + ':"]', 'click', function(){
    409409            return list.wpList.dim(this);
    410410        });
     
    451451        var _this = this;
    452452
    453         this.wpList = { settings: $.extend( {}, wpList.settings, { what: wpList.parseClass(this,'list')[1] || '' }, settings ) };
     453        this.wpList = { settings: $.extend( {}, wpList.settings, { what: wpList.parseData(this,'list')[1] || '' }, settings ) };
    454454        $.each( fs, function(i,f) { _this.wpList[i] = function( e, s ) { return wpList[f].call( _this, e, s ); }; } );
    455455    } );
Note: See TracChangeset for help on using the changeset viewer.