(0 . 0)(1 . 52)
48917
48918 jQuery( function($) {
48919
48920 // close postboxes that should be closed
48921 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
48922
48923 // These widgets are sometimes populated via ajax
48924 var ajaxWidgets = [
48925 'dashboard_incoming_links',
48926 'dashboard_primary',
48927 'dashboard_secondary',
48928 'dashboard_plugins'
48929 ];
48930
48931 var ajaxPopulateWidgets = function() {
48932 $.each( ajaxWidgets, function() {
48933 var e = jQuery('#' + this + ':visible div.inside').find('.widget-loading');
48934 if ( e.size() ) { e.parent().load('index-extra.php?jax=' + this); }
48935 } );
48936 };
48937 ajaxPopulateWidgets();
48938
48939 postboxes.add_postbox_toggles('dashboard', { onShow: ajaxPopulateWidgets } );
48940
48941 /* QuickPress */
48942 var quickPressLoad = function() {
48943 var act = $('#quickpost-action');
48944 var t = $('#quick-press').submit( function() {
48945 $('#dashboard_quick_press h3').append( '<img src="images/loading.gif" style="margin: 0 6px 0 0; vertical-align: middle" />' );
48946
48947 if ( 'post' == act.val() ) {
48948 act.val( 'post-quickpress-publish' );
48949 }
48950
48951 $('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
48952 $('#dashboard_quick_press h3 img').remove();
48953 $('#dashboard_quick_press ul').find('li').each( function() {
48954 $('#dashboard_recent_drafts ul').prepend( this );
48955 } ).end().remove();
48956 $(this).find('.hide-if-no-js').removeClass('hide-if-no-js');
48957 tb_init('a.thickbox');
48958 quickPressLoad();
48959 } );
48960 return false;
48961 } );
48962
48963 $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
48964
48965 };
48966 quickPressLoad();
48967
48968 } );