]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/inline-edit-post.dev.js
Wordpress 3.3
[autoinstalls/wordpress.git] / wp-admin / js / inline-edit-post.dev.js
index b470c33521e33ab1c43512391d368d0e92f1ea3f..e73c4a009964389976e880ea0528d53d10047837 100644 (file)
@@ -117,19 +117,19 @@ inlineEditPost = {
                if ( 'post' == type ) {
                        // support multi taxonomies?
                        tax = 'post_tag';
-                       $('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
+                       $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
                }
                $('html, body').animate( { scrollTop: 0 }, 'fast' );
        },
 
        edit : function(id) {
-               var t = this, fields, editRow, rowData, cats, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, tax;
+               var t = this, fields, editRow, rowData, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, cur_format, f;
                t.revert();
 
                if ( typeof(id) == 'object' )
                        id = t.getId(id);
 
-               fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password'];
+               fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password', 'post_format'];
                if ( t.type == 'page' )
                        fields.push('post_parent', 'menu_order', 'page_template');
 
@@ -151,7 +151,15 @@ inlineEditPost = {
                        $('label.inline-edit-author', editRow).hide();
                }
 
-               for ( var f = 0; f < fields.length; f++ ) {
+               // hide unsupported formats, but leave the current format alone
+               cur_format = $('.post_format', rowData).text();
+               $('option.unsupported', editRow).each(function() {
+                       var $this = $(this);
+                       if ( $this.val() != cur_format )
+                               $this.remove();
+               });
+
+               for ( f = 0; f < fields.length; f++ ) {
                        $(':input[name="' + fields[f] + '"]', editRow).val( $('.'+fields[f], rowData).text() );
                }
 
@@ -171,17 +179,18 @@ inlineEditPost = {
                                $('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
                        }
                });
+
                //flat taxonomies
                $('.tags_input', rowData).each(function(){
-                       var terms = $(this).text();
+                       var terms = $(this).text(),
+                               taxname = $(this).attr('id').replace('_' + id, ''),
+                               textarea = $('textarea.tax_input_' + taxname, editRow);
 
-                       if ( terms ) {
-                               taxname = $(this).attr('id').replace('_'+id, '');
-                               $('textarea.tax_input_'+taxname, editRow).val(terms);
-                               $('textarea.tax_input_'+taxname, editRow).suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
-                       }
-               });
+                       if ( terms )
+                               textarea.val(terms);
 
+                       textarea.suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
+               });
 
                // handle the post status
                status = $('._status', rowData).text();