Make WordPress Core

Ticket #28640: 28640.patch

File 28640.patch, 2.5 KB (added by azaozz, 11 years ago)
  • src/wp-admin/includes/media.php

     
    17591759
    17601760$plupload_init = array(
    17611761        'runtimes'            => 'html5,flash,silverlight,html4',
    1762         'browse_button'       => 'plupload-browse-button',
    17631762        'container'           => 'plupload-upload-ui',
    17641763        'drop_element'        => 'drag-drop-area',
    17651764        'file_data_name'      => 'async-upload',
     
    17721771        'multipart_params'    => $post_params,
    17731772);
    17741773
     1774$_is_ios = ( wp_is_mobile() && preg_match( '/iPad|iPhone|iPod touch/', $_SERVER['HTTP_USER_AGENT'] ) );
     1775// iOS gets 2 buttons, one for selecting multiple existing files,
     1776// another for taking a snapshot and uploading it directly
     1777if ( $_is_ios ) {
     1778        $plupload_init['browse_button'] = array('plupload-browse-button-single','plupload-browse-button');
     1779} else {
     1780        $plupload_init['browse_button'] = 'plupload-browse-button';
     1781}
     1782
    17751783/**
    17761784 * Filter the default Plupload settings.
    17771785 *
     
    18101818        <div class="drag-drop-inside">
    18111819        <p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
    18121820        <p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
    1813         <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
     1821        <p class="drag-drop-buttons">
     1822                <button id="plupload-browse-button" type="button" class="button"><?php _e('Select Files'); ?></button>
     1823                <?php
     1824
     1825                if ( $_is_ios ) {
     1826                        ?>
     1827                        <button id="plupload-browse-button-single" type="button" class="button"><?php _e('Select Source'); ?></button>
     1828                        <?php
     1829                }
     1830
     1831                ?>
     1832        </p>
    18141833        </div>
    18151834</div>
    18161835<?php
  • src/wp-includes/js/plupload/handlers.js

     
    479479                uploader.bind('UploadComplete', function() {
    480480                        uploadComplete();
    481481                });
     482
     483                $(document).on( 'touchstart', function( event ) {
     484                        var shims = $('input[id^="html5_"]'),
     485                                multi = shims && shims[0],
     486                                single = shims && shims[1];
     487
     488                        if ( multi && event.target === multi ) {
     489                                uploader.setOption( 'multi_selection', true );
     490                        } else if ( single && event.target === single ) {
     491                                uploader.setOption( 'multi_selection', false );
     492                        }
     493                });
    482494        };
    483495
    484496        if ( typeof(wpUploaderInit) == 'object' ) {