Ticket #6243: degrade-swfupload-when-lighty-before-150.diff
File degrade-swfupload-when-lighty-before-150.diff, 4.0 KB (added by , 16 years ago) |
---|
-
wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js
36 36 SWFUpload.gracefulDegradation.swfUploadLoaded = function () { 37 37 var swfupload_container_id, swfupload_container, degraded_container_id, degraded_container, user_swfUploadLoaded_handler; 38 38 try { 39 if (uploadDegradeOptions.is_lighttpd_before_150) throw "Lighttpd versions earlier than 1.5.0 aren't supported!"; 39 40 swfupload_element_id = this.getSetting("swfupload_element_id"); 40 41 degraded_element_id = this.getSetting("degraded_element_id"); 41 42 -
wp-includes/js/swfupload/handlers.js
1 function uploadLoaded() {2 jQuery("#html-upload-ui").remove();3 jQuery("#flash-upload-ui").show();4 }5 6 1 function fileDialogStart() { 7 2 jQuery("#media-upload-error").empty(); 8 3 } -
wp-includes/functions.php
1708 1708 trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s with no alternative available."), $file, $version ) ); 1709 1709 } 1710 1710 } 1711 1712 /** 1713 * is_lighttpd_before_150() - Is the server running earlier than 1.5.0 version of lighttpd 1714 * 1715 * @return bool Whether the server is running lighttpd < 1.5.0 1716 */ 1717 function is_lighttpd_before_150() { 1718 $server_parts = explode( '/', isset( $_SERVER['SERVER_SOFTWARE'] )? $_SERVER['SERVER_SOFTWARE'] : '' ); 1719 $server_parts[1] = isset( $server_parts[1] )? $server_parts[1] : ''; 1720 return 'lighttpd' == $server_parts[0] && -1 == version_compare( $server_parts[1], '1.5.0' ); 1721 } 1711 1722 ?> -
wp-includes/script-loader.php
83 83 $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1'); 84 84 $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2'); 85 85 $this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 86 $this->localize( 'swfupload-degrade', 'uploadDegradeOptions', array( 87 'is_lighttpd_before_150' => is_lighttpd_before_150(), 88 ) ); 86 89 $this->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2'); 87 90 $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080301'); 88 91 // these error messages came from the sample swfupload js, they might need changing. -
wp-admin/includes/media.php
804 804 file_size_limit : "<?php echo wp_max_upload_size(); ?>b", 805 805 swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available 806 806 degraded_element_id : "html-upload-ui", // when swfupload is unavailable 807 swfupload_loaded_handler : uploadLoaded,808 807 file_dialog_start_handler : fileDialogStart, 809 808 file_queued_handler : fileQueued, 810 809 upload_start_handler : uploadStart, … … 834 833 </p> 835 834 <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" /> 836 835 <br class="clear" /> 836 <?php if ( is_lighttpd_before_150() ): ?> 837 <p><?php _e('If you want to use all capabilties of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p> 838 <?php endif;?> 837 839 </div> 838 840 <?php 839 841 }