Changeset 7682
- Timestamp:
- 04/14/2008 11:09:14 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r6830 r7682 21 21 wp_die(__('You do not have permission to upload files.')); 22 22 23 // just fetch the detail form for that attachment 24 if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { 25 echo get_media_item($id); 26 exit; 27 } 28 23 29 $id = media_handle_upload('async-upload', $_REQUEST['post_id']); 24 30 if (is_wp_error($id)) { … … 27 33 } 28 34 29 $type = $_REQUEST['type']; 30 echo apply_filters("async_upload_{$type}", $id); 35 if ( $_REQUEST['short'] ) { 36 // short form response - attachment ID only 37 echo $id; 38 } 39 else { 40 // long form response - big chunk o html 41 $type = $_REQUEST['type']; 42 echo apply_filters("async_upload_{$type}", $id); 43 } 31 44 32 45 ?> -
trunk/wp-admin/includes/media.php
r7677 r7682 805 805 "auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>", 806 806 "type" : "<?php echo $type; ?>", 807 "tab" : "<?php echo $tab; ?>" 807 "tab" : "<?php echo $tab; ?>", 808 "short" : "1" 808 809 }, 809 810 file_size_limit : "<?php echo wp_max_upload_size(); ?>b", -
trunk/wp-includes/js/swfupload/handlers.js
r7677 r7682 36 36 jQuery('#media-item-' + fileObj.id + ' .progress').hide(); 37 37 38 // Append the HTML returned by the server -- thumbnail and form inputs 39 jQuery('#media-item-' + fileObj.id).append(serverData); 38 // Old style: Append the HTML returned by the server -- thumbnail and form inputs 39 if ( isNaN(serverData) || !serverData ) { 40 jQuery('#media-item-' + fileObj.id).append(serverData); 41 prepareMediaItemInit(fileObj); 42 } 43 // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server 44 else { 45 jQuery('#media-item-' + fileObj.id).load('async-upload.php', {attachment_id:serverData, fetch:1}, function(){prepareMediaItemInit(fileObj);updateMediaForm()}); 46 } 47 } 48 49 function prepareMediaItemInit(fileObj) { 40 50 41 51 // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename -
trunk/wp-includes/script-loader.php
r7679 r7682 88 88 ) ); 89 89 $this->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2'); 90 $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080 331');90 $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080407'); 91 91 // these error messages came from the sample swfupload js, they might need changing. 92 92 $this->localize( 'swfupload-handlers', 'swfuploadL10n', array(
Note: See TracChangeset
for help on using the changeset viewer.