Changeset 6591
- Timestamp:
- 01/10/2008 08:19:58 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r6588 r6591 174 174 continue; 175 175 $category = get_category( $cat_id ); 176 $c ategory->_is_checked = true;176 $checked_categories[] = $cat_id; 177 177 ob_start(); 178 178 dropdown_categories( 0, $category ); -
trunk/wp-admin/edit-form-advanced.php
r6588 r6591 126 126 <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4> 127 127 <p id="category-add" class="wp-hidden-child"> 128 <input type="text" name="newcat" id="newcat" class="form-required " value="<?php _e( 'New category name' ); ?>" />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 130 <a id="category-add-sumbit" class="add:categorychecklist:categorydiv button" href="<?php echo wp_nonce_url( '', 'add-category' ); ?>"><?php _e( 'Add' ); ?></a> -
trunk/wp-admin/includes/template.php
r6588 r6591 145 145 'children' => get_nested_categories( $default, $parent->term_id ), 146 146 'cat_ID' => $parent->term_id, 147 'checked' => i sset($parent->_is_checked) && $parent->_is_checked,147 'checked' => in_array( $parent->term_id, $checked_categories ), 148 148 'cat_name' => get_the_category_by_ID( $parent->term_id ) 149 149 ); -
trunk/wp-admin/js/post.js
r6588 r6591 70 70 tag_update_quickclicks(); 71 71 // add the quickadd form 72 jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '"/><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');72 jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '"/><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>'); 73 73 jQuery('#tagadd').click( tag_flush_to_text ); 74 74 // jQuery('#newtag').keydown( tag_press_key ); 75 75 jQuery('#newtag').focus(function() { 76 if ( this.value == postL10n.addTag ) { 77 this.value = ''; 78 this.style.color = '#333'; 79 } 76 if ( this.value == postL10n.addTag ) 77 jQuery(this).val( '' ).removeClass( 'form-input-tip' ); 80 78 }); 81 79 jQuery('#newtag').blur(function() { 82 if ( this.value == '' ) { 83 this.value = postL10n.addTag; 84 this.style.color = '#999' 85 } 80 if ( this.value == '' ) 81 jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' ); 86 82 }); 87 83 … … 96 92 97 93 // Ajax Cat 98 var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ) } );94 var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } ); 99 95 jQuery('#category-add-sumbit').click( function() { newCat.focus(); } ); 96 var newCatParent = false; 97 var newCatParentOption = false; 100 98 var catAddAfter = function( r, s ) { 99 if ( !newCatParent ) newCatParent = jQuery('#newcat_parent'); 100 if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' ); 101 101 jQuery(s.what + ' response_data', r).each( function() { 102 102 var t = jQuery(jQuery(this).text()); 103 var o = jQuery( '<option value="' + parseInt( t.find(':input').val(), 10 ) + '"></option>' ); 104 o.text( jQuery.trim( t.text() ) ); 105 jQuery('#newcat_parent').prepend( o ); 103 t.find( 'label' ).each( function() { 104 var th = jQuery(this); 105 var id = th.find('input').val(); 106 if ( newCatParent.find( 'option[value=' + id + ']' ).size() ) 107 return; 108 var name = jQuery.trim( th.text() ); 109 var o = jQuery( '<option value="' + parseInt( id, 10 ) + '"></option>' ).text( name ); 110 newCatParent.prepend( o ); 111 newCatParentOption.attr( 'selected', true ); 112 } ); 106 113 } ); 107 114 }; -
trunk/wp-admin/wp-admin.css
r6588 r6591 1089 1089 #tagchecklist span a:hover { 1090 1090 background: url(images/xit.gif) no-repeat -10px 0; 1091 }1092 1093 #newtag {1094 color: #999;1095 1091 } 1096 1092 … … 1285 1281 .wp-hidden-children .wp-hidden-child { display: none; } 1286 1282 .ui-tabs-hide { display: none; } 1283 .form-input-tip { color: #999; } -
trunk/wp-includes/js/wp-lists.js
r6588 r6591 268 268 e = $(e); 269 269 270 var old = false; var next = false;270 var old = false; 271 271 var _s = { pos: 0, id: 0, oldId: null }; 272 272 if ( 'string' == typeof s ) { s = { what: s }; } … … 274 274 275 275 if ( !e.size() || !s.what ) { return false; } 276 if ( s.oldId ) { 277 old = $('#' + s.what + '-' + s.oldId); 278 next = old.next(); 279 old.remove(); 280 } 281 if ( s.id ) { $('#' + s.what + '-' + s.id).remove(); } 276 if ( s.oldId ) { old = $('#' + s.what + '-' + s.oldId); } 277 if ( s.id && ( s.id != s.oldId || !old || !old.size() ) ) { $('#' + s.what + '-' + s.id).remove(); } 282 278 283 279 if ( old && old.size() ) { 284 if ( next && next.size() ) { 285 next.before(e); 286 } else { 287 list.append(e); 288 } 280 old.replaceWith(e); 289 281 } else if ( isNaN(s.pos) ) { 290 282 var ba = 'after'; … … 332 324 process: function(el) { 333 325 var list = this; 334 var bl = function() { currentFormEl = false; };335 var fo = function() { currentFormEl = this; };336 326 var a = $("[@class^=add:" + list.id + ":]", el || null) 337 327 .filter('form').submit( function() { return list.wpList.add(this); } ).end() … … 341 331 if ( !c ) { return; } 342 332 var forms = []; var ins = []; 343 $('#' + c + ' :input'). click( function() { $(this).unbind( 'blur', bl ).unbind( 'focus', fo ).blur( bl ).focus( fo ).focus(); } ).each( function() {333 $('#' + c + ' :input').focus( function() { currentFormEl = this; } ).blur( function() { currentFormEl = false; } ).each( function() { 344 334 ins.push(this); 345 335 $.merge(forms,$(this).parents('form')); … … 347 337 } ); 348 338 $(forms).submit( function() { 349 var e = currentFormEl; 350 if ( 0 <= $.inArray(e,ins) ) { 339 if ( 0 <= $.inArray(currentFormEl,ins) ) { 351 340 $(addEl).trigger( 'click' ); 352 $( e).focus();341 $(currentFormEl).focus(); 353 342 return false; 354 343 } -
trunk/wp-includes/script-loader.php
r6588 r6591 61 61 ) ); 62 62 63 $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('jquery'), '200801 09' );63 $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('jquery'), '20080110' ); 64 64 $this->localize( 'wp-lists', 'wpListL10n', array( 65 65 'url' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php' … … 109 109 $this->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); 110 110 $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); 111 $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists'), '200801 09' );111 $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists'), '20080110' ); 112 112 $this->localize( 'post', 'postL10n', array( 113 113 'tagsUsed' => __('Tags used on this post:'),
Note: See TracChangeset
for help on using the changeset viewer.