Commit a2643a51 authored by Kai Neuwerth's avatar Kai Neuwerth Committed by Felix Paul Kühne
Browse files

WLAN Share Frontend - added numeric process to progress bars in wlan share


Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 274fb8b4
......@@ -40,7 +40,7 @@ $(function(){
var hasProgressbar = ('FormData' in window);
var html = '<li data-file-id="' + file._ID + '">';
html += '<div class="filename">' + file.name + '</div>';
html += '<div class="progress"><div class="bar" style="width: 0%"></div>';
html += '<div class="progress"><div class="bar" style="width: 0%">0%</div>';
if (!hasProgressbar) { html += '<span class="dots"></span>'; }
html += '</div>';
if (hasProgressbar) { html += '<div class="stop"></div>'; }
......@@ -72,14 +72,14 @@ $(function(){
function done (e, data) {
$.each(data.files, function (index, file) {
xhrCache.splice(file._ID, 1);
$('li[data-file-id=' + file._ID + ']').addClass('done');
$('li[data-file-id=' + file._ID + ']').addClass('done').text('100%');
});
}
function progress (e, data) {
var prog = Math.ceil(data.loaded / data.total * 100) + '%';
$.each(data.files, function (index, file) {
$('li[data-file-id=' + file._ID + '] .progress .bar').css('width', prog);
$('li[data-file-id=' + file._ID + '] .progress .bar').css('width', prog).text(prog);
});
}
......@@ -87,7 +87,7 @@ $(function(){
console.log('File transfer failed', data.errorThrown, data.textStatus);
$.each(data.files, function (index, file) {
xhrCache.splice(file._ID, 1);
$('li[data-file-id=' + file._ID + ']').addClass('fail');
$('li[data-file-id=' + file._ID + ']').addClass('fail').text('');
});
}
......
......@@ -461,7 +461,9 @@ div.main.drop {
left:0px;
right:0px;
bottom:0px;
border-radius: 20px;
border-radius:20px;
color:#1F1F1F;
text-align:center;
}
.uploads li.fail .progress .bar {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment