raw
mp-wp_genesis           1 
mp-wp_genesis 2 jQuery( function($) {
mp-wp_genesis 3
mp-wp_genesis 4 // close postboxes that should be closed
mp-wp_genesis 5 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
mp-wp_genesis 6
mp-wp_genesis 7 // These widgets are sometimes populated via ajax
mp-wp_genesis 8 var ajaxWidgets = [
mp-wp_genesis 9 'dashboard_incoming_links',
mp-wp_genesis 10 'dashboard_primary',
mp-wp_genesis 11 'dashboard_secondary',
mp-wp_genesis 12 'dashboard_plugins'
mp-wp_genesis 13 ];
mp-wp_genesis 14
mp-wp_genesis 15 var ajaxPopulateWidgets = function() {
mp-wp_genesis 16 $.each( ajaxWidgets, function() {
mp-wp_genesis 17 var e = jQuery('#' + this + ':visible div.inside').find('.widget-loading');
mp-wp_genesis 18 if ( e.size() ) { e.parent().load('index-extra.php?jax=' + this); }
mp-wp_genesis 19 } );
mp-wp_genesis 20 };
mp-wp_genesis 21 ajaxPopulateWidgets();
mp-wp_genesis 22
mp-wp_genesis 23 postboxes.add_postbox_toggles('dashboard', { onShow: ajaxPopulateWidgets } );
mp-wp_genesis 24
mp-wp_genesis 25 /* QuickPress */
mp-wp_genesis 26 var quickPressLoad = function() {
mp-wp_genesis 27 var act = $('#quickpost-action');
mp-wp_genesis 28 var t = $('#quick-press').submit( function() {
mp-wp_update-imag... 29 $('#dashboard_quick_press h3').append( '<img src="images/loading.svg" style="margin: 0 6px 0 0; vertical-align: middle" />' );
mp-wp_genesis 30
mp-wp_genesis 31 if ( 'post' == act.val() ) {
mp-wp_genesis 32 act.val( 'post-quickpress-publish' );
mp-wp_genesis 33 }
mp-wp_genesis 34
mp-wp_genesis 35 $('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
mp-wp_genesis 36 $('#dashboard_quick_press h3 img').remove();
mp-wp_genesis 37 $('#dashboard_quick_press ul').find('li').each( function() {
mp-wp_genesis 38 $('#dashboard_recent_drafts ul').prepend( this );
mp-wp_genesis 39 } ).end().remove();
mp-wp_genesis 40 $(this).find('.hide-if-no-js').removeClass('hide-if-no-js');
mp-wp_genesis 41 tb_init('a.thickbox');
mp-wp_genesis 42 quickPressLoad();
mp-wp_genesis 43 } );
mp-wp_genesis 44 return false;
mp-wp_genesis 45 } );
mp-wp_genesis 46
mp-wp_genesis 47 $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
mp-wp_genesis 48
mp-wp_genesis 49 };
mp-wp_genesis 50 quickPressLoad();
mp-wp_genesis 51
mp-wp_genesis 52 } );