rejetto forum

upload percentage

Guest · 8 · 6212

0 Members and 2 Guests are viewing this topic.

FlaerinRay

  • Guest
How did make upload in %? Give me plz code.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
you have to put %perc% inside the [progress-upload-file] section to get the number


FlaerinRay

  • Guest
This must be done in a template? or in live.scripte which I showed you .... I found the code where upload .... but I did not get ... insert your code ... and just wrote it after downloading ... I probably did not properly do this ... help me please. Sorry for bad English.

Code: [Select]
/*
  Live - JS

 (c) 2007-2010, RAWR-Designs, Some Rights Reserved -
Christopher "That Stevens Guy" Stevens
Richard "Giant Eagle" Tuininga
 (CC) http://creativecommons.org/licenses/by-nc-sa/3.0

 Any queries? -
Email: contact[at]rawr-designs.com
Forum: http://www.rawr-designs.com/forum/
  Homepage: http://www.rawr-designs.com
*/
// jQuery Functions
$(function() {
// Item Info
var itemFader = 0;
$('.item').hover(function() {
clearTimeout(itemFader);
$('.preview', this).stop(true,true).fadeIn('fast');
$('#item-info').css({'top':$(this).position().top + 54, 'left':$(this).position().left});
$('#item-access').html($(this).attr('item-access'));
$('#item-added').html($(this).attr('item-added'));
$('#item-dl-count').html($(this).attr('item-dl-count'));
$('#item-comment').html($(this).attr('item-comment') ? $(this).attr('item-comment') : 'No information available!');
$('#item-info').stop(true,true).slideDown('fast', function() {
itemFader = setTimeout(function() { $('#item-info').fadeOut('fast') }, 1750);
});
$i = $('#item-comment').height() > 15 ? 261 : 278;
$('#item-info').css({'background-position': $i + 'px 5px'});
}, function() {
clearTimeout(itemFader);
$('.preview', this).stop(true,true).fadeOut('fast');
        itemFader = setTimeout(function() { $('#item-info').fadeOut('fast') }, 500);
});
$('#item-info').hover(function() {
clearTimeout(itemFader);
}, function() {
clearTimeout(itemFader);
        itemFader = setTimeout(function() { $('#item-info').fadeOut('fast') }, 250);
    });
// Server Info
var serverFader = 0;
$('#footer .left').hover(function() {
clearTimeout(serverFader);
$('#server-info').css({'top':$(this).position().top - 83, 'left':$(this).position().left});
serverFader = setTimeout(function() {
$('#server-info').stop(true,true).slideDown('fast', function() {
serverFader = setTimeout(function() { $('#server-info').fadeOut('fast') }, 1750);
});
}, 600);
}, function() {
clearTimeout(serverFader);
        serverFader = setTimeout(function() { $('#server-info').fadeOut('fast') }, 500);
});
$('#server-info').hover(function() {
clearTimeout(serverFader);
}, function() {
clearTimeout(serverFader);
        serverFader = setTimeout(function() { $('#server-info').fadeOut('fast') }, 250);
    });
// Event for Items
$('.item').click(function() {
if (HFS.delete_enabled || HFS.archive_enabled)
$(this).toggleClass('selected');
buttonToggle();
});
// Event for Upload Button
$('#upload').click(function() {
if (HFS.upload_enabled)
TopUp.display('~upload', {type:'iframe',width:590,height:338,effect:'appear',shaded:0,title:'Upload Files'});
else
if (confirm('Upload is disabled for this folder!')) return false;
});
// Event for Archive Button
$('#archive').click(function() {
if (HFS.archive_enabled)
if ($(this).hasClass('off')) {
if (confirm('No items selected to archive!')) return false;
} else {
if (confirm('Are you sure you want to archive the selected item(s)?')) submit(HFS.folder + '?mode=archive&recursive', {}, true);
}
else
if (confirm('Archive is disabled for this folder!')) return false;
});
// Event for Delete Button
$('#delete').click(function() {
if (HFS.delete_enabled)
if ($(this).hasClass('off')) {
if (confirm('No items selected to delete!')) return false;
} else {
if (confirm('Are you sure you want to delete the selected item(s)?')) submit('', {action:'delete'}, true);
}
else
if (confirm('Delete is disabled for this folder!')) return false;
});
// Event for Advanced Search Button
$('#advanced-search').click(function() {
TopUp.display('/~search', {type:'iframe',width:360,height:180,effect:'appear',shaded:0,title:'Search Files & Folders'});
});
// Event for Advanced Search Form
$('#popup-search form').submit(function() {
if ($('input[type=text]').val().length < 3) {
alert('Please enter more than 2 characters!');
return false;
} else {
$('#popup-search').addClass('results');
if ($('input:radio[name=type]:checked').val() == 1) {
$mode   = '?files-filter=';
$filter = '&folders-filter=%5C';
} else if ($('input:radio[name=type]:checked').val() == 2) {
$mode   = '?folders-filter=';
$filter = '&files-filter=%5C';
} else {
$mode   = '?filter=';
$filter = '';
}
$recursive = $('input:checkbox:checked').val() ? '&recursive' : '';
$from      = $('input:radio[name=from]:checked').val() == 1 ? '/' : parent.HFS.folder;
parent.location.href = $from + $mode +'*'+ $('input[type=text]').val() +'*'+ $recursive + $filter;
return true;
}
});
// Event for Upload Form
$('#popup-upload form').submit(function() {
var ready = false;
$('input[type=file]').each(function() {
if ($(this).val()) ready = true;
});
if (ready == true) {
$(this).hide().after('<b>Uploading...%perc%</b><br/><br/><img src="/template/'+ HFS.theme +'/images/progress.gif" alt=""/>');
return true;
} else {
alert('There are no files to upload!');
return false;
}
});
});
// Initialise Plugin
TopUp.addPresets({
'#list .topup': {
title: 'Viewing ({current} of {total})',
group: 'list',
shaded: 0
}
});
// Toggle Selection
function select(x) {
var o = $('.item');
if (x == 'all') o.size() > o.filter('.selected').size() ? o.addClass('selected') : o.removeClass('selected');
else if (x == 'none')   o.removeClass('selected');
else if (x == 'invert') o.toggleClass('selected');
buttonToggle();
}
// Toggle Buttons
function buttonToggle() {
HFS.archive_enabled != false && $('.item').hasClass('selected') ? $('#archive').removeClass('off') : $('#archive').addClass('off');
HFS.delete_enabled  != false && $('.item').hasClass('selected') ? $('#delete').removeClass('off')  : $('#delete').addClass('off');
}
// Submit Virtual Form
function submit(url, data, selection) {
var x = $('<form method="post" action="'+url+'" />').appendTo($('body'));
for (var k in data)
x.append('<input type="hidden" name="'+k+'" value="'+data[k]+'" />');
if (selection)
$('#list .selected > a').each(function() {
x.append('<input type="hidden" name="selection" value="'+getItemName(this)+'" />');
});
x.submit().detach();
}
// Get Item Name
function getItemName(el) {
if (typeof el == 'undefined') return false;
if (el.jquery) el = el[0];
var s = el.getAttribute('href').split('#')[0];
var i = s.indexOf('://');
if (i > 0) s = s.slice(s.indexOf('/', i + 3));
if (s.indexOf(HFS.folder) == 0) s = s.slice(HFS.folder.length);
s = (decodeURIComponent || unescape)(s);
return s;
}
// Cookie Code
var exp = new Date();
exp.setTime(exp.getTime() + (1000*60*60*24*7));
function setCookie(name,val,expires) {
document.cookie = name +'='+ escape(val) +'; path=/'+ ((expires == null) ? '' : '; expires='+ expires.toGMTString());
}
function getCookie(name) {
cname = name +'=';
dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(';', begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
// RAWR-Player Interface
function playerVolume(volume) { setCookie('Volume',volume,exp) }
function playbackMethod(playmethod) { setCookie('Method',playmethod,exp) }
function changeMedia(method) { TopUp.next() }
function getVolume() { return getCookie('Volume') ? getCookie('Volume') : 50 }
function getMethod() { return getCookie('Method') ? getCookie('Method') : 'list' }
//Pre-Load Images
if (document.location.href.match('~upload|~search')) {
timer    = new Image();
progress = new Image();
results  = new Image();
timer.src    = '/template/'+ HFS.theme +'/images/timer.gif';
progress.src = '/template/'+ HFS.theme +'/images/progress.gif';
results.src  = '/template/'+ HFS.theme +'/images/results.png';
}


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
you inserted it where i would!
it's strange it doesn't work.
anyway it's possible for sure, just can't help more.


Offline almulder

  • Occasional poster
  • *
    • Posts: 29
    • View Profile
It would be nice if when uploading it would show a % of each file that is being uploaded, so the up-loader knows how much and what has been uploaded, Also with the option to cancel an upload per file during the upload process. 

Update: I see this is already working in FHFS - Using FHFS now (More functionality!)

Currently it looks like this:



I would like something like this:


-almulder
« Last Edit: November 27, 2012, 07:42:43 PM by almulder »