Changeset 6597
- Timestamp:
- 01/10/2008 10:42:49 PM (17 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r6591 r6597 128 128 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" /> 129 129 <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); ?> 130 <a id="category-add-sumbit" class="add:categorychecklist:categorydiv button" href="<?php echo wp_nonce_url( '', 'add-category' ); ?>"><?php _e( 'Add' ); ?></a> 130 <input type="button" id="category-add-sumbit" class="add:categorychecklist:categorydiv button" value="<?php _e( 'Add' ); ?>" /> 131 <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?> 131 132 <span id="category-ajax-response"></span> 132 133 </p> … … 135 136 <ul id="category-tabs"> 136 137 <li class="ui-tabs-selected"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li> 137 <li ><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>138 <li class="wp-no-js-hidden"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li> 138 139 </ul> 139 140 … … 144 145 </div> 145 146 146 <div id="categories-pop" class="ui-tabs-panel" >147 <div id="categories-pop" class="ui-tabs-panel" style="display: none;"> 147 148 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear"> 148 149 <?php wp_popular_categories_checklist(); ?> -
trunk/wp-admin/includes/template.php
r6591 r6597 189 189 190 190 function wp_popular_categories_checklist( $default = 0, $number = 10 ) { 191 global $checked_categories;192 193 wp_set_checked_post_categories( $default );194 195 191 $categories = get_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number ) ); 196 192 197 193 foreach ( (array) $categories as $category ) { 198 194 $id = "popular-category-$category->term_id"; 199 $checked = in_array( $category->term_id, $checked_categories ) ? ' checked="checked"' : '';200 195 ?> 201 196 202 197 <li id="<?php echo $id; ?>"> 203 198 <label class="selectit" for="in-<?php echo $id; ?>"> 204 <input id="in-<?php echo $id; ?>" type="checkbox" name="post_category[]" value="<?php echo (int) $category->term_id; ?>"<?php echo $checked; ?>/>199 <input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" /> 205 200 <?php echo wp_specialchars( apply_filters( 'the_category', $category->name ) ); ?> 206 201 </label> -
trunk/wp-admin/js/common.js
r6582 r6597 2 2 // pulse 3 3 jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300); 4 5 jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' ); 4 6 }); -
trunk/wp-admin/js/post.js
r6591 r6597 96 96 var newCatParent = false; 97 97 var newCatParentOption = false; 98 var noSyncChecks = false; // prophylactic. necessary? 99 var syncChecks = function() { 100 if ( noSyncChecks ) 101 return; 102 noSyncChecks = true; 103 var th = jQuery(this); 104 var c = th.is(':checked'); 105 var id = th.val().toString(); 106 jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c ); 107 noSyncChecks = false; 108 }; 98 109 var catAddAfter = function( r, s ) { 99 110 if ( !newCatParent ) newCatParent = jQuery('#newcat_parent'); … … 103 114 t.find( 'label' ).each( function() { 104 115 var th = jQuery(this); 105 var id = th.find('input').val(); 106 if ( newCatParent.find( 'option[value=' + id + ']' ).size() ) 116 var val = th.find('input').val(); 117 var id = th.find('input')[0].id 118 jQuery('#' + id).change( syncChecks ); 119 if ( newCatParent.find( 'option[value=' + val + ']' ).size() ) 107 120 return; 108 121 var name = jQuery.trim( th.text() ); 109 var o = jQuery( '<option value="' + parseInt( id, 10 ) + '"></option>' ).text( name );122 var o = jQuery( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name ); 110 123 newCatParent.prepend( o ); 111 newCatParentOption.attr( 'selected', true );112 124 } ); 125 newCatParentOption.attr( 'selected', true ); 113 126 } ); 114 127 }; … … 123 136 return false; 124 137 } ); 138 jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change(); 125 139 }); -
trunk/wp-admin/wp-admin.css
r6591 r6597 1238 1238 } 1239 1239 1240 #category-add input#category-add-sumbit { 1241 width: auto; 1242 } 1243 1240 1244 #categorydiv ul#category-tabs { 1241 1245 float: left; … … 1280 1284 /* Global classes */ 1281 1285 .wp-hidden-children .wp-hidden-child { display: none; } 1286 .wp-no-js-hidden { display: none; } 1282 1287 .ui-tabs-hide { display: none; } 1283 1288 .form-input-tip { color: #999; }
Note: See TracChangeset
for help on using the changeset viewer.