WordPress.org

Make WordPress Core

Ticket #20855: 20855.6.diff

File 20855.6.diff, 5.3 KB (added by SergeyBiryukov, 6 years ago)
  • wp-admin/includes/plugin-install.php

     
    142142 */
    143143function install_plugins_upload( $page = 1 ) {
    144144?>
    145         <h4><?php _e('Install a plugin in .zip format') ?></h4>
    146         <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.') ?></p>
    147         <form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-plugin') ?>">
    148                 <?php wp_nonce_field( 'plugin-upload') ?>
     145        <h4><?php _e('Install a plugin in .zip format'); ?></h4>
     146        <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.'); ?></p>
     147        <form method="post" enctype="multipart/form-data" id="upload-form" action="<?php echo self_admin_url('update.php?action=upload-plugin'); ?>">
     148                <?php wp_nonce_field( 'plugin-upload'); ?>
    149149                <label class="screen-reader-text" for="pluginzip"><?php _e('Plugin zip file'); ?></label>
    150150                <input type="file" id="pluginzip" name="pluginzip" />
    151                 <input type="submit" class="button" value="<?php esc_attr_e('Install Now') ?>" />
     151                <?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?>
    152152        </form>
    153153<?php
    154154}
  • wp-admin/includes/theme-install.php

     
    134134
    135135function install_themes_upload($page = 1) {
    136136?>
    137 <h4><?php _e('Install a theme in .zip format') ?></h4>
    138 <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
    139 <form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-theme') ?>">
    140         <?php wp_nonce_field( 'theme-upload') ?>
    141         <input type="file" name="themezip" />
     137<h4><?php _e('Install a theme in .zip format'); ?></h4>
     138<p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.'); ?></p>
     139<form method="post" enctype="multipart/form-data" id="upload-form" action="<?php echo self_admin_url('update.php?action=upload-theme'); ?>">
     140        <?php wp_nonce_field( 'theme-upload'); ?>
     141        <input type="file" id="themezip" name="themezip" />
    142142        <?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?>
    143143</form>
    144144        <?php
  • wp-admin/js/custom-background.js

     
    1919                $('input[name="background-repeat"]').change(function() {
    2020                        bgImage.css('background-repeat', $(this).val());
    2121                });
     22
     23                toggleUploadButton = function() {
     24                        $('#upload-form #submit').prop( 'disabled', '' === $('#upload').val() );
     25                };
     26
     27                toggleUploadButton();
     28                $('#upload').change( toggleUploadButton );
    2229        });
    2330
    24 })(jQuery);
    25  No newline at end of file
     31})(jQuery);
  • wp-admin/js/custom-header.js

     
     1(function($) {
     2
     3        $(document).ready( function() {
     4                toggleUploadButton = function() {
     5                        $('#upload-form #submit').prop( 'disabled', '' === $('#upload').val() );
     6                };
     7
     8                toggleUploadButton();
     9                $('#upload').change( toggleUploadButton );
     10        });
     11
     12})(jQuery);
  • wp-admin/js/plugin-install.js

     
    5050        $('a.install-now').click( function() {
    5151                return confirm( plugininstallL10n.ays );
    5252        });
     53
     54        toggleUploadButton = function() {
     55                $('#upload-form #install-plugin-submit').prop( 'disabled', '' === $('#pluginzip').val() );
     56        };
     57
     58        toggleUploadButton();
     59        $('#pluginzip').change( toggleUploadButton );
    5360});
  • wp-admin/js/theme.js

     
    112112jQuery( document ).ready( function($) {
    113113        theme_viewer = new ThemeViewer();
    114114        theme_viewer.init();
     115
     116        toggleUploadButton = function() {
     117                $('#upload-form #install-theme-submit').prop( 'disabled', '' === $('#themezip').val() );
     118        };
     119
     120        toggleUploadButton();
     121        $('#themezip').change( toggleUploadButton );
    115122});
    116123
    117124
  • wp-includes/script-loader.php

     
    470470                        'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
    471471                ) );
    472472
     473                $scripts->add( 'custom-header', "/wp-admin/js/custom-header$suffix.js", array( 'jquery' ), false, 1 );
    473474                $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array( 'wp-color-picker' ), false, 1 );
    474475                $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 );
    475476        }