Provide some Before/After strings for Bulk Upgrades, Add a spinner whilst a upgrade is in process, Remove scrollbars on update iframe. Props ocean90. See #11232

git-svn-id: https://develop.svn.wordpress.org/trunk@14819 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-05-23 12:29:00 +00:00
parent 87c99854d6
commit ce9cca9dd0
4 changed files with 21 additions and 4 deletions

View File

@ -3752,3 +3752,8 @@ h2 .nav-tab {
padding: 4px 20px 6px;
font: italic normal normal 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
}
/* Scrollbar fix for bulk upgrade iframe */
body.update-php {
height: 98%;
}

View File

@ -466,6 +466,7 @@ class Plugin_Upgrader extends WP_Upgrader {
return false;
}
$this->skin->feedback('bulk_upgrade_start');
$this->maintenance_mode(true);
$results = array();
@ -507,7 +508,10 @@ class Plugin_Upgrader extends WP_Upgrader {
if ( false === $result )
break;
} //end foreach $plugins
$this->maintenance_mode(false);
$this->skin->feedback('bulk_upgrade_end');
$this->skin->footer();
// Cleanup our hooks, incase something else does a upgrade on this connection.
@ -704,6 +708,7 @@ class Theme_Upgrader extends WP_Upgrader {
return false;
}
$this->skin->feedback('bulk_upgrade_start');
$this->maintenance_mode(true);
$results = array();
@ -745,7 +750,9 @@ class Theme_Upgrader extends WP_Upgrader {
if ( false === $result )
break;
} //end foreach $plugins
$this->maintenance_mode(false);
$this->skin->feedback('bulk_upgrade_end');
$this->skin->footer();
// Cleanup our hooks, incase something else does a upgrade on this connection.
@ -1057,9 +1064,11 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
function add_strings() {
$this->upgrader->strings['bulk_upgrade_start'] = __('The update process is starting. This process may take awhile on some hosts, so please be patient.');
$this->upgrader->strings['skin_update_failed_error'] = __('An error occured while updating %1$s: <strong>%2$s</strong>.');
$this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.');
$this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>'.__('Show Details').'</span><span class="hidden">'.__('Hide Details').'</span>.</a>';
$this->upgrader->strings['bulk_upgrade_end'] = __('All upgrades have been completed.');
}
function feedback($string) {
@ -1100,11 +1109,13 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
$this->error = implode(', ', $messages);
}
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').hide();</script>';
}
function before($title = '') {
$this->in_loop = true;
printf( '<h4>' . $this->upgrader->strings['skin_before_update_header'] . '</h4>', $title, $this->upgrader->update_current, $this->upgrader->update_count);
printf( '<h4>' . $this->upgrader->strings['skin_before_update_header'] . ' <img alt="" src="' . admin_url( 'images/wpspin_light.gif' ) . '" class="hidden waiting-' . $this->upgrader->update_current . '" style="vertical-align:middle;"></h4>', $title, $this->upgrader->update_current, $this->upgrader->update_count);
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').show();</script>';
echo '<div class="update-messages hide-if-js" id="progress-' . esc_attr($this->upgrader->update_current) . '"><p>';
$this->flush_output();
}
@ -1121,6 +1132,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
if ( !empty($this->result) && !is_wp_error($this->result) ) {
echo '<div class="updated"><p>' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '</p></div>';
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').hide();</script>';
}
$this->reset();
$this->flush_output();

View File

@ -418,7 +418,7 @@ if ( 'upgrade-core' == $action ) {
echo '<div class="wrap">';
screen_icon('plugins');
echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
echo '</div>';
} elseif ( 'do-theme-upgrade' == $action ) {
check_admin_referer('upgrade-core');
@ -441,7 +441,7 @@ if ( 'upgrade-core' == $action ) {
echo '<div class="wrap">';
screen_icon('themes');
echo '<h2>' . esc_html__('Update Themes') . '</h2>';
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
echo '</div>';
}

View File

@ -435,7 +435,7 @@ function wp_default_styles( &$styles ) {
// Any rtl stylesheets that don't have a .dev version for ltr
$no_suffix = array( 'farbtastic' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100523' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100523b' );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20100219' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );