Make WordPress Core

Ticket #20855: 20855.diff

File 20855.diff, 3.7 KB (added by kovshenin, 11 years ago)
  • wp-includes/script-loader.php

     
    426426                        'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
    427427                ) );
    428428
     429                $scripts->add( 'custom-header', "/wp-admin/js/custom-header$suffix.js", array('jquery'), false, 1 );
    429430                $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), false, 1 );
    430431                $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 );
    431432        }
  • wp-admin/js/custom-background.dev.js

     
    6161                                        $(this).fadeOut(2);
    6262                        });
    6363                });
     64
     65                $(document).ready(function() {
     66                        $('#upload').change(function() {
     67                                var submit = $(this).next('input[type="submit"]');
     68                                ( '' === $(this).val() ) ? $(submit).hide() : $(submit).show();
     69                        });
     70                });
    6471        });
    6572
    6673})(jQuery);
     74 No newline at end of file
  • wp-admin/js/custom-header.dev.js

     
     1(function($) {
     2
     3        $(document).ready(function() {
     4                $('#upload').change(function() {
     5                        var submit = $(this).next('input[type="submit"]');
     6                        ( '' === $(this).val() ) ? $(submit).hide() : $(submit).show();
     7                });
     8        });
     9
     10})(jQuery);
     11 No newline at end of file
  • wp-admin/custom-header.php

     
    548548        ?></p>
    549549        <form enctype="multipart/form-data" id="upload-form" method="post" action="<?php echo esc_attr( add_query_arg( 'step', 2 ) ) ?>">
    550550        <p>
     551                <input type="hidden" name="action" value="save" />
     552                <?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
    551553                <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
    552554                <input type="file" id="upload" name="import" />
    553                 <input type="hidden" name="action" value="save" />
    554                 <?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
    555                 <?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
     555                <?php submit_button( __( 'Upload' ), 'button hide-if-js', 'submit', false ); ?>
    556556        </p>
    557557        <?php
    558558                $image_library_url = get_upload_iframe_src( 'image', null, 'library' );
  • wp-admin/custom-background.php

     
    256256<th scope="row"><?php _e('Select Image'); ?></th>
    257257<td><form enctype="multipart/form-data" id="upload-form" method="post" action="">
    258258        <p>
     259                <input type="hidden" name="action" value="save" />
     260                <?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
    259261                <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
    260262                <input type="file" id="upload" name="import" />
    261                 <input type="hidden" name="action" value="save" />
    262                 <?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
    263                 <?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
     263                <?php submit_button( __( 'Upload' ), 'button hide-if-js', 'submit', false ); ?>
    264264        </p>
    265265        <?php
    266266                $image_library_url = get_upload_iframe_src( 'image', null, 'library' );