Catalyst-Plugin-UploadProgress

 view release on metacpan or  search on metacpan

example/Upload/root/static/css/progress.css  view on Meta::CPAN

    height: 20px;
    width: 380px;
}

.progressmeter .meter .amount {
    background-color: #667799;
    width: 0px;
    height: 20px
}

.progressmeter .meter .percent {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 20px;
    z-index: 1000;
    text-align: center;
    font-family: Arial;
    font-size: 18px;
    font-weight: bold;

example/Upload/root/static/js/progress.jmpl  view on Meta::CPAN

<span class="progressmeter">
  <div class="meter">
    <div class="amount"  style="width: [% percent %]%;"></div>
    <div class="percent" style="width: 100%">[% percent %]%</div>
  </div>
  <table>
    <tbody>
      <tr>
        <th>Status:</th>
        <td>
[% IF finished -%]
          <span class="finished">Transfer complete  ([% size %])</span>
[% ELSIF aborted -%]
          <span class="aborted">Transfer aborted</span>

example/Upload/root/static/js/progress.jmpl.js  view on Meta::CPAN

    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['progress.jmpl'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="progressmeter">\n  <div class="meter">\n    <div class="amount"  style="width: ';
//line 3 "progress.jmpl"
output += stash.get('percent');
output += '%;"></div>\n    <div class="percent" style="width: 100%">';
//line 4 "progress.jmpl"
output += stash.get('percent');
output += '%</div>\n  </div>\n  <table>\n    <tbody>\n      <tr>\n        <th>Status:</th>\n        <td>\n';
//line 17 "progress.jmpl"
if (stash.get('finished')) {
output += '          <span class="finished">Transfer complete  (';
//line 12 "progress.jmpl"
output += stash.get('size');
output += ')</span>\n';
}
else if (stash.get('aborted')) {
output += '          <span class="aborted">Transfer aborted</span>\n';

example/Upload/root/static/js/progress.js  view on Meta::CPAN

        else
            progress.remainingtime = '';

        progress.currentrate   = formatBytes(progress.currentrate);
        progress.rate          = formatBytes(progress.rate);
        progress.elapsedtime   = formatTime(progress.elapsedtime);
        progress.remainingtime = formatTime(progress.remainingtime);
    }

    if (progress.size != 0)
        progress.percent = Math.round(progress.received / progress.size * 100);

    progress.size     = formatBytes(progress.size);
    progress.received = formatBytes(progress.received);

    document.getElementById('progress').innerHTML = Jemplate.process('progress.jmpl', progress);
}

function reportUploadProgress() {
    
    url = 'progress?progress_id=' + progress.id;

lib/Catalyst/Plugin/UploadProgress/Static.pm  view on Meta::CPAN

    height: 20px;
    width: 380px;
}

.progressmeter .meter .amount {
    background-color: #667799;
    width: 0px;
    height: 20px
}

.progressmeter .meter .percent {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 20px;
    z-index: 1000;
    text-align: center;
    font-family: Arial;
    font-size: 18px;
    font-weight: bold;

lib/Catalyst/Plugin/UploadProgress/Static.pm  view on Meta::CPAN

        else
            progress.remainingtime = '';

        progress.currentrate   = formatBytes(progress.currentrate);
        progress.rate          = formatBytes(progress.rate);
        progress.elapsedtime   = formatTime(progress.elapsedtime);
        progress.remainingtime = formatTime(progress.remainingtime);
    }

    if (progress.size != 0)
        progress.percent = Math.round(progress.received / progress.size * 100);

    progress.size     = formatBytes(progress.size);
    progress.received = formatBytes(progress.received);
    
    document.getElementById('progress').innerHTML = Jemplate.process('progress.jmpl', progress);
}

function reportUploadProgress() {
    
    url = 'progress?progress_id=' + progress.id;

lib/Catalyst/Plugin/UploadProgress/Static.pm  view on Meta::CPAN

    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['progress.jmpl'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="progressmeter">\n  <div class="meter">\n    <div class="amount"  style="width: ';
//line 3 "progress.jmpl"
output += stash.get('percent');
output += '%;"></div>\n    <div class="percent" style="width: 100%">';
//line 4 "progress.jmpl"
output += stash.get('percent');
output += '%</div>\n  </div>\n  <table>\n    <tbody>\n      <tr>\n        <th>Status:</th>\n        <td>\n';
//line 17 "progress.jmpl"
if (stash.get('finished')) {
output += '          <span class="finished">Transfer complete  (';
//line 12 "progress.jmpl"
output += stash.get('size');
output += ')</span>\n';
}
else if (stash.get('aborted')) {
output += '          <span class="aborted">Transfer aborted</span>\n';



( run in 0.337 second using v1.01-cache-2.11-cpan-624ce96ca49 )