WordPress/wp-admin/js/dashboard.js

1 line
1.6 KiB
JavaScript
Raw Normal View History

var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(c){function b(d,h){var g,f=a("#"+h+" div.inside:visible").find(".widget-loading");if(f.length){g=f.parent();setTimeout(function(){g.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+h,"",function(){g.hide().slideDown("normal",function(){a(this).css("display","")})})},d*500)}}if(c){c=c.toString();if(a.inArray(c,ajaxWidgets)!=-1){b(0,c)}}else{a.each(ajaxWidgets,b)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()});