Ticket #6979: flash_degradation.diff

File flash_degradation.diff, 2.8 KB (added by filosofo, 4 years ago)
  • wp-includes/js/swfupload/handlers.js

     
    206206} 
    207207 
    208208function swfuploadPreLoad() { 
    209         return true; 
     209        jQuery('#' + swfu.customSettings.degraded_element_id).hide(); 
     210        jQuery('#' + swfu.customSettings.swfupload_element_id).show(); 
    210211} 
    211212 
    212213function swfuploadLoadFailed() { 
    213         return true; 
     214        jQuery('#' + swfu.customSettings.swfupload_element_id).hide(); 
     215        jQuery('#' + swfu.customSettings.degraded_element_id).show(); 
    214216} 
    215217 
    216218function uploadError(fileObj, error_code, message) { 
  • wp-admin/includes/media.php

     
    12251225                        button_height: "24", 
    12261226                        button_width: "132", 
    12271227                        button_image_url: '<?php echo includes_url('images/upload.png'); ?>', 
    1228                         button_placeholder_id: "async-upload-wrap", 
     1228                        button_placeholder_id: "flash-browse-button", 
    12291229                        upload_url : "<?php echo attribute_escape( $flash_action_url ); ?>", 
    12301230                        flash_url : "<?php echo includes_url('js/swfupload/swfupload.swf'); ?>", 
    12311231                        file_post_name: "async-upload", 
     
    12391239                                "short" : "1" 
    12401240                        }, 
    12411241                        file_size_limit : "<?php echo wp_max_upload_size(); ?>b", 
    1242                         swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available 
    1243                         degraded_element_id : "html-upload-ui",   // when swfupload is unavailable 
    12441242                        file_dialog_start_handler : fileDialogStart, 
    12451243                        file_queued_handler : fileQueued, 
    12461244                        upload_start_handler : uploadStart, 
     
    12521250                        file_dialog_complete_handler : fileDialogComplete, 
    12531251                        swfupload_pre_load_handler: swfuploadPreLoad, 
    12541252                        swfupload_load_failed_handler: swfuploadLoadFailed, 
    1255  
     1253                        custom_settings : {  
     1254                                degraded_element_id : "html-upload-ui", // id of the element displayed when swfupload is unavailable 
     1255                                swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available 
     1256                        }, 
    12561257                        debug: false 
    12571258                }); 
    12581259        $("#flash-browse-button").bind( "click", function(){swfu.selectFiles();}); 
     
    12621263 
    12631264<div id="flash-upload-ui"> 
    12641265<?php do_action('pre-flash-upload-ui'); ?> 
    1265         <p><input id="flash-browse-button" type="button" value="<?php echo attribute_escape( __( 'Choose files to upload' ) ); ?>" class="button" /></p> 
     1266        <div id="flash-browse-button"></div> 
     1267        <p><?php _e( 'Choose files to upload' ); ?></p> 
    12661268<?php do_action('post-flash-upload-ui'); ?> 
    12671269        <p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p> 
    12681270</div> 
     
    18451847        echo '</p>'; 
    18461848} 
    18471849 
    1848 add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); 
    1849  
    18501850/** 
    18511851 * {@internal Missing Short Description}} 
    18521852 *