// Improve new install style (new progress bar)

This commit is contained in:
rMalie
2011-12-30 14:37:27 +00:00
parent c4c71dc5f9
commit bbf6c71e48
5 changed files with 48 additions and 63 deletions
+6 -7
View File
@@ -224,13 +224,12 @@ class InstallControllerHttpProcess extends InstallControllerHttp
public function display()
{
$this->process_steps = array(
'installDatabase',
'populateDatabase',
'configureShop',
'installModules',
'installFixtures',
'installTheme',
//'preactivation',
array('key' => 'installDatabase', 'lang' => $this->l('Create database tables')),
array('key' => 'populateDatabase', 'lang' => $this->l('Populate database tables')),
array('key' => 'configureShop', 'lang' => $this->l('Configure shop informations')),
array('key' => 'installModules', 'lang' => $this->l('Install modules')),
array('key' => 'installFixtures', 'lang' => $this->l('Install demonstration data')),
array('key' => 'installTheme', 'lang' => $this->l('Install theme')),
);
$this->displayTemplate('process');
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

+16 -30
View File
@@ -5,8 +5,6 @@ $(document).ready(function()
start_install();
});
is_installing_count = 0;
is_installing_max = 5;
current_step = 0;
function start_install()
{
@@ -17,7 +15,6 @@ function start_install()
$('.process_step').removeClass('fail').removeClass('success').hide();
$('.error_log').hide();
setTimeout(text_is_installing, 500);
$('#progress_bar').show();
$('#progress_bar .installing').show();
process_install();
@@ -27,10 +24,12 @@ function process_install(step)
{
if (!step)
step = process_steps[0];
$('.installing').hide().html(step.lang+' ...').fadeIn('slow');
$.ajax({
url: 'index.php',
data: step+'=true',
data: step.key+'=true',
dataType: 'json',
cache: false,
success: function(json)
@@ -38,11 +37,12 @@ function process_install(step)
// No error during this step
if (json.success)
{
$('#progress_bar_'+step).addClass('complete');
$('#process_step_'+step).show().addClass('success');
$('#process_step_'+step.key).show().addClass('success');
current_step++;
if (current_step >= process_steps.length)
{
$('#progress_bar .total .progress').animate({'width': '100%'}, 500);
// Installation finished
setTimeout(function()
{
@@ -51,6 +51,8 @@ function process_install(step)
}
else
{
$('#progress_bar .total .progress').animate({'width': '+='+process_percent+'%'}, 500);
// Process next step
process_install(process_steps[current_step]);
}
@@ -58,13 +60,13 @@ function process_install(step)
// An error occured during this step
else
{
install_error(step, json.message);
install_error(step.key, json.message);
}
},
// An error HTTP (page not found, json not valid, etc.) occured during this step
error: function()
{
install_error(step);
install_error(step.key);
}
});
}
@@ -73,12 +75,11 @@ function install_error(step, errors)
{
current_step = 0;
is_installing = false;
$('#process_step_'+step).show().addClass('fail');
$('#process_step_'+step.key).show().addClass('fail');
$.each(process_steps, function(k, v)
{
$('#progress_bar_'+v).removeClass('complete');
$('#progress_bar_'+v.key).removeClass('complete');
});
$('#progress_bar .installing').hide();
if (errors)
{
@@ -92,30 +93,15 @@ function install_error(step, errors)
display += '<li>'+v+'</li>';
});
display += '</ol>';
$('#process_step_'+step+' .error_log').html(display).show();
$('#process_step_'+step.key+' .error_log').html(display).show();
}
}
function install_success()
{
$('.installing').html(install_is_done);
return;
is_installing = false;
$('#install_process_form').slideUp();
$('#install_process_success').slideDown();
}
function text_is_installing()
{
if (!is_installing)
return;
var text = '';
for (var i = 0; i <= is_installing_count; i++)
text += '.';
$('#progress_bar .installing span').html(text);
is_installing_count++;
if (is_installing_count == is_installing_max)
is_installing_count = 0;
setTimeout(text_is_installing, 500);
}
+18 -14
View File
@@ -695,24 +695,28 @@ ul#optional_update {list-style-type:none;}
#progress_bar {
display: none;
}
#progress_bar table {
#progress_bar .total {
width: 100%;
height: 30px;
border: 1px solid #999999;
background-color: #eeeeee;
}
#progress_bar table td {
background-color: #eeeeee;
height: 25px;
margin: 3px;
}
#progress_bar table td.complete {
background-color: #74A3DC;
}
#progress_bar .total .progress {
width: 0px;
height: 30px;
background-color: #74A3DC;
}
#progress_bar .installing {
background: url("img/ajax-loader-small.gif") no-repeat scroll 0 0 transparent;
font-size: 14px;
font-style: italic;
padding-left: 20px;
display: none;
background: url("img/ajax-loader-small.gif") no-repeat scroll 0 0 transparent;
display: none;
font-size: 18px;
font-style: italic;
font-weight: bold;
height: 26px;
padding-left: 36px;
padding-top: 6px;
}
#progress_bar ol {
+8 -12
View File
@@ -2,28 +2,24 @@
<script type="text/javascript">
<!--
var install_is_done = '<?php echo addslashes($this->l('Done !')) ?>';
var process_steps = <?php echo Tools::jsonEncode($this->process_steps) ?>;
var process_percent = <?php echo 100 / count($this->process_steps) ?>;
-->
</script>
<div id="install_process_form">
<div id="progress_bar">
<div class="installing">
<?php echo $this->l('Installing') ?> <span></span>
</div>
<div class="installing"></div>
<table>
<tr>
<?php foreach ($this->process_steps as $item): ?>
<td id="progress_bar_<?php echo $item ?>" style="width: <?php floor(100 / count($this->process_steps)) ?>%">&nbsp;</td>
<?php endforeach; ?>
</tr>
</table>
<div class="total">
<div class="progress"></div>
</div>
<ol class="process_list">
<?php foreach ($this->process_steps as $item): ?>
<li id="process_step_<?php echo $item ?>" class="process_step">
<?php echo $this->l('process_step_'.$item) ?>
<li id="process_step_<?php echo $item['key'] ?>" class="process_step">
<?php echo $item['lang'] ?>
<div class="error_log"></div>
</li>
<?php endforeach; ?>