Changeset 7336
- Timestamp:
- 03/16/2008 08:37:02 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r7162 r7336 247 247 } 248 248 249 if ( category_exists( trim( $_POST['cat_name'] ) ) ) { 250 $x = new WP_Ajax_Response( array( 251 'what' => 'cat', 252 'id' => new WP_Error( 'cat_exists', __('The category you are trying to create already exists.'), array( 'form-field' => 'cat_name' ) ), 253 ) ); 254 $x->send(); 255 } 256 249 257 $cat = wp_insert_category( $_POST, true ); 250 258 -
trunk/wp-includes/js/wp-ajax-response.js
r7262 r7336 51 51 return true; 52 52 }, 53 invalidateForm: function ( selector ) { 54 return jQuery( selector ).addClass( 'form-invalid' ).change( function() { jQuery(this).removeClass( 'form-invalid' ); } ); 55 }, 53 56 validateForm: function( selector ) { 54 57 selector = jQuery( selector ); 55 return ! selector.find('.form-required').andSelf().filter('.form-required:has(:input[value=""]), .form-required:input[value=""]').addClass( 'form-invalid' ).change( function() { jQuery(this).removeClass( 'form-invalid' ); }).size();58 return !wpAjax.invalidateForm( selector.find('.form-required').andSelf().filter('.form-required:has(:input[value=""]), .form-required:input[value=""]') ).size(); 56 59 } 57 60 }, wpAjax || { noPerm: 'You do not have permission to do that.', broken: 'AJAX is teh b0rked.' } ); -
trunk/wp-includes/script-loader.php
r7316 r7336 42 42 $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); 43 43 44 $this->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '2008031 2' );44 $this->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080316' ); 45 45 $this->localize( 'wp-ajax-response', 'wpAjax', array( 46 46 'noPerm' => 'You do not have permission to do that.',
Note: See TracChangeset
for help on using the changeset viewer.