Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
a0fcd00a
Commit
a0fcd00a
authored
Sep 11, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSZipWrapper
parent
a1f69b25
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
cell/api.js
cell/api.js
+4
-1
cell/model/Serialize.js
cell/model/Serialize.js
+3
-1
common/editorscommon.js
common/editorscommon.js
+24
-0
No files found.
cell/api.js
View file @
a0fcd00a
...
@@ -986,7 +986,8 @@ var editor;
...
@@ -986,7 +986,8 @@ var editor;
var
doc
=
new
openXml
.
OpenXmlPackage
();
var
doc
=
new
openXml
.
OpenXmlPackage
();
var
wbPart
=
null
;
var
wbPart
=
null
;
var
wbXml
=
null
;
var
wbXml
=
null
;
nextPromise
=
AscCommon
.
getJSZip
().
loadAsync
(
data
).
then
(
function
(
zip
)
{
var
jsZipWrapper
=
new
AscCommon
.
JSZipWrapper
();
nextPromise
=
jsZipWrapper
.
loadAsync
(
data
).
then
(
function
(
zip
)
{
return
doc
.
openFromZip
(
zip
);
return
doc
.
openFromZip
(
zip
);
}).
then
(
function
()
{
}).
then
(
function
()
{
wbPart
=
doc
.
getPartByRelationshipType
(
openXml
.
relationshipTypes
.
workbook
);
wbPart
=
doc
.
getPartByRelationshipType
(
openXml
.
relationshipTypes
.
workbook
);
...
@@ -1063,6 +1064,8 @@ var editor;
...
@@ -1063,6 +1064,8 @@ var editor;
if
(
window
.
console
&&
window
.
console
.
log
)
{
if
(
window
.
console
&&
window
.
console
.
log
)
{
window
.
console
.
log
(
err
);
window
.
console
.
log
(
err
);
}
}
}).
then
(
function
()
{
jsZipWrapper
.
close
();
});
});
}
else
{
}
else
{
if
(
err
)
{
if
(
err
)
{
...
...
cell/model/Serialize.js
View file @
a0fcd00a
This diff is collapsed.
Click to expand it.
common/editorscommon.js
View file @
a0fcd00a
...
@@ -156,6 +156,29 @@
...
@@ -156,6 +156,29 @@
return
window
[
'
JSZip
'
]
||
require
(
'
jszip
'
);
return
window
[
'
JSZip
'
]
||
require
(
'
jszip
'
);
}
}
function
JSZipWrapper
()
{
this
.
files
=
{};
}
JSZipWrapper
.
prototype
.
loadAsync
=
function
(
data
,
options
)
{
var
t
=
this
;
return
AscCommon
.
getJSZip
().
loadAsync
(
data
,
options
).
then
(
function
(
zip
){
for
(
var
id
in
zip
.
files
)
{
t
.
files
[
id
]
=
new
JSZipObjectWrapper
(
zip
.
files
[
id
]);
}
return
t
;
});
};
JSZipWrapper
.
prototype
.
close
=
function
()
{
};
function
JSZipObjectWrapper
(
data
)
{
this
.
data
=
data
;
}
JSZipObjectWrapper
.
prototype
.
async
=
function
(
type
)
{
return
this
.
data
.
async
(
type
);
};
function
getBaseUrl
()
function
getBaseUrl
()
{
{
var
indexHtml
=
window
[
"
location
"
][
"
href
"
];
var
indexHtml
=
window
[
"
location
"
][
"
href
"
];
...
@@ -3121,6 +3144,7 @@
...
@@ -3121,6 +3144,7 @@
window
[
"
AscCommon
"
].
getAltGr
=
getAltGr
;
window
[
"
AscCommon
"
].
getAltGr
=
getAltGr
;
window
[
"
AscCommon
"
].
getColorThemeByIndex
=
getColorThemeByIndex
;
window
[
"
AscCommon
"
].
getColorThemeByIndex
=
getColorThemeByIndex
;
window
[
"
AscCommon
"
].
JSZipWrapper
=
JSZipWrapper
;
window
[
"
AscCommon
"
].
g_oDocumentUrls
=
g_oDocumentUrls
;
window
[
"
AscCommon
"
].
g_oDocumentUrls
=
g_oDocumentUrls
;
window
[
"
AscCommon
"
].
FormulaTablePartInfo
=
FormulaTablePartInfo
;
window
[
"
AscCommon
"
].
FormulaTablePartInfo
=
FormulaTablePartInfo
;
window
[
"
AscCommon
"
].
cBoolLocal
=
cBoolLocal
;
window
[
"
AscCommon
"
].
cBoolLocal
=
cBoolLocal
;
...
...
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