[Wopi] Support insert image from storage: EnableInsertRemoteImage from CheckFileInfo
This commit is contained in:
parent
0b10fb7a52
commit
0c0d9a06b2
|
@ -102,6 +102,7 @@ div {
|
||||||
var sendNotificationTimer;
|
var sendNotificationTimer;
|
||||||
var sessionId;
|
var sessionId;
|
||||||
var fileInfo;
|
var fileInfo;
|
||||||
|
var insertImageType;
|
||||||
|
|
||||||
var innerAlert = function (message) {
|
var innerAlert = function (message) {
|
||||||
if (console && console.log)
|
if (console && console.log)
|
||||||
|
@ -117,6 +118,12 @@ div {
|
||||||
innerAlert('Grab_Focus');
|
innerAlert('Grab_Focus');
|
||||||
docEditor.grabFocus();
|
docEditor.grabFocus();
|
||||||
},
|
},
|
||||||
|
'Action_InsertGraphic': function (data) {
|
||||||
|
data && data.Values && docEditor.insertImage({
|
||||||
|
"c": insertImageType,
|
||||||
|
"images": [{ "url": data.Values.url }]
|
||||||
|
});
|
||||||
|
},
|
||||||
'Host_PostmessageReady': function (data) {
|
'Host_PostmessageReady': function (data) {
|
||||||
innerAlert('Host_PostmessageReady');
|
innerAlert('Host_PostmessageReady');
|
||||||
}
|
}
|
||||||
|
@ -226,6 +233,11 @@ div {
|
||||||
window.open(fileInfo.FileVersionUrl, "_blank");
|
window.open(fileInfo.FileVersionUrl, "_blank");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var onRequestInsertImage = function (event) {
|
||||||
|
insertImageType = event.data.c;
|
||||||
|
_postMessage('UI_InsertGraphic', {});
|
||||||
|
};
|
||||||
|
|
||||||
var onError = function (event) {
|
var onError = function (event) {
|
||||||
if (event)
|
if (event)
|
||||||
innerAlert(event.data);
|
innerAlert(event.data);
|
||||||
|
@ -304,7 +316,8 @@ div {
|
||||||
"onRequestClose": fileInfo.ClosePostMessage || fileInfo.CloseUrl ? onRequestClose : undefined,
|
"onRequestClose": fileInfo.ClosePostMessage || fileInfo.CloseUrl ? onRequestClose : undefined,
|
||||||
"onRequestRename": fileInfo.SupportsRename && fileInfo.UserCanRename ? onRequestRename : undefined,
|
"onRequestRename": fileInfo.SupportsRename && fileInfo.UserCanRename ? onRequestRename : undefined,
|
||||||
"onRequestSharingSettings": fileInfo.FileSharingPostMessage || fileInfo.FileSharingUrl ? onRequestSharingSettings : undefined,
|
"onRequestSharingSettings": fileInfo.FileSharingPostMessage || fileInfo.FileSharingUrl ? onRequestSharingSettings : undefined,
|
||||||
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined
|
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined,
|
||||||
|
"onRequestInsertImage": fileInfo.EnableInsertRemoteImage ? onRequestInsertImage : undefined
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue