mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-04 19:30:13 +00:00
better implementation for dl icon directly in message builder
This commit is contained in:
parent
c165f152a9
commit
2de99d7e37
@ -15,13 +15,13 @@ function checkMessage() {
|
|||||||
req.open('GET', '/downloads/progress', true);
|
req.open('GET', '/downloads/progress', true);
|
||||||
req.onload = function() {
|
req.onload = function() {
|
||||||
var dlProgress = req.response;
|
var dlProgress = req.response;
|
||||||
var dlStatus = dlProgress['status'];
|
// var dlStatus = dlProgress['status'];
|
||||||
if (dlProgress['status']) {
|
if (dlProgress['status']) {
|
||||||
buildDownloadMessage(dlProgress);
|
buildDownloadMessage(dlProgress);
|
||||||
handleInterval();
|
handleInterval();
|
||||||
if (dlStatus == 'downloading') {
|
// if (dlStatus == 'downloading') {
|
||||||
buildDownloadIcons();
|
// buildDownloadIcons();
|
||||||
};
|
// };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
req.send();
|
req.send();
|
||||||
@ -74,12 +74,14 @@ function buildDownloadMessage(dlProgress) {
|
|||||||
message.appendChild(title);
|
message.appendChild(title);
|
||||||
message.appendChild(messageText);
|
message.appendChild(messageText);
|
||||||
box.appendChild(message);
|
box.appendChild(message);
|
||||||
|
if (dlStatus == 'downloading' && dlLevel != 'error') {
|
||||||
|
box.appendChild(buildDownloadIcons());
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// add dl control icons
|
// add dl control icons
|
||||||
function buildDownloadIcons() {
|
function buildDownloadIcons() {
|
||||||
var box = document.getElementById('downloadControl');
|
|
||||||
var iconBox = document.createElement('div');
|
var iconBox = document.createElement('div');
|
||||||
iconBox.classList = 'dl-control-icons';
|
iconBox.classList = 'dl-control-icons';
|
||||||
// stop icon
|
// stop icon
|
||||||
@ -99,5 +101,6 @@ function buildDownloadIcons() {
|
|||||||
// stich together
|
// stich together
|
||||||
iconBox.appendChild(stopIcon);
|
iconBox.appendChild(stopIcon);
|
||||||
iconBox.appendChild(killIcon);
|
iconBox.appendChild(killIcon);
|
||||||
box.appendChild(iconBox);
|
|
||||||
|
return iconBox
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,6 @@ function downloadNow(button) {
|
|||||||
document.getElementById(youtube_id).remove();
|
document.getElementById(youtube_id).remove();
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
handleInterval();
|
handleInterval();
|
||||||
buildDownloadIcons();
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user