Making WordPress.org

Ticket #2800: 2800.2.diff

File 2800.2.diff, 1.9 KB (added by SergeyBiryukov, 9 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-committers.php

     
    3636                if ( current_user_can( 'plugin_add_committer', $post ) || current_user_can( 'plugin_remove_committer', $post ) ) {
    3737                        wp_enqueue_script( 'wporg-plugins-committers', plugins_url( 'js/committers.js', __FILE__ ), array( 'wp-util' ), true );
    3838                        wp_localize_script( 'wporg-plugins-committers', 'committersWidget', array(
    39                                 'restUrl'    => get_rest_url(),
    40                                 'restNonce'  => wp_create_nonce( 'wp_rest' ),
    41                                 'pluginSlug' => $post->post_name,
     39                                'restUrl'            => get_rest_url(),
     40                                'restNonce'          => wp_create_nonce( 'wp_rest' ),
     41                                'pluginSlug'         => $post->post_name,
     42                                'removeCommitterAYS' => __( 'Are you sure you want to remove this committer?', 'wporg-plugins' ),
    4243                        ) );
    4344                }
    4445
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/js/committers.js

     
    1818
    1919                $( '#committer-list' )
    2020                        .on( 'click', '.remove', function() {
     21                                if ( ! window.confirm( pluginDir.removeCommitterAYS ) ) {
     22                                        return;
     23                                }
     24
    2125                                var $row = $( this ).addClass( 'spinner' ).parents( 'li' ),
    2226                                        url = pluginDir.restUrl + 'plugins/v1/plugin/' + pluginDir.pluginSlug + '/committers/' + $row.data( 'user' ) + '/?_wpnonce=' + pluginDir.restNonce;
    2327