-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
45 lines (38 loc) · 1.25 KB
/
script.js
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
39
40
41
42
43
44
45
var upload = document.getElementById('upload');
function onFile() {
var me = this,
file = upload.files[0],
name = file.name.replace(/\.[^/.]+$/, '');
if (file.type === '' ||
file.type === 'audio/mp3' ||
file.type === 'file/text' ||
file.type === 'audio/mpeg' ||
file.type === 'audio/wav' ||
file.type === 'audio/x-wav' ||
file.type === 'audio/wave' ||
file.type === 'audio/x-pn-wav') {
if (file.size < (3000 * 1024)) {
upload.parentNode.className = 'area uploading';
} else {
window.alert('File size is too large, please ensure you are uploading a file of less than 3MB');
}
} else {
window.alert('File type ' + file.type + ' not supported');
}
}
upload.addEventListener('dragenter', function (e) {
upload.parentNode.className = 'area dragging';
}, false);
upload.addEventListener('dragleave', function (e) {
upload.parentNode.className = 'area';
}, false);
upload.addEventListener('dragdrop', function (e) {
onFile();
}, false);
upload.addEventListener('change', function (e) {
onFile();
}, false);
function myFunction() {
alert("Auth Failed . Xernar Bookshelf")
window.open("https://xernar.com");
}