WordPress.org

Making WordPress.org

Changeset 6791


Ignore:
Timestamp:
02/27/2018 03:37:12 AM (3 years ago)
Author:
obenland
Message:

2FA: Don't use submit and cancel buttons.

See #77.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor/js/profile-edit.js

    r6757 r6791  
    11/* global ajaxurl:true */
    22jQuery( function( $ ) {
    3     $( '#two-factor-active' ).on( 'click', '[type="cancel"]', function( event ) {
     3    $( '#two-factor-active' ).on( 'click', '.two-factor-disable', function( event ) {
    44        event.preventDefault();
    55
     
    4545
    4646    $( 'fieldset.two-factor' )
    47         .not( '#two-factor-active' ).on( 'click', '[type="cancel"]', function( event ) {
     47        .not( '#two-factor-active' ).on( 'click', '.two-factor-cancel', function( event ) {
    4848        event.preventDefault();
    4949
     
    5555        $( '#two-factor-start' ).show();
    5656    } )
    57         .on( 'click', '[type="submit"]', function( event ) {
     57        .on( 'click', '.two-factor-submit', function( event ) {
    5858            event.preventDefault();
    5959
     
    118118
    119119    var $printAgreement   = $( '#print-agreement' ),
    120         $backupDoneButton = $( '.two-factor-backup-codes-wrapper button[type="submit"]' );
     120        $backupDoneButton = $( '.two-factor-backup-codes-wrapper .two-factor-submit' );
    121121
    122122    $printAgreement.on( 'change', function() {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor/wporg-two-factor.php

    r6789 r6791  
    397397                <fieldset class="bbp-form">
    398398                    <div>
    399                         <button type="cancel" class="button button-secondary alignright"><?php esc_html_e( 'Disable Two Factor Authentication', 'wporg' ); ?></button>
     399                        <button type="button" class="button button-secondary two-factor-disable alignright"><?php esc_html_e( 'Disable Two Factor Authentication', 'wporg' ); ?></button>
    400400                        <p class="status"><?php echo wp_kses_post( __( '<strong>Status:</strong> <span>Active</span>', 'wporg' ) ); ?></p>
    401401                    </div>
     
    424424                                <a href="" class="button button-secondary dashicons-before dashicons-download" id="two-factor-backup-codes-download" title="<?php esc_attr_e( 'Download Codes', 'wporg' ); ?>" download="two-factor-backup-codes.txt"><span class="screen-reader-text"><?php esc_html_e( 'Download Codes', 'wporg' ); ?></span></a>
    425425                            </span>
    426                             <button type="submit" class="button button-secondary" disabled="disabled"><?php esc_html_e( 'All Finished!', 'wporg' ); ?></button>
     426                            <button type="button" class="button two-factor-submit button-secondary" disabled="disabled"><?php esc_html_e( 'All Finished!', 'wporg' ); ?></button>
    427427                        </div>
    428428                    </div>
     
    461461                    ?>
    462462                </small>
    463                 <button type="cancel" class="button button-secondary alignleft"><?php esc_html_e( 'Cancel', 'wporg' ); ?></button>
    464                 <button type="submit" class="button button-primary alignright"><?php esc_html_e( 'Enable', 'wporg' ); ?></button>
     463                <button type="button" class="button button-secondary two-factor-cancel alignleft"><?php esc_html_e( 'Cancel', 'wporg' ); ?></button>
     464                <button type="button" class="button button-primary two-factor-submit alignright"><?php esc_html_e( 'Enable', 'wporg' ); ?></button>
    465465            </div>
    466466        </fieldset>
     
    484484                    ?>
    485485                </small>
    486                 <button type="cancel" class="button button-secondary alignleft"><?php esc_html_e( 'Cancel', 'wporg' ); ?></button>
    487                 <button type="submit" class="button button-primary alignright"><?php esc_html_e( 'Enable', 'wporg' ); ?></button>
     486                <button type="button" class="button button-secondary two-factor-cancel alignleft"><?php esc_html_e( 'Cancel', 'wporg' ); ?></button>
     487                <button type="button" class="button button-primary two-factor-submit alignright"><?php esc_html_e( 'Enable', 'wporg' ); ?></button>
    488488            </div>
    489489        </fieldset>
     
    523523            }
    524524
    525             .two-factor-backup-codes-wrapper [type="submit"] {
     525            .two-factor-backup-codes-wrapper .two-factor-submit {
    526526                vertical-align: middle;
    527527            }
Note: See TracChangeset for help on using the changeset viewer.