|
1 | | -var global = window; |
| 1 | +const global = window |
2 | 2 |
|
3 | 3 | global.isFileAPIAvailable = function () { |
4 | 4 | // Check for the various File API support. |
5 | 5 | if (window.File && window.FileReader && window.FileList && window.Blob) { |
6 | 6 | // Great success! All the File APIs are supported. |
7 | | - return true; |
| 7 | + return true |
8 | 8 | } else { |
9 | 9 | // source: File API availability - http://caniuse.com/#feat=fileapi |
10 | 10 | // source: <output> availability - http://html5doctor.com/the-output-element/ |
11 | | - document.writeln('The HTML5 APIs used in this form are only available in the following browsers:<br />'); |
| 11 | + document.writeln('The HTML5 APIs used in this form are only available in the following browsers:<br />') |
12 | 12 | // 6.0 File API & 13.0 <output> |
13 | | - document.writeln(' - Google Chrome: 13.0 or later<br />'); |
| 13 | + document.writeln(' - Google Chrome: 13.0 or later<br />') |
14 | 14 | // 3.6 File API & 6.0 <output> |
15 | | - document.writeln(' - Mozilla Firefox: 6.0 or later<br />'); |
| 15 | + document.writeln(' - Mozilla Firefox: 6.0 or later<br />') |
16 | 16 | // 10.0 File API & 10.0 <output> |
17 | | - document.writeln(' - Internet Explorer: Not supported (partial support expected in 10.0)<br />'); |
| 17 | + document.writeln(' - Internet Explorer: Not supported (partial support expected in 10.0)<br />') |
18 | 18 | // ? File API & 5.1 <output> |
19 | | - document.writeln(' - Safari: Not supported<br />'); |
| 19 | + document.writeln(' - Safari: Not supported<br />') |
20 | 20 | // ? File API & 9.2 <output> |
21 | | - document.writeln(' - Opera: Not supported'); |
22 | | - return false; |
| 21 | + document.writeln(' - Opera: Not supported') |
| 22 | + return false |
23 | 23 | } |
24 | | -}; |
| 24 | +} |
25 | 25 |
|
26 | 26 | // Used to generate the data for the sine wave demo |
27 | 27 | // source: http://coding.smashingmagazine.com/2011/10/04/quick-look-math-animations-javascript/ |
28 | 28 | global.drawSine = function () { |
29 | | - var counter = 0; |
| 29 | + let counter = 0 |
30 | 30 | // 100 iterations |
31 | | - var increase = Math.PI * 2 / 100; |
32 | | - for (var i = 0; i <= 1; i += 0.01) { |
33 | | - var x = i; |
34 | | - var y = Math.sin(counter) / 2 + 0.5; |
35 | | - counter += increase; |
36 | | - console.log(x + ',' + y); |
| 31 | + const increase = Math.PI * 2 / 100 |
| 32 | + for (let i = 0; i <= 1; i += 0.01) { |
| 33 | + const x = i |
| 34 | + const y = Math.sin(counter) / 2 + 0.5 |
| 35 | + counter += increase |
| 36 | + console.log(x + ',' + y) |
37 | 37 | } |
38 | | -}; |
| 38 | +} |
0 commit comments