Ticket #28640: 28640.patch
File 28640.patch, 2.5 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/media.php
1759 1759 1760 1760 $plupload_init = array( 1761 1761 'runtimes' => 'html5,flash,silverlight,html4', 1762 'browse_button' => 'plupload-browse-button',1763 1762 'container' => 'plupload-upload-ui', 1764 1763 'drop_element' => 'drag-drop-area', 1765 1764 'file_data_name' => 'async-upload', … … 1772 1771 'multipart_params' => $post_params, 1773 1772 ); 1774 1773 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 1777 if ( $_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 1775 1783 /** 1776 1784 * Filter the default Plupload settings. 1777 1785 * … … 1810 1818 <div class="drag-drop-inside"> 1811 1819 <p class="drag-drop-info"><?php _e('Drop files here'); ?></p> 1812 1820 <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> 1814 1833 </div> 1815 1834 </div> 1816 1835 <?php -
src/wp-includes/js/plupload/handlers.js
479 479 uploader.bind('UploadComplete', function() { 480 480 uploadComplete(); 481 481 }); 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 }); 482 494 }; 483 495 484 496 if ( typeof(wpUploaderInit) == 'object' ) {