-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
83 lines (75 loc) · 4.22 KB
/
example.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Example.html</title>
<!--Boot Strap-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<!--required scripts-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js" integrity="sha512-xQBQYt9UcgblF6aCMrwU1NkVA7HCXaSN2oq0so80KO+y68M+n64FOcqgav4igHe6D5ObBLIf68DWv+gfBowczg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.1.0/jszip-utils.min.js" integrity="sha512-3WaCYjK/lQuL0dVIRt1thLXr84Z/4Yppka6u40yEJT1QulYm9pCxguF6r8V84ndP5K03koI9hV1+zo/bUbgMtA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!--[if IE]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.1.0/jszip-utils-ie.min.js" integrity="sha512-wcmyupwwDuoJAWgQuC/hOdYjih0KGMgFNov8C6meaVn3c94Tik2BupHte4Vy2ryDilDWvpJzajMt9O9L9kbAig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js" referrerpolicy="no-referrer"></script>
</head>
<body>
<h1>Example of modularDownload.js</h1>
<form action="#" id="download_form">
<ul>
<!--Item One-->
<li class="list-group-item">
<label>
<!--
data-amount is how many files
data-whater#, the hashtag is the file number like 1, 2, 3, ...
data-url# is the direct path of the file
data-folder# is the folder data that the file would be in the zip folder
-->
<input type="checkbox" data-amount=1 data-url1="modularDownload.js" data-folder1="example/folder" />
modularDownload.js
</label>
</li>
<!--Item Two-->
<li class="list-group-item">
<label>
<!--
data-amount is how many files
data-whater#, the hashtag is the file number like 1, 2, 3, ...
data-url# is the direct path of the file
data-folder# is the folder data that the file would be in the zip folder
-->
<input type="checkbox" data-amount=1 data-url1="LICENSE" data-folder1="/" />
LICENSE
</label>
</li>
<!--Item Three-->
<li class="list-group-item">
<label>
<!--
data-amount is how many files
data-whater#, the hashtag is the file number like 1, 2, 3, ...
data-url# is the direct path of the file
data-folder# is the folder data that the file would be in the zip folder
-->
<input type="checkbox" data-amount=2 data-url1="README.md" data-folder1="/" data-url2="docs/README.md" data-folder2="docs/"/>
README + DOCS (README)
</label>
</li>
</ul>
<!--Value is the file extension-->
<button type="submit" class="btn btn-primary" value="zip">Download ZIP</button>
</form>
<!--Progress Bar for User Experience-->
<div class="progress hide" id="progress_bar">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
</div>
</div>
<p class="hide" id="result"></p>
<!--ModularDownload.js must be at the bottom of the body-->
<script type="text/javascript" src="modularDownload.js"></script>
</body>