Ticket #6988: 6988.002.diff
File 6988.002.diff, 2.9 KB (added by , 17 years ago) |
---|
-
trunk/wp-admin/includes/media.php
213 213 $post['post_title'] = $attachment['post_title']; 214 214 if ( isset($attachment['post_excerpt']) ) 215 215 $post['post_excerpt'] = $attachment['post_excerpt']; 216 if ( isset($attachment['menu_order']) ) 217 $post['menu_order'] = $attachment['menu_order']; 216 218 217 219 $post = apply_filters('attachment_fields_to_save', $post, $attachment); 218 220 … … 413 415 $errors = $return; 414 416 } 415 417 418 wp_enqueue_script('admin-gallery'); 416 419 return wp_iframe( 'media_upload_gallery_form', $errors ); 417 420 } 418 421 … … 549 552 </script>\n", 550 553 'helps' => __('Enter a link URL or click above for presets.'), 551 554 ), 555 'menu_order' => array( 556 'label' => __('Order'), 557 'value' => $edit_post->menu_order 558 ), 552 559 ); 553 560 554 561 foreach ( get_attachment_taxonomies($post) as $taxonomy ) { -
trunk/wp-admin/js/gallery.js
1 jQuery(function($) { 2 var gallerySortable; 3 var gallerySortableInit = function() { 4 try { // a hack to make sortables work in jQuery 1.2+ and IE7 5 $('#media-items').SortableDestroy(); 6 } catch(e) {} 7 $('#media-items .media-item'). 8 gallerySortable = $('#media-items').Sortable( { 9 accept: 'media-item', 10 helperclass: 'sorthelper', 11 // handle: 'img.pinkynail', 12 onchange: galleryReorder, 13 onStop: gallerySortableInit 14 } ); 15 } 16 17 var galleryReorder = function(myOrder) { 18 jQuery.each(myOrder[0]['o']['media-items'], function(i, id) { 19 jQuery('#' + id + ' .menu_order input')[0].value = i; 20 }) 21 } 22 23 // initialize sortable 24 gallerySortableInit(); 25 $('#media-items .media-item').css({ 26 position: 'static', 27 cursor: 'move' 28 }); 29 }); -
trunk/wp-includes/script-loader.php
165 165 'cancel' => __('Cancel'), 166 166 'edit' => __('Edit'), 167 167 ) ); 168 $this->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'interface' ), '20080517' ); 168 169 $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' ); 169 170 $this->localize( 'upload', 'uploadL10n', array( 170 171 'browseTitle' => attribute_escape(__('Browse your files')), … … 199 200 $this->localize( 'word-count', 'wordCountL10n', array( 200 201 'count' => __('Word count: %d') 201 202 )); 202 203 203 204 $this->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080511' ); 204 205 $this->localize( 'wp-gears', 'wpGearsL10n', array( 205 206 'updateCompleted' => __('Update completed.'),