-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.es5.html
38 lines (36 loc) · 867 Bytes
/
test.es5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form>
<label>
Select file:
<input type="file" id="input" onchange="onFileChange(this.files)">
</label>
</form>
<p id="orientation"></p>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.5/core.min.js"></script>
<script type="text/javascript" src="browser.es5.js"></script>
<script type="text/javascript">
function onFileChange(files) {
var file, el;
if (files.length === 0) {
console.log("no files selected");
return;
}
file = files[0];
el = document.getElementById("orientation");
window.getOrientation.getOrientation(file).then(function (value) {
el.innerText = value.toString();
el = null;
}, function (e) {
el.innerText = e;
el = null;
});
}
</script>
</body>
</html>