Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed May 30, 2015
1 parent 202abec commit e03f38d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
Expand Up @@ -16,12 +16,8 @@

<div id="update-progress">
<div id="extprogress">
<div class="extprogrow">
<?php
echo JHtml::_(
'image', 'media/bar.gif', JText::_('COM_JOOMLAUPDATE_VIEW_PROGRESS'),
array('class' => 'progress', 'id' => 'progress'), true
); ?>
<div id="progress" class="progress progress-striped active">
<div id="progress-bar" class="bar bar-success" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="extprogrow">
<span class="extlabel"><?php echo JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_PERCENT'); ?></span>
Expand Down
Expand Up @@ -43,9 +43,6 @@ public function display($tpl=null)
JToolbarHelper::preferences('com_joomlaupdate');
}

// Load mooTools.
JHtml::_('behavior.framework', true);

// Include jQuery.
JHtml::_('jquery.framework');

Expand All @@ -63,7 +60,6 @@ public function display($tpl=null)
$document->addScript('../media/com_joomlaupdate/encryption.js');
$document->addScript('../media/com_joomlaupdate/update.js');
JHtml::_('jquery.framework');
JHtml::_('script', 'system/progressbar.js', true, true);
JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);
$document->addScriptDeclaration($updateScript);

Expand Down
21 changes: 11 additions & 10 deletions media/com_joomlaupdate/update.js
Expand Up @@ -4,7 +4,6 @@ var joomlaupdate_stat_outbytes = 0;
var joomlaupdate_stat_files = 0;
var joomlaupdate_stat_percent = 0;
var joomlaupdate_factory = null;
var joomlaupdate_progress_bar = null;

/**
* An extremely simple error handler, dumping error messages to screen
Expand Down Expand Up @@ -166,20 +165,22 @@ function processUpdateStep(data)
joomlaupdate_stat_inbytes += data.bytesIn;
joomlaupdate_stat_percent = (joomlaupdate_stat_inbytes * 100) / joomlaupdate_totalsize;

// Create progress bar once
if (joomlaupdate_progress_bar == null)
{
joomlaupdate_progress_bar = new Fx.ProgressBar(document.getElementById('progress'));
// Update progress bar
if (joomlaupdate_stat_percent < 100) {
jQuery('#progress-bar').css('width', joomlaupdate_stat_percent + '%').attr('aria-valuenow', joomlaupdate_stat_percent);
}
else {
jQuery('#progress-bar').removeClass('bar-success');
}
joomlaupdate_progress_bar.set(joomlaupdate_stat_percent);

joomlaupdate_stat_outbytes += data.bytesOut;
joomlaupdate_stat_files += data.files;

// Display data
document.getElementById('extpercent').innerHTML = new Number(joomlaupdate_stat_percent).formatPercentage(1);
document.getElementById('extbytesin').innerHTML = new Number(joomlaupdate_stat_inbytes).format();
document.getElementById('extbytesout').innerHTML = new Number(joomlaupdate_stat_outbytes).format();
document.getElementById('extfiles').innerHTML = new Number(joomlaupdate_stat_files).format();
document.getElementById('extpercent').innerHTML = joomlaupdate_stat_percent + '%';
document.getElementById('extbytesin').innerHTML = joomlaupdate_stat_inbytes + '';
document.getElementById('extbytesout').innerHTML = joomlaupdate_stat_outbytes + '';
document.getElementById('extfiles').innerHTML = joomlaupdate_stat_files + '';

// Do AJAX post
post = {
Expand Down

0 comments on commit e03f38d

Please sign in to comment.