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
171fd428
Commit
171fd428
authored
Dec 30, 2016
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jio gadget use blobs in put/getAttachment
parent
0b15156f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
33 deletions
+16
-33
cell/api.js
cell/api.js
+2
-3
common/editorscommon.js
common/editorscommon.js
+9
-22
slide/api.js
slide/api.js
+3
-5
word/api.js
word/api.js
+2
-3
No files found.
cell/api.js
View file @
171fd428
...
...
@@ -2230,9 +2230,8 @@ var editor;
return
imageUrl
;
})
.
push
(
AscCommon
.
downloadUrlAsBlob
)
.
push
(
AscCommon
.
readBlobAsDataURL
)
.
push
(
function
(
dataUrl
)
{
return
Common
.
Gateway
.
jio_putAttachment
(
t
.
documentId
,
undefined
,
dataUrl
);
.
push
(
function
(
blob
)
{
return
Common
.
Gateway
.
jio_putAttachment
(
t
.
documentId
,
undefined
,
blob
);
})
.
push
(
callback
)
//.push(function () {t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);})
...
...
common/editorscommon.js
View file @
171fd428
...
...
@@ -1002,28 +1002,15 @@ function InitDragAndDrop (oHtmlElement, callback) {
}
function
UploadImageFiles
(
files
,
documentId
,
documentUserId
,
jwt
,
callback
)
{
if
(
files
.
length
>
0
)
{
var
file
=
files
[
0
],
reader
=
new
FileReader
();
reader
.
addEventListener
(
'
load
'
,
function
()
{
Common
.
Gateway
.
jio_putAttachment
(
documentId
,
undefined
,
reader
.
result
)
.
push
(
function
(
image_url
)
{
callback
(
Asc
.
c_oAscError
.
ID
.
No
,
'
jio:
'
+
image_url
);
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
callback
(
Asc
.
c_oAscError
.
ID
.
Unknown
);
});
});
reader
.
readAsDataURL
(
file
);
//// not worked. throw csp error
//Common.Gateway.jio_putAttachment(documentId, undefined, URL.createObjectURL(file))
// .push(function (image_url) {
// callback(Asc.c_oAscError.ID.No, 'jio:' + image_url);
// })
// .push(undefined, function (error) {
// callback(Asc.c_oAscError.ID.Unknown);
// throw error;
// });
var
file
=
files
[
0
];
Common
.
Gateway
.
jio_putAttachment
(
documentId
,
undefined
,
file
)
.
push
(
function
(
image_url
)
{
callback
(
Asc
.
c_oAscError
.
ID
.
No
,
'
jio:
'
+
image_url
);
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
callback
(
Asc
.
c_oAscError
.
ID
.
Unknown
);
});
}
else
{
callback
(
Asc
.
c_oAscError
.
ID
.
Unknown
);
}
...
...
slide/api.js
View file @
171fd428
...
...
@@ -3674,12 +3674,10 @@ background-repeat: no-repeat;\
});
//this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
if
(
0
!==
start
.
indexOf
(
'
data:
'
))
{
queue
.
push
(
AscCommon
.
downloadUrlAsBlob
)
.
push
(
AscCommon
.
readBlobAsDataURL
);
queue
.
push
(
AscCommon
.
downloadUrlAsBlob
)
}
return
queue
.
push
(
function
(
dataUrl
)
{
return
Common
.
Gateway
.
jio_putAttachment
(
t
.
documentId
,
undefined
,
dataUrl
);
return
queue
.
push
(
function
(
blob
)
{
return
Common
.
Gateway
.
jio_putAttachment
(
t
.
documentId
,
undefined
,
blob
);
})
.
push
(
callback
)
//.push(function () {t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);})
...
...
word/api.js
View file @
171fd428
...
...
@@ -4074,9 +4074,8 @@ background-repeat: no-repeat;\
return
url
;
})
.
push
(
AscCommon
.
downloadUrlAsBlob
)
.
push
(
AscCommon
.
readBlobAsDataURL
)
.
push
(
function
(
dataUrl
)
{
return
Common
.
Gateway
.
jio_putAttachment
(
t
.
documentId
,
undefined
,
dataUrl
);
.
push
(
function
(
blob
)
{
return
Common
.
Gateway
.
jio_putAttachment
(
t
.
documentId
,
undefined
,
blob
);
})
.
push
(
callback
)
//.push(function () {t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);})
...
...
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