mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
@@ -338,7 +338,7 @@ $(document).ready(function () {
|
||||
return false;
|
||||
},
|
||||
fail: function(){
|
||||
//disabled cancel-all button, if queue is emepty and last upload fail
|
||||
//disabled cancel-all button, if queue is empty and last upload fail
|
||||
if (UploaderManager.Queue.isEmpty()){
|
||||
$("#cancel-all").attr("disabled", true);
|
||||
}
|
||||
@@ -395,10 +395,12 @@ $(document).ready(function () {
|
||||
if (errorThrown === 'abort') {
|
||||
return false;
|
||||
} else {
|
||||
data.context.find('.upload-record p.error').append(jqXHR.responseText);
|
||||
data.context.find('.upload-record p.error').append(jqXHR.status + " " + jqXHR.statusText).show();
|
||||
}
|
||||
//Remove data
|
||||
UploaderManager.removeData(data.uploadIndex);
|
||||
// Remove cancel button
|
||||
$('button.remove-element', data.context).remove();
|
||||
});
|
||||
|
||||
//cancel request
|
||||
|
@@ -183,16 +183,19 @@ var p4 = p4 || {};
|
||||
if (typeof bits !== 'number') {
|
||||
throw bits + ' is not a number';
|
||||
}
|
||||
if (bits >= 1073741824) {
|
||||
return (bits / 1073741824).toFixed(2) + ' Gbit/s';
|
||||
// 1 byte = 8 bits
|
||||
var bytes = (bits >> 3);
|
||||
|
||||
if (bytes >= (1 << 30)) {
|
||||
return (bytes / (1 << 30)).toFixed(2) + ' Go/s';
|
||||
}
|
||||
if (bits >= 1048576) {
|
||||
return (bits / 1048576).toFixed(2) + ' Mbit/s';
|
||||
if (bytes >= (1 << 20)) {
|
||||
return (bytes / (1 << 20)).toFixed(2) + ' Mo/s';
|
||||
}
|
||||
if (bits >= 1024) {
|
||||
return (bits / 1024).toFixed(2) + ' Kbit/s';
|
||||
if (bytes >= (1 << 10)) {
|
||||
return (bytes / (1 << 10)).toFixed(2) + ' Ko/s';
|
||||
}
|
||||
return bits + ' bit/s';
|
||||
return bytes + ' o/s';
|
||||
},
|
||||
pourcent: function(current, total){
|
||||
return (current/ total * 100).toFixed(2)
|
||||
|
Reference in New Issue
Block a user