Fix #38: Add a loading message with progress on end-user interface

This commit is contained in:
2023-02-14 01:08:05 +01:00
parent 77bafdd592
commit e0faf053a1
3 changed files with 17 additions and 17 deletions

View File

@@ -17,6 +17,8 @@ Access raw data with: <?php echoUrl('channels/'); ?>.
<input type="submit" id="search-only-captions" value="Search only captions">
</form>
Progress: <span id="progress"></span>
<ul id="channels">
</ul>
@@ -36,8 +38,8 @@ Access raw data with: <?php echoUrl('channels/'); ?>.
function treatLine(line) {
console.log(line);
if (line.startsWith('alert:')) {
alert(line.replace('alert:', ''));
if (line.startsWith('progress:')) {
document.getElementById('progress').innerHTML = line.replace('progress:', '');
} else {
var channelsDom = document.getElementById('channels');
const channelFileParts = line.split('/');