Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,158 @@
<!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">
<meta name="description" content="Create .zip files using Javascript. Provides a simple API to place any content generated by Javascript into a .zip file for your users." />
<title>{{page.title}}</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<!-- <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> -->
<link rel="stylesheet" href="{{site.baseurl}}/documentation/css/pygments.css">
<link rel="stylesheet" href="{{site.baseurl}}/documentation/css/main.css">
<script type="text/javascript" src="{{site.baseurl}}/dist/jszip.js"></script>
<script type="text/javascript" src="//stuk.github.io/jszip-utils/dist/jszip-utils.js"></script>
<!--
Mandatory in IE 6, 7, 8 and 9.
-->
<!--[if IE]>
<script type="text/javascript" src="//stuk.github.io/jszip-utils/dist/jszip-utils-ie.js"></script>
<![endif]-->
<!--
Any version of jQuery will do (it's just to write some examples), this one
happens to be available in our tests.
-->
<script type="text/javascript" src="{{site.baseurl}}/test/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="{{site.baseurl}}/vendor/FileSaver.js"></script>
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="{{site.baseurl}}/"><strong>JS</strong>Zip</a>
</div>
<ul class="nav navbar-nav">
<li {% if page.section == "api" %}class="active"{% endif %}>
<a href="{{site.baseurl}}/documentation/api_jszip.html">API</a>
</li>
<li {% if page.section == "example" %}class="active"{% endif %}>
<a href="{{site.baseurl}}/documentation/examples.html">How to / examples</a>
</li>
<li {% if page.section == "limitations" %}class="active"{% endif %}>
<a href="{{site.baseurl}}/documentation/limitations.html">Performances / limitations</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/Stuk/jszip">JSZip on Github</a>
</li>
</ul>
</div>
</div>
{% if page.section and page.fullpage != true %}
<div class="row">
<nav class="col-md-3">
{% case page.section %}
{% when "main" %}
<h4>JSZip users :</h4>
<ul class="nav">
<li><a href="{{site.baseurl}}/">Installation</a></li>
<li><a href="{{site.baseurl}}/documentation/faq.html">FAQ</a></li>
<li><a href="{{site.baseurl}}/CHANGES.html">Changelog</a></li>
<li><a href="{{site.baseurl}}/documentation/upgrade_guide.html">Upgrade guide</a></li>
<li><a href="https://github.com/Stuk/jszip/issues">Bug tracker</a></li>
</ul>
<h4>JSZip developers :</h4>
<ul class="nav">
<li><a href="{{site.baseurl}}/documentation/contributing.html">How to contribute</a></li>
<li><a href="https://github.com/Stuk/jszip/graphs/contributors">Contributors</a></li>
</ul>
{% when "api" %}
<ul class="nav">
<li><a href="{{site.baseurl}}/documentation/api_jszip.html">JSZip</a>
<ul>
<li><a href="{{site.baseurl}}/documentation/api_jszip/constructor.html">new JSZip() or JSZip()</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/constructor_load.html">new JSZip(data [,options])</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/file_name.html">JSZip#file(name)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/file_regex.html">JSZip#file(regex)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/file_data.html">JSZip#file(name, data [,options])</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/folder_data.html">JSZip#folder(name)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/folder_regex.html">JSZip#folder(regex)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/filter.html">JSZip#filter(predicate)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/remove.html">JSZip#remove(name)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/generate.html">JSZip#generate(options)</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/load.html">JSZip#load(data [, options])</a></li>
<li><a href="{{site.baseurl}}/documentation/api_jszip/support.html">JSZip.support</a></li>
</ul>
</li>
<li><a href="{{site.baseurl}}/documentation/api_zipobject.html">ZipObject</a></li>
</ul>
{% when "example" %}
<h4>How to ...</h4>
<ul class="nav">
<li><a href="{{site.baseurl}}/documentation/examples.html">Use JSZip</a></li>
<li><a href="{{site.baseurl}}/documentation/howto/read_zip.html">Read a file</a></li>
<li><a href="{{site.baseurl}}/documentation/howto/write_zip.html">Write a file</a></li>
</ul>
<h4>Examples</h4>
<ul class="nav">
<li><a href="{{site.baseurl}}/documentation/examples/read-local-file-api.html">Read local file</a></li>
<li><a href="{{site.baseurl}}/documentation/examples/get-binary-files-ajax.html">Read remote file</a></li>
<li><a href="{{site.baseurl}}/documentation/examples/download-zip-file.html">Give the user its zip file</a></li>
<li><a href="{{site.baseurl}}/documentation/examples/downloader.html">Mini app : downloader</a></li>
</ul>
{% endcase %}
<!-- <ul class="nav"> -->
<!-- <li><a href="{{site.baseurl}}/documentation/faq.html">FAQ</a></li> -->
<!-- </ul> -->
<!-- <li><a href="{{site.baseurl}}/">installation</a></li> -->
</nav>
{% endif %}
<div class="{% if page.section and page.fullpage != true%}col-md-9{% else %}col-md-12{% endif %}">
<h1>{{page.title}}</h1>
<!-- ===================== -->
<!-- === C O N T E N T === -->
<!-- ===================== -->
{{content}}
<!-- ===================== -->
<!-- == / C O N T E N T == -->
<!-- ===================== -->
</div>
</div>
</div>
<script>
// FIXME find how to do that cleanly
(function(){
var tables = document.getElementsByTagName("table");
for(var i = 0; i < tables.length; i++) {
tables[i].className += " table table-condensed table-striped table-bordered ";
}
})();
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52085706-1', 'stuk.github.io');
ga('send', 'pageview');
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
ul.nav ul {
list-style:none;
margin: 0;
padding: 0 0 0 25px;
}
#downloader_application form {
margin-bottom: 10px;
}
#downloader_application ul {
list-style-type: none;
}
.browser_support th {
border-bottom-width: 3px !important;
}
.support_ie {border-bottom-color: #0275BA !important;}
.support_ff {border-bottom-color: #DF7215 !important;}
.support_sf {border-bottom-color: #43B3E9 !important;}
.support_cr {border-bottom-color: #39B642 !important;}
.support_op {border-bottom-color: #C42122 !important;}
.support_nd {border-bottom-color: #8CC84B !important;}

View file

@ -0,0 +1,64 @@
/* Generated with :
* pygmentize -S default -f html > pygments.css
*/
.hll { background-color: #ffffcc }
.c { color: #408080; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cp { color: #BC7A00 } /* Comment.Preproc */
.c1 { color: #408080; font-style: italic } /* Comment.Single */
.cs { color: #408080; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #888888 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0044DD } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #7D9029 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #999999; font-weight: bold } /* Name.Entity */
.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #A0A000 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #BB6688 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.il { color: #666666 } /* Literal.Number.Integer.Long */

View file

@ -0,0 +1,59 @@
---
title: "Download the generated zip file"
layout: default
section: example
---
<p>Tip : check the source of the page !</p>
<h2>The FileSaver API</h2>
<div>
Works on firefox, chrome , opera &gt;= 15 and IE &gt;= 10 (but NOT in compatibility view).<br/>
<button id="blob" class="btn btn-primary">click to download</button>
</div>
<h2>The data URL</h2>
<div>
Does not work in IE, has restrictions on the length.<br/>
<button id="data_uri" class="btn btn-primary">click to download</button>
</div>
<script type="text/javascript">
(function () {
var zip = new JSZip();
zip.file("Hello.txt", "Hello world\n");
function bindEvent(el, eventName, eventHandler) {
if (el.addEventListener){
// standard way
el.addEventListener(eventName, eventHandler, false);
} else if (el.attachEvent){
// old IE
el.attachEvent('on'+eventName, eventHandler);
}
}
// Blob
var blobLink = document.getElementById('blob');
if (JSZip.support.blob) {
function downloadWithBlob() {
try {
var blob = zip.generate({type:"blob"});
// see FileSaver.js
saveAs(blob, "hello.zip");
} catch(e) {
blobLink.innerHTML += " " + e;
}
return false;
}
bindEvent(blobLink, 'click', downloadWithBlob);
} else {
blobLink.innerHTML += " (not supported on this browser)";
}
// data URI
function downloadWithDataURI() {
window.location = "data:application/zip;base64," + zip.generate({type:"base64"});
}
var dataUriLink = document.getElementById('data_uri');
bindEvent(dataUriLink, 'click', downloadWithDataURI);
})();
</script>

View file

@ -0,0 +1,58 @@
---
title: "Mini app : Downloader"
layout: default
section: example
---
<p>Tip : check the source of the page !</p>
<p>
This mini application let you choose the files you want in a list, download
them, zip them and give the result to the user.
</p>
<p>
This demo requires a recent browser, see <a href="{{site.baseurl}}/documentation/howto/write_zip.html">
the howto</a>.
</p>
<div id="downloader_application">
<h3>Please select your files</h3>
<form action="#" id="download_form">
<ul>
<li>
<label>
<input type="checkbox" data-url="{{site.baseurl}}/test/ref/complex_files/Franz Kafka - The Metamorphosis.epub" checked />
Franz Kafka - The Metamorphosis.epub
</label>
</li>
<li>
<label>
<input type="checkbox" data-url="{{site.baseurl}}/documentation/css/pygments.css" checked />
pygments.css
</label>
</li>
<li>
<label>
<input type="checkbox" data-url="{{site.baseurl}}/dist/jszip.js" />
jszip.js
</label>
</li>
<li>
<label>
<input type="checkbox" data-url="{{site.baseurl}}/test/ref/all.zip" />
all.zip
</label>
</li>
</ul>
<button type="submit" class="btn btn-primary">pack them !</button>
</form>
<p class="hide" id="result"></p>
</div>
<script type="text/javascript" src="{{site.baseurl}}/documentation/examples/downloader.js"></script>

View file

@ -0,0 +1,89 @@
jQuery(function ($) {
"use strict";
/**
* Reset the message.
*/
function resetMessage () {
$("#result")
.removeClass()
.text("");
}
/**
* show a successful message.
* @param {String} text the text to show.
*/
function showMessage(text) {
resetMessage();
$("#result")
.addClass("alert alert-success")
.text(text);
}
/**
* show an error message.
* @param {String} text the text to show.
*/
function showError(text) {
resetMessage();
$("#result")
.addClass("alert alert-danger")
.text(text);
}
/**
* Fetch the content, add it to the JSZip object
* and use a jQuery deferred to hold the result.
* @param {String} url the url of the content to fetch.
* @param {String} filename the filename to use in the JSZip object.
* @param {JSZip} zip the JSZip instance.
* @return {jQuery.Deferred} the deferred containing the data.
*/
function deferredAddZip(url, filename, zip) {
var deferred = $.Deferred();
JSZipUtils.getBinaryContent(url, function (err, data) {
if(err) {
deferred.reject(err);
} else {
zip.file(filename, data, {binary:true});
deferred.resolve(data);
}
});
return deferred;
}
if(!JSZip.support.blob) {
showError("This demo works only with a recent browser !");
return;
}
var $form = $("#download_form").on("submit", function () {
resetMessage();
var zip = new JSZip();
var deferreds = [];
// find every checked item
$(this).find(":checked").each(function () {
var $this = $(this);
var url = $this.data("url");
var filename = url.replace(/.*\//g, "");
deferreds.push(deferredAddZip(url, filename, zip));
});
// when everything has been downloaded, we can trigger the dl
$.when.apply($, deferreds).done(function () {
var blob = zip.generate({type:"blob"});
// see FileSaver.js
saveAs(blob, "example.zip");
showMessage("done !");
}).fail(function (err) {
showError(err);
});
return false;
});
});
// vim: set shiftwidth=4 softtabstop=4:

View file

@ -0,0 +1,43 @@
---
title: "Get a file with an ajax call"
layout: default
section: example
---
<p>Tip : check the source of the page !</p>
<h3>With JSZipUtils</h3>
<div id="jszip_utils"></div>
<script type="text/javascript">
(function () {
function showError(elt, err) {
elt.innerHTML = "<p class='alert alert-danger'>" + err + "</p>";
}
function showContent(elt, type, content) {
elt.innerHTML = "<p class='alert alert-success'>loaded ! (as a " + type + ")<br/>" +
"Content = " + content + "</p>";
}
//=========================
// JSZipUtils
//=========================
JSZipUtils.getBinaryContent('{{site.baseurl}}/test/ref/text.zip', function(err, data) {
var elt = document.getElementById('jszip_utils');
if(err) {
showError(elt, err);
return;
}
try {
var zip = new JSZip(data);
showContent(elt, "" + data, zip.file("Hello.txt").asText());
} catch(e) {
showError(elt, e);
}
});
})();
</script>

View file

@ -0,0 +1,87 @@
---
title: "Reading a local file with the File API"
layout: default
section: example
---
<h3>Choose the local(s) zip file(s)</h3>
<p class="note">Note : your browser will process the zip file, don't choose a file too big !</p>
<input type="file" id="file" name="file" multiple /><br />
<div id="error_block" class="alert alert-danger hidden">
You will need a recent browser to use this demo :(
</div>
<div id="result_block" class="hidden">
<h3>Content :</h3>
<div id="result"></div>
</div>
<script type="text/javascript" src="{{site.baseurl}}/test/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
(function () {
if (!window.FileReader || !window.ArrayBuffer) {
$("#error_block").removeClass("hidden").addClass("show");
return;
}
var $result = $("#result");
$("#file").on("change", function(evt) {
// remove content
$result.html("");
// be sure to show the results
$("#result_block").removeClass("hidden").addClass("show");
// see http://www.html5rocks.com/en/tutorials/file/dndfiles/
var files = evt.target.files;
for (var i = 0, f; f = files[i]; i++) {
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
var $title = $("<h4>", {
text : theFile.name
});
$result.append($title);
var $fileContent = $("<ul>");
try {
var dateBefore = new Date();
// read the content of the file with JSZip
var zip = new JSZip(e.target.result);
var dateAfter = new Date();
$title.append($("<span>", {
text:" (parsed in " + (dateAfter - dateBefore) + "ms)"
}));
// that, or a good ol' for(var entryName in zip.files)
$.each(zip.files, function (index, zipEntry) {
$fileContent.append($("<li>", {
text : zipEntry.name
}));
// the content is here : zipEntry.asText()
});
// end of the magic !
} catch(e) {
$fileContent = $("<div>", {
"class" : "alert alert-danger",
text : "Error reading " + theFile.name + " : " + e.message
});
}
$result.append($fileContent);
}
})(f);
// read the file !
// readAsArrayBuffer and readAsBinaryString both produce valid content for JSZip.
reader.readAsArrayBuffer(f);
// reader.readAsBinaryString(f);
}
});
})();
</script>