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
b4196484
Commit
b4196484
authored
Jan 23, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gadget: use binary format for save/open document
parent
c5b52c29
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
50 deletions
+20
-50
cell/api.js
cell/api.js
+0
-3
common/Local/common.js
common/Local/common.js
+19
-41
common/externs/global.js
common/externs/global.js
+1
-0
slide/api.js
slide/api.js
+0
-3
word/api.js
word/api.js
+0
-3
No files found.
cell/api.js
View file @
b4196484
...
...
@@ -3295,9 +3295,6 @@ var editor;
var
oBinaryFileWriter
=
new
AscCommonExcel
.
BinaryFileWriter
(
this
.
wbModel
);
oBinaryFileWriter
.
Write
(
undefined
,
true
);
var
_header
=
oBinaryFileWriter
.
WriteFileHeader
(
oBinaryFileWriter
.
Memory
.
GetCurPosition
(),
Asc
.
c_nVersionNoBase64
);
window
[
"
native
"
][
"
Save_End
"
](
_header
,
oBinaryFileWriter
.
Memory
.
GetCurPosition
());
return
oBinaryFileWriter
.
Memory
.
ImData
.
data
;
};
...
...
common/Local/common.js
View file @
b4196484
...
...
@@ -276,50 +276,28 @@ AscCommon.downloadUrlAsBlob = function (url) {
AscCommon
.
baseEditorsApi
.
prototype
.
jio_open
=
function
()
{
var
t
=
this
,
g
=
Common
.
Gateway
;
return
g
.
jio_getAttachment
(
'
/
'
,
'
body.txt
'
)
.
push
(
undefined
,
function
(
error
)
{
if
(
error
[
"
status_code
"
]
===
404
)
{
return
g
.
props
.
value
;
}
throw
error
;
})
.
push
(
function
(
doc
)
{
if
(
!
doc
)
{
switch
(
g
.
props
.
documentType
)
{
case
"
presentation
"
:
doc
=
t
.
getEmpty
();
break
;
case
"
spreadsheet
"
:
doc
=
"
XLSY;v2;2286;BAKAAgAAA+cHAAAEAwgAAADqCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AQEBAQkQBgAAAAABAQEBAAkAAAAAGAYAAAACAQAAAAAAAAAA
"
;
break
;
case
"
text
"
:
doc
=
window
.
g_sEmpty_bin
;
break
;
}
}
t
.
_OfflineAppDocumentEndLoad
(
''
,
doc
);
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
});
g
=
Common
.
Gateway
,
doc
=
g
.
props
.
value
;
if
(
!
doc
)
{
switch
(
g
.
props
.
documentType
)
{
case
"
presentation
"
:
doc
=
t
.
getEmpty
();
break
;
case
"
spreadsheet
"
:
doc
=
"
XLSY;v2;2286;BAKAAgAAA+cHAAAEAwgAAADqCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAQsKAAAAAQWamZmZmZkpQA48AAAAAAVxPQrXowA0QAEFKFyPwvUIOkACBXE9CtejADRAAwUoXI/C9Qg6QAQFcT0K16MANEAFBXE9CtejADRADwYAAAAAAQEBAQkQBgAAAAABAQEBAAkAAAAAGAYAAAACAQAAAAAAAAAA
"
;
break
;
case
"
text
"
:
doc
=
window
.
g_sEmpty_bin
;
break
;
}
}
t
.
_OfflineAppDocumentEndLoad
(
''
,
doc
);
};
AscCommon
.
baseEditorsApi
.
prototype
.
jio_save
=
function
()
{
var
t
=
this
,
g
=
Common
.
Gateway
,
result
=
{},
data
=
t
.
asc_nativeGetFile
();
if
(
g
.
props
.
save_defer
)
{
// if we are run from getContent
result
[
g
.
props
.
key
]
=
data
;
g
.
props
.
save_defer
.
resolve
(
result
);
g
.
props
.
save_defer
=
null
;
}
else
{
// TODO: rewrite to put_attachment
return
g
.
jio_putAttachment
(
'
/
'
,
'
body.txt
'
,
data
)
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
});
}
// data = t.asc_nativeGetFile(); // base64 file
data
=
new
Blob
([
t
.
asc_nativeGetFileData
()]);
// binary file
return
g
.
jio_save
(
data
);
};
\ No newline at end of file
common/externs/global.js
View file @
b4196484
...
...
@@ -58,6 +58,7 @@ Common.Gateway = {
* @return {Object}
*/
Common
.
Gateway
.
jio_getAttachment
=
function
(
doc_id
,
attach_id
)
{};
Common
.
Gateway
.
jio_save
=
function
()
{};
function
jq
(){}
...
...
slide/api.js
View file @
b4196484
...
...
@@ -6704,9 +6704,6 @@ background-repeat: no-repeat;\
this
.
WordControl
.
m_oLogicDocument
.
CalculateComments
();
writer
.
WriteDocument3
(
this
.
WordControl
.
m_oLogicDocument
);
var
_header
=
"
PPTY;v10;
"
+
writer
.
pos
+
"
;
"
;
window
[
"
native
"
][
"
Save_End
"
](
_header
,
writer
.
pos
);
return
writer
.
ImData
.
data
;
};
...
...
word/api.js
View file @
b4196484
...
...
@@ -7985,9 +7985,6 @@ background-repeat: no-repeat;\
oBinaryFileWriter
.
Write
(
true
);
var
_header
=
AscCommon
.
c_oSerFormat
.
Signature
+
"
;v
"
+
Asc
.
c_nVersionNoBase64
+
"
;
"
+
_memory
.
GetCurPosition
()
+
"
;
"
;
window
[
"
native
"
][
"
Save_End
"
](
_header
,
_memory
.
GetCurPosition
());
return
_memory
.
ImData
.
data
;
};
...
...
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