WordPress.org

Make WordPress Core

Ticket #20855: 20855.4.diff

File 20855.4.diff, 5.4 KB (added by SergeyBiryukov, 19 months 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', '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

     
    6161                                        $(this).fadeOut(2); 
    6262                        }); 
    6363                }); 
     64 
     65                toggleUploadButton = function() { 
     66                        $('#upload-form #submit').prop( 'disabled', '' === $('#upload').val() ); 
     67                }; 
     68 
     69                toggleUploadButton(); 
     70                $('#upload').change( toggleUploadButton ); 
    6471        }); 
    6572 
    66 })(jQuery); 
    67  No newline at end of file 
     73})(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 #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

     
    440440                        'saveAlert' => __('The changes you made will be lost if you navigate away from this page.') 
    441441                ) ); 
    442442 
    443                 $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), false, 1 ); 
    444                 $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 ); 
     443                $scripts->add( 'custom-header', "/wp-admin/js/custom-header$suffix.js", array( 'jquery' ), false, 1 ); 
     444                $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array( 'farbtastic' ), false, 1 ); 
     445                $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array( 'jquery' ), false, 1 ); 
    445446        } 
    446447} 
    447448