Commit 882ab115 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 35685

parent cdc8c4d7
......@@ -972,6 +972,9 @@ var editor;
};
spreadsheet_api.prototype.openDocumentFromZip = function (wb, url) {
var t = this;
return new Promise(function (resolve, reject) {
resolve();
});
return new Promise(function (resolve, reject) {
var openXml = AscCommon.openXml;
//open cache xlsx instead of documentUrl, to support pivot in xls, ods... and don't send jwt signature
......@@ -986,7 +989,7 @@ var editor;
var doc = new openXml.OpenXmlPackage();
var wbPart = null;
var wbXml = null;
nextPromise = require('jszip').loadAsync(data).then(function (zip) {
nextPromise = JSZip.loadAsync(data).then(function (zip) {
return doc.openFromZip(zip);
}).then(function () {
wbPart = doc.getPartByRelationshipType(openXml.relationshipTypes.workbook);
......@@ -1079,7 +1082,7 @@ var editor;
}).then(resolve, reject);
};
if (typeof url === "string") {
require('jsziputils').getBinaryContent(url, processData);
JSZipUtils.getBinaryContent(url, processData);
} else {
processData(undefined, url);
}
......
This diff is collapsed.
......@@ -51,7 +51,7 @@
var c_oAscFileType = Asc.c_oAscFileType;
if (typeof String.prototype.startsWith != 'function')
if (typeof String.prototype.startsWith !== 'function')
{
String.prototype.startsWith = function (str)
{
......@@ -132,9 +132,20 @@
return false;
};
if (typeof require === "function" && !window["XRegExp"])
if (typeof require === 'function')
{
window["XRegExp"] = require("xregexp");
if (!window['XRegExp'])
{
window['XRegExp'] = require('xregexp');
}
if (!window['JSZipUtils'])
{
window['JSZipUtils'] = require('jsziputils');
}
if (!window['JSZip'])
{
window['JSZip'] = require('jszip');
}
}
var oZipImages = null;
......@@ -427,7 +438,7 @@
if (changesUrl)
{
oZipImages = {};
require('jsziputils').getBinaryContent(changesUrl, function (err, data)
JSZipUtils.getBinaryContent(changesUrl, function (err, data)
{
if (err)
{
......@@ -438,7 +449,7 @@
}
oResult.changes = [];
require('jszip').loadAsync(data).then(function (zipChanges)
JSZip.loadAsync(data).then(function (zipChanges)
{
var relativePaths = [];
var promises = [];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment