Browse Source

basic config interface

master
Clemens Richter 8 years ago
parent
commit
7f57de1aee
  1. 47
      filereader-test.html

47
filereader-test.html

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<body>
<h1>countdown slideshow</h1>
<p>Config:</p>
<!-- with input that accepts multiple files, notice the multiple attribute-->
<input id="fileInput" type="file" multiple>
<input id="datePicker" type="datetime-local" name="targetDate">
<input id="startButton" type="button" value="Start!">
<script>
Date.prototype.addHours= function(h){
this.setHours(this.getHours()+h);
return this;
}
//set current date
document.getElementById('datePicker').defaultValue = (new Date).addHours(1).toISOString().slice(0,-5);
document.getElementById("fileInput").onchange=function(){
//files = Array.from(document.getElementById("fileInput").files)
//fl.forEach((file)=>{console.log(file.name)})
let files=Array.from(this.files);
let names= files.map(file => file.name)
document.getElementById("fileNames").innerText = "filenames:\n"+names.join("\n")
console.log(names)
};
document.getElementById("startButton").onclick=function(){
console.log("starting")
let dateInput = document.getElementById("datePicker")
console.log("date valid:"+dateInput.checkValidity())
console.log(dateInput.value)
};
</script>
<div id="fileNames">
</div>
</body>
</html>
Loading…
Cancel
Save