Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
c56e63e9
Commit
c56e63e9
authored
Dec 02, 2013
by
XhmikosR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update jszip.js to the latest git.
parent
4392d43d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
docs-assets/js/jszip.js
docs-assets/js/jszip.js
+21
-14
No files found.
docs-assets/js/jszip.js
View file @
c56e63e9
...
@@ -16,7 +16,9 @@ Usage:
...
@@ -16,7 +16,9 @@ Usage:
base64zip = zip.generate();
base64zip = zip.generate();
**/
**/
"
use strict
"
;
// We use strict, but it should not be placed outside of a function because
// the environment is shared inside the browser.
// "use strict";
/**
/**
* Representation a of zip file in js
* Representation a of zip file in js
...
@@ -93,8 +95,8 @@ JSZip.support = {
...
@@ -93,8 +95,8 @@ JSZip.support = {
catch
(
e
)
{}
catch
(
e
)
{}
try
{
try
{
var
builder
=
new
(
window
.
BlobBuilder
||
window
.
WebKitBlobBuilder
||
var
BlobBuilder
=
window
.
BlobBuilder
||
window
.
WebKitBlobBuilder
||
window
.
MozBlobBuilder
||
window
.
MSBlobBuilder
;
window
.
MozBlobBuilder
||
window
.
MSBlobBuilder
)
();
var
builder
=
new
BlobBuilder
();
builder
.
append
(
buffer
);
builder
.
append
(
buffer
);
return
builder
.
getBlob
(
'
application/zip
'
).
size
===
0
;
return
builder
.
getBlob
(
'
application/zip
'
).
size
===
0
;
}
}
...
@@ -161,7 +163,7 @@ JSZip.prototype = (function () {
...
@@ -161,7 +163,7 @@ JSZip.prototype = (function () {
return
file
.
asBinary
();
return
file
.
asBinary
();
}
}
return
result
;
return
result
;
}
}
;
/**
/**
* Transform this._data into a string.
* Transform this._data into a string.
...
@@ -287,9 +289,11 @@ JSZip.prototype = (function () {
...
@@ -287,9 +289,11 @@ JSZip.prototype = (function () {
*/
*/
var
prepareFileAttrs
=
function
(
o
)
{
var
prepareFileAttrs
=
function
(
o
)
{
o
=
o
||
{};
o
=
o
||
{};
/*jshint -W041 */
if
(
o
.
base64
===
true
&&
o
.
binary
==
null
)
{
if
(
o
.
base64
===
true
&&
o
.
binary
==
null
)
{
o
.
binary
=
true
;
o
.
binary
=
true
;
}
}
/*jshint +W041 */
o
=
extend
(
o
,
JSZip
.
defaults
);
o
=
extend
(
o
,
JSZip
.
defaults
);
o
.
date
=
o
.
date
||
new
Date
();
o
.
date
=
o
.
date
||
new
Date
();
if
(
o
.
compression
!==
null
)
o
.
compression
=
o
.
compression
.
toUpperCase
();
if
(
o
.
compression
!==
null
)
o
.
compression
=
o
.
compression
.
toUpperCase
();
...
@@ -341,7 +345,9 @@ JSZip.prototype = (function () {
...
@@ -341,7 +345,9 @@ JSZip.prototype = (function () {
}
}
}
}
return
this
.
files
[
name
]
=
new
ZipObject
(
name
,
data
,
o
);
var
object
=
new
ZipObject
(
name
,
data
,
o
);
this
.
files
[
name
]
=
object
;
return
object
;
};
};
...
@@ -399,7 +405,7 @@ JSZip.prototype = (function () {
...
@@ -399,7 +405,7 @@ JSZip.prototype = (function () {
}
else
if
(
file
.
_data
.
compressionMethod
===
compression
.
magic
)
{
}
else
if
(
file
.
_data
.
compressionMethod
===
compression
.
magic
)
{
result
.
compressedContent
=
file
.
_data
.
getCompressedContent
();
result
.
compressedContent
=
file
.
_data
.
getCompressedContent
();
}
else
{
}
else
{
content
=
file
.
_data
.
getContent
()
content
=
file
.
_data
.
getContent
()
;
// need to decompress / recompress
// need to decompress / recompress
result
.
compressedContent
=
compression
.
compress
(
JSZip
.
utils
.
transformTo
(
compression
.
compressInputType
,
content
));
result
.
compressedContent
=
compression
.
compress
(
JSZip
.
utils
.
transformTo
(
compression
.
compressInputType
,
content
));
}
}
...
@@ -756,8 +762,9 @@ JSZip.prototype = (function () {
...
@@ -756,8 +762,9 @@ JSZip.prototype = (function () {
case
"
nodebuffer
"
:
case
"
nodebuffer
"
:
writer
=
new
Uint8ArrayWriter
(
localDirLength
+
centralDirLength
+
dirEnd
.
length
);
writer
=
new
Uint8ArrayWriter
(
localDirLength
+
centralDirLength
+
dirEnd
.
length
);
break
;
break
;
case
"
base64
"
:
// case "base64" :
default
:
// case "string" :
// case "string" :
default
:
writer
=
new
StringWriter
(
localDirLength
+
centralDirLength
+
dirEnd
.
length
);
writer
=
new
StringWriter
(
localDirLength
+
centralDirLength
+
dirEnd
.
length
);
break
;
break
;
}
}
...
@@ -1066,8 +1073,8 @@ JSZip.compressions = {
...
@@ -1066,8 +1073,8 @@ JSZip.compressions = {
try
{
try
{
// deprecated, browser only, old way
// deprecated, browser only, old way
var
builder
=
new
(
window
.
BlobBuilder
||
window
.
WebKitBlobBuilder
||
var
BlobBuilder
=
window
.
BlobBuilder
||
window
.
WebKitBlobBuilder
||
window
.
MozBlobBuilder
||
window
.
MSBlobBuilder
;
window
.
MozBlobBuilder
||
window
.
MSBlobBuilder
)
();
var
builder
=
new
BlobBuilder
();
builder
.
append
(
buffer
);
builder
.
append
(
buffer
);
return
builder
.
getBlob
(
'
application/zip
'
);
return
builder
.
getBlob
(
'
application/zip
'
);
}
}
...
@@ -1095,7 +1102,7 @@ JSZip.compressions = {
...
@@ -1095,7 +1102,7 @@ JSZip.compressions = {
*/
*/
function
identity
(
input
)
{
function
identity
(
input
)
{
return
input
;
return
input
;
}
;
}
/**
/**
* Fill in an array with a string.
* Fill in an array with a string.
...
@@ -1108,7 +1115,7 @@ JSZip.compressions = {
...
@@ -1108,7 +1115,7 @@ JSZip.compressions = {
array
[
i
]
=
str
.
charCodeAt
(
i
)
&
0xFF
;
array
[
i
]
=
str
.
charCodeAt
(
i
)
&
0xFF
;
}
}
return
array
;
return
array
;
}
;
}
/**
/**
* Transform an array-like object to a string.
* Transform an array-like object to a string.
...
@@ -1165,7 +1172,7 @@ JSZip.compressions = {
...
@@ -1165,7 +1172,7 @@ JSZip.compressions = {
}
}
}
}
return
result
.
join
(
""
);
return
result
.
join
(
""
);
}
;
}
/**
/**
* Copy the data from an array-like to an other array-like.
* Copy the data from an array-like to an other array-like.
...
@@ -1178,7 +1185,7 @@ JSZip.compressions = {
...
@@ -1178,7 +1185,7 @@ JSZip.compressions = {
arrayTo
[
i
]
=
arrayFrom
[
i
];
arrayTo
[
i
]
=
arrayFrom
[
i
];
}
}
return
arrayTo
;
return
arrayTo
;
}
;
}
// a matrix containing functions to transform everything into everything.
// a matrix containing functions to transform everything into everything.
var
transform
=
{};
var
transform
=
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment