Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
3b0e9f25
Commit
3b0e9f25
authored
Jan 21, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gadget: prevent creating empty zip archive during save
parent
820de977
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
onlyoffice.gadget.js
onlyoffice.gadget.js
+17
-4
No files found.
onlyoffice.gadget.js
View file @
3b0e9f25
/*global window, rJS, RSVP, DocsAPI, console, document,
Common, require, jIO, URL, FileReader, atob, ArrayBuffer,
Uint8Array, XMLHttpRequest, Blob, Rusha
*/
Uint8Array, XMLHttpRequest, Blob, Rusha, define
*/
/*jslint nomen: true, maxlen:80, indent:2*/
"
use strict
"
;
if
(
Common
===
undefined
)
{
...
...
@@ -278,7 +278,7 @@ DocsAPI.DocEditor.version = function () {
return
g
.
props
.
value_zip_storage
.
getAttachment
(
'
/
'
,
'
body.txt
'
)
.
push
(
undefined
,
function
(
error
)
{
if
(
error
.
status_code
===
404
)
{
throw
'
not supported format of document: "
'
+
throw
'
not supported format of document:
body.txt absent
"
'
+
value
.
slice
(
0
,
100
)
+
'
"
'
;
}
throw
error
;
...
...
@@ -402,7 +402,7 @@ DocsAPI.DocEditor.version = function () {
require
.
onError
=
function
(
error
)
{
console
.
error
(
error
);
};
require
.
config
({
catchError
:
true
});
require
.
config
({
catchError
:
true
});
if
(
g
.
props
.
binary_loader
)
{
g
.
props
.
base_url
=
"
onlyoffice-bin/
"
;
...
...
@@ -449,7 +449,20 @@ DocsAPI.DocEditor.version = function () {
}
})
.
push
(
function
()
{
return
zip
.
getAttachment
(
'
/
'
,
'
/
'
);
return
zip
.
getAttachment
(
'
/
'
,
'
body.txt
'
)
.
push
(
undefined
,
function
(
error
)
{
if
(
error
.
status_code
===
404
)
{
return
""
;
}
throw
error
;
});
})
.
push
(
function
(
Editor_bin
)
{
if
(
Editor_bin
)
{
return
zip
.
getAttachment
(
'
/
'
,
'
/
'
);
}
else
{
return
new
Blob
();
}
})
.
push
(
function
(
zip_blob
)
{
return
jIO
.
util
.
readBlobAsDataURL
(
zip_blob
);
...
...
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