-
Notifications
You must be signed in to change notification settings - Fork 2k
/
app.html
47 lines (42 loc) · 1.54 KB
/
app.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
39
40
41
42
43
44
45
46
47
<!-- Load Uppy CSS bundle. It is advisable to install Uppy
from npm/yarn instead, and pick and choose the plugins/styles you need.
But for experimenting, you can use Transloadit’s CDN, Edgly: -->
<link rel="stylesheet" href="https://releases.transloadit.com/uppy/v2.3.3/uppy.min.css">
<div class="UppyDragDrop"></div>
<div class="for-ProgressBar"></div>
<div class="uploaded-files">
<h5>Uploaded files:</h5>
<ol></ol>
</div>
<!-- Load Uppy JS bundle. -->
<script src="https://releases.transloadit.com/uppy/v2.3.3/uppy.min.js"></script>
<script src="https://releases.transloadit.com/uppy/locales/v2.0.5/ru_RU.min.js"></script>
<script>
var uppy = new Uppy.Core({
debug: true,
autoProceed: true,
locale: Uppy.locales.ru_RU
});
uppy.use(Uppy.DragDrop, {
target: '.UppyDragDrop',
// We are using the ru_RU locale pack (set above in Uppy.Core options),
// but you can also override specific strings like so:
locale: {
strings: {
browse: 'выберите ;-)'
}
}
});
uppy.use(Uppy.ProgressBar, {
target: '.for-ProgressBar',
hideAfterFinish: false
});
uppy.use(Uppy.Tus, { endpoint: 'https://tusd.tusdemo.net/files/' });
uppy.on('upload-success', function (file, response) {
var url = response.uploadURL
var fileName = file.name
document.querySelector('.uploaded-files ol').innerHTML +=
'<li><a href="' + url + '" target="_blank">' + fileName + '</a></li>'
});
console.log('--> Uppy pre-built version with Tus, DragDrop & Russian language pack has loaded');
</script>