Skip to content

Commit

Permalink
closes#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Vallat committed Oct 29, 2019
1 parent c3df3fc commit 1c171d8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
11 changes: 9 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@ document.querySelector('input#input-dir').addEventListener('change', (evt) =>
{
let files = evt.target.files;

// Iterates over each uploaded file
for (let i = 0; i < files.length; i++)
{
// Filters the audio files
if (files[i].type.includes('audio'))
{
let filename = files[i].name;
let filepath = files[i].webkitRelativePath;
let filedir = filepath.split('/').slice(0, -1).join('/');

audioFiles.push(files[i]);

let filename = files[i].name;
audioTree += '<li><a href="audio/' + filename + '" class="audio-src">' + filename + '</a><a href="audio/' + filename + '" class="cache-audio">Download</a></li>';
audioTree += '<li><a href="audio/' + filepath + '" class="audio-src">' + filename + '</a><a href="audio/' + filepath + '" class="cache-audio">Download</a></li>';
}
}

document.querySelector('#audio-files').innerHTML = audioTree;
});

// Icon input
Expand Down
2 changes: 2 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ <h1>PWA Playlist Generator</h1>
<img id="uploaded-icon">
<button id="btn-generate-html">Generate HTML</button>

<ul id="audio-files"></ul>

<a href="#" id="dl" hidden></a>

<script src="jszip.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion app/pwa.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/*
if ('serviceWorker' in navigator)
{
window.addEventListener('load', () =>
Expand Down Expand Up @@ -44,3 +44,4 @@ window.addEventListener('beforeinstallprompt', (e) =>
deferredPrompt = null;
});
});
*/
3 changes: 2 additions & 1 deletion app/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/*
'use strict';
// Update cache names any time any of the cached files change.
Expand Down Expand Up @@ -63,3 +63,4 @@ self.addEventListener('fetch', (evt) =>
});
}));
});
*/

0 comments on commit 1c171d8

Please sign in to comment.