diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 70e6294613..25736302da 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -753,7 +753,14 @@ function wp_manage_posts_columns() { $posts_columns['author'] = __('Author'); $posts_columns['categories'] = __('Categories'); $posts_columns['tags'] = __('Tags'); - if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) + + $post_status = 'all'; + if ( isset($_GET['post_status']) ) + $post_status = $_GET['post_status']; + elseif ( isset($_POST['_status']) ) + $post_status = $_POST['_status']; + + if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) $posts_columns['comments'] = '
Comments
'; $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); @@ -800,10 +807,14 @@ function wp_manage_pages_columns() { $posts_columns['cb'] = ''; $posts_columns['title'] = __('Title'); $posts_columns['author'] = __('Author'); + $post_status = 'all'; - if ( !empty($_GET['post_status']) ) + if ( isset($_GET['post_status']) ) $post_status = $_GET['post_status']; - if ( !in_array($post_status, array('pending', 'draft', 'future')) ) + elseif ( isset($_POST['_status']) ) + $post_status = $_POST['_status']; + + if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) $posts_columns['comments'] = '
'; $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_pages_columns', $posts_columns); @@ -1362,7 +1373,7 @@ function post_rows( $posts = array() ) { * @param unknown_type $mode */ function _post_row($a_post, $pending_comments, $mode) { - global $post; + global $post, $current_user; static $rowclass; $global_post = $post; @@ -1370,7 +1381,6 @@ function _post_row($a_post, $pending_comments, $mode) { setup_postdata($post); $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; - global $current_user; $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); $edit_link = get_edit_post_link( $post->ID ); $title = _draft_or_post_title(); diff --git a/wp-admin/js/inline-edit-post.dev.js b/wp-admin/js/inline-edit-post.dev.js index ecc93b6b68..57a82305d3 100644 --- a/wp-admin/js/inline-edit-post.dev.js +++ b/wp-admin/js/inline-edit-post.dev.js @@ -8,9 +8,6 @@ inlineEditPost = { t.type = $('table.widefat').hasClass('page') ? 'page' : 'post'; t.what = '#'+t.type+'-'; - // get all editable rows - t.rows = $('tr.iedit'); - // prepare the edit rows qeRow.keyup(function(e) { if(e.which == 27) return inlineEditPost.revert(); }); bulkRow.keyup(function(e) { if (e.which == 27) return inlineEditPost.revert(); }); @@ -31,7 +28,7 @@ inlineEditPost = { }); // add events - t.addEvents(t.rows); + $('a.editinline').live('click', function() { inlineEditPost.edit(this); return false; }); $('#bulk-title-div').parents('fieldset').after( $('#inline-edit fieldset.inline-edit-categories').clone() @@ -76,13 +73,6 @@ inlineEditPost = { $(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el); }, - addEvents : function(r) { - r.each(function() { - var row = $(this); - $('a.editinline', row).click(function() { inlineEditPost.edit(this); return false; }); - }); - }, - setBulk : function() { var te = '', type = this.type, tax; this.revert(); @@ -205,7 +195,7 @@ inlineEditPost = { edit_date: 'true' }; - fields = $('#edit-'+id+' :input').fieldSerialize(); + fields = $('#edit-'+id+' :input').serialize(); params = fields + '&' + $.param(params); // make ajax request @@ -217,15 +207,7 @@ inlineEditPost = { if ( -1 != r.indexOf(']*?>/g, '' ); $('#edit-'+id+' .inline-edit-save').append(''+r+''); diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js index f8c9bb3c58..e9f27cf341 100644 --- a/wp-admin/js/inline-edit-post.js +++ b/wp-admin/js/inline-edit-post.js @@ -1 +1 @@ -(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("page")?"page":"post";c.what="#"+c.type+"-";c.rows=a("tr.iedit");d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});c.addEvents(c.rows);a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(".inline-editor ul.cat-checklist").addClass("cat-hover");a(".inline-editor span.cathide").show();a(this).hide()});a("span.cathide").click(function(){a(".inline-editor ul.cat-checklist").removeClass("cat-hover");a(".inline-editor span.catshow").show();a(this).hide()});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},addEvents:function(b){b.each(function(){var c=a(this);a("a.editinline",c).click(function(){inlineEditPost.edit(this);return false})})},setBulk:function(){var d="",c=this.type,b;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(f){if(a(this).attr("checked")){var g=a(this).val(),e;e=a("#inline_"+g+" .post_title").text()||inlineEditL10n.notitle;d+='
X'+e+"
"}});a("#bulk-titles").html(d);a("#bulk-titles a").click(function(){var e=a(this).attr("id").substr(1);a('table.widefat input[value="'+e+'"]').attr("checked","");a("#ttle"+e).remove()});if(c=="post"){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}if(o.type=="post"){j.push("tags_input")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);for(k=0;k0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();if(o.type=="post"){e="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+e,{delay:500,minchars:2,multiple:true,multipleSep:", "})}return false},save:function(d){var c,b;if(typeof(d)=="object"){d=this.getId(d)}a("table.widefat .inline-edit-save .waiting").show();c={action:"inline-save",post_type:this.type,post_ID:d,edit_date:"true"};b=a("#edit-"+d+" :input").fieldSerialize();c=b+"&"+a.param(c);a.post("admin-ajax.php",c,function(e){a("table.widefat .inline-edit-save .waiting").hide();if(e){if(-1!=e.indexOf("]*?>/g,"");a("#edit-"+d+" .inline-edit-save").append(''+e+"")}}else{a("#edit-"+d+" .inline-edit-save").append(''+inlineEditL10n.error+"")}},"html");return false},revert:function(){var b;if(b=a("table.widefat tr.inline-editor").attr("id")){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery); \ No newline at end of file +(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("page")?"page":"post";c.what="#"+c.type+"-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(".inline-editor ul.cat-checklist").addClass("cat-hover");a(".inline-editor span.cathide").show();a(this).hide()});a("span.cathide").click(function(){a(".inline-editor ul.cat-checklist").removeClass("cat-hover");a(".inline-editor span.catshow").show();a(this).hide()});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var d="",c=this.type,b;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(f){if(a(this).attr("checked")){var g=a(this).val(),e;e=a("#inline_"+g+" .post_title").text()||inlineEditL10n.notitle;d+='
X'+e+"
"}});a("#bulk-titles").html(d);a("#bulk-titles a").click(function(){var e=a(this).attr("id").substr(1);a('table.widefat input[value="'+e+'"]').attr("checked","");a("#ttle"+e).remove()});if(c=="post"){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}if(o.type=="post"){j.push("tags_input")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);for(k=0;k0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();if(o.type=="post"){e="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+e,{delay:500,minchars:2,multiple:true,multipleSep:", "})}return false},save:function(d){var c,b;if(typeof(d)=="object"){d=this.getId(d)}a("table.widefat .inline-edit-save .waiting").show();c={action:"inline-save",post_type:this.type,post_ID:d,edit_date:"true"};b=a("#edit-"+d+" :input").serialize();c=b+"&"+a.param(c);a.post("admin-ajax.php",c,function(e){a("table.widefat .inline-edit-save .waiting").hide();if(e){if(-1!=e.indexOf("]*?>/g,"");a("#edit-"+d+" .inline-edit-save").append(''+e+"")}}else{a("#edit-"+d+" .inline-edit-save").append(''+inlineEditL10n.error+"")}},"html");return false},revert:function(){var b;if(b=a("table.widefat tr.inline-editor").attr("id")){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b87ea10109..b7baa05892 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -116,6 +116,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.8.0'); $scripts->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.8.0'); + // not used in core, replaced by Jcrop.js $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.3.2'); @@ -144,12 +145,14 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.1' ); $scripts->add_data( 'jquery-ui-dialog', 'group', 1 ); + // deprecated, not used in core, most functionality is included in jQuery 1.3 $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '2.02m'); $scripts->add_data( 'jquery-form', 'group', 1 ); $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color$suffix.js", array('jquery'), '2.0-4561m'); $scripts->add_data( 'jquery-color', 'group', 1 ); + // deprecated, not used in core $scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' ); $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20090125'); @@ -357,7 +360,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090319' ); $scripts->add_data( 'theme-preview', 'group', 1 ); - $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090125' ); + $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20090725' ); $scripts->add_data( 'inline-edit-post', 'group', 1 ); $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.'),