forked from Stuk/jszip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
171 lines (155 loc) · 4.2 KB
/
index.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
title: JSZip
layout: default
section: main
---
<div class="row">
<div class="col-md-5">
JSZip is a javascript library for creating, reading and editing .zip files, with a
lovely and simple API.
</div>
<div class="col-md-7">
<p>
<strong>Current version</strong> : v3.2.0
</p>
<p>
<strong>License</strong> : JSZip is dual-licensed. You may use it under the
MIT license <em>or</em> the GPLv3 license. See
<a href="https://github.com/Stuk/jszip/blob/master/LICENSE.markdown">LICENSE.markdown</a>.
</p>
</div>
<div class="row">
<div class="col-md-5">
<h3>Example</h3>
<script type="text/javascript">
imgData = "R0lGODdhBQAFAIACAAAAAP/eACwAAAAABQAFAAACCIwPkWerClIBADs=";
jQuery(function($) {
if(!JSZip.support.blob) {
$("#demo-not-supported").removeClass("hidden");
$("#demo").hide();
return;
}
$("#demo").click(function () {
try {
eval($("#demo-code").val());
$("#status")
.removeClass()
.addClass("text-success")
.text("Done!");
}
catch (e) {
$("#status")
.removeClass()
.addClass("text-danger")
.text(e);
}
});
});
</script>
<textarea class="form-control" id="demo-code" rows="9" spellcheck="false">
var zip = new JSZip();
zip.file("Hello.txt", "Hello World\n");
var img = zip.folder("images");
img.file("smile.gif", imgData, {base64: true});
zip.generateAsync({type:"blob"})
.then(function(content) {
// see FileSaver.js
saveAs(content, "example.zip");
});</textarea>
<button id="demo" class="btn btn-primary">Run!</button>
<span id="status"></span>
<div id="demo-not-supported" class="alert alert-danger hidden">
This browser doesn't support blobs, this demo won't work :(
See <a href="{{site.baseurl}}/documentation/howto/write_zip.html" class="alert-link">here for more info</a>.
</div>
</div>
<div class="col-md-7">
<h3>Installation</h3>
<p>
<strong>With npm</strong> : <code>npm install jszip</code>
</p>
<p>
<strong>With bower</strong> : <code>bower install Stuk/jszip</code>
</p>
<p>
<strong>With component</strong> : <code>component install Stuk/jszip</code>
</p>
<p>
<strong>Manually</strong> : <a href="http://github.com/Stuk/jszip/zipball/master">download JSZip</a>
and include the file <code>dist/jszip.js</code> or <code>dist/jszip.min.js</code>
</p>
<br>
<p>
Installed ? Great ! You can now check our
<a href="{{site.baseurl}}/documentation/examples.html">guides and examples !</a>
</p>
</div>
</div>
<h3>Support</h3>
<table class="browser_support">
<tr>
<th class="support_op">Opera</th>
<th class="support_ff">Firefox</th>
<th class="support_sf">Safari</th>
<th class="support_cr">Chrome</th>
<th class="support_ie">Internet Explorer</th>
<th class="support_nd">Node.js</th>
</tr>
<tr>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>Tested with the latest version</td>
<td>Tested with 3.0 / 3.6 / latest version</td>
<td>Tested with the latest version</td>
<td>Tested with the latest version</td>
<td>Tested with IE 6 / 7 / 8 / 9 / 10</td>
<td>Tested with node.js 0.10 / latest version</td>
</tr>
</table>
<h3>Getting help</h3>
<p>
Having trouble ? We'd like to help !
</p>
<ul>
<li>
Try the <a href="{{site.baseurl}}/documentation/faq.html">FAQ</a>, it has
answers to common questions.
</li>
<li>
If you're looking for information about a specific method, try the
<a href="{{site.baseurl}}/documentation/api_jszip.html">documentation</a>.
</li>
<li>
Check the
<a href="{{site.baseurl}}/documentation/examples.html">examples</a>.
</li>
<li>
Report bugs in our
<a href="https://github.com/Stuk/jszip/issues">Bug tracker</a>.
</li>
</ul>
<h3>Test status</h3>
<dl class="dl-horizontal">
<dt>Travis build :</dt>
<dd>
<a href="http://travis-ci.org/Stuk/jszip">
<img src="https://api.travis-ci.org/Stuk/jszip.svg?branch=master" alt="" />
</a>
</dd>
<dt>Saucelabs build :</dt>
<dd>
<a href="https://saucelabs.com/u/jszip">
<img src="https://saucelabs.com/browser-matrix/jszip.svg" alt="" />
</a>
</dd>
<dt>Live tests :</dt>
<dd>
<a href="{{site.baseurl}}/test/">See for yourself !</a>
</dd>
</dl>