]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/post.js
Wordpress 2.6.2
[autoinstalls/wordpress.git] / wp-admin / js / post.js
index c938af3015b5f8f16ceebeaf198b245c62bc257e..8f786d21663cd78c663af47fe8673f3797bb3c2e 100644 (file)
@@ -18,6 +18,8 @@ function new_tag_remove_tag() {
 }
 
 function tag_update_quickclicks() {
+       if ( jQuery( '#tags-input' ).length == 0 )
+               return;
        var current_tags = jQuery( '#tags-input' ).val().split(',');
        jQuery( '#tagchecklist' ).empty();
        shown = false;
@@ -96,7 +98,7 @@ jQuery(document).ready( function() {
        jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );
 
        // auto-suggest stuff
-       jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2 } );
+       jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
        jQuery('#newtag').keypress( tag_press_key );
 
        // category tabs
@@ -118,8 +120,9 @@ jQuery(document).ready( function() {
                jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
                noSyncChecks = false;
        };
+       var popularCats = jQuery('#categorychecklist-pop :checkbox').map( function() { return parseInt(jQuery(this).val(), 10); } ).get().join(',');
        var catAddBefore = function( s ) {
-               s.data += '&' + jQuery( '#categorychecklist :checked' ).serialize();
+               s.data += '&popular_ids=' + popularCats + '&' + jQuery( '#categorychecklist :checked' ).serialize();
                return s;
        };
        var catAddAfter = function( r, s ) {
@@ -149,7 +152,8 @@ jQuery(document).ready( function() {
        } );
        jQuery('#category-add-toggle').click( function() {
                jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' );
-               categoryTabs.tabsClick( 1 );
+               // categoryTabs.tabs( 'select', '#categories-all' ); // this is broken (in the UI beta?)
+               categoryTabs.find( 'a[href="#categories-all"]' ).click();
                jQuery('#newcat').focus();
                return false;
        } );
@@ -177,5 +181,9 @@ jQuery(document).ready( function() {
                if ( jQuery.isFunction( autosave_update_post_ID ) ) {
                        autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
                }
-       } });
+       }, addBefore: function( s ) {
+               s.data += '&post_id=' + jQuery('#post_ID').val();
+               return s;
+       }
+       });
 });