Show file versions for wopi

This commit is contained in:
Julia Radzhabova 2021-05-13 14:45:53 +03:00
parent 59c658ecab
commit b14b245698
3 changed files with 24 additions and 12 deletions

View file

@ -179,13 +179,20 @@ div {
window.open(fileInfo.HostEditUrl, "_blank"); window.open(fileInfo.HostEditUrl, "_blank");
}; };
var requestSharingSettings = function (event) { var onRequestSharingSettings = function (event) {
if (fileInfo.FileSharingPostMessage) if (fileInfo.FileSharingPostMessage)
_postMessage('UI_Sharing', {}); _postMessage('UI_Sharing', {});
else if (fileInfo.FileSharingUrl) else if (fileInfo.FileSharingUrl)
window.open(fileInfo.FileSharingUrl, "_blank"); window.open(fileInfo.FileSharingUrl, "_blank");
}; };
var onRequestHistory = function (event) {
if (fileInfo.FileVersionPostMessage)
_postMessage('UI_FileVersions', {});
else if (fileInfo.FileVersionUrl)
window.open(fileInfo.FileVersionUrl, "_blank");
};
var onError = function (event) { var onError = function (event) {
if (event) if (event)
innerAlert(event.data); innerAlert(event.data);
@ -258,7 +265,8 @@ div {
"onError": onError, "onError": onError,
"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 ? requestSharingSettings : undefined "onRequestSharingSettings": fileInfo.FileSharingPostMessage || fileInfo.FileSharingUrl ? onRequestSharingSettings : undefined,
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined
} }
}; };

View file

@ -865,11 +865,13 @@ define([
}, },
showHistory: function() { showHistory: function() {
var maincontroller = DE.getController('Main'); if (!this.mode.wopi) {
if (!maincontroller.loadMask) var maincontroller = DE.getController('Main');
maincontroller.loadMask = new Common.UI.LoadMask({owner: $('#viewport')}); if (!maincontroller.loadMask)
maincontroller.loadMask.setTitle(this.textLoadHistory); maincontroller.loadMask = new Common.UI.LoadMask({owner: $('#viewport')});
maincontroller.loadMask.show(); maincontroller.loadMask.setTitle(this.textLoadHistory);
maincontroller.loadMask.show();
}
Common.Gateway.requestHistory(); Common.Gateway.requestHistory();
}, },

View file

@ -758,11 +758,13 @@ define([
}, },
showHistory: function() { showHistory: function() {
var maincontroller = PE.getController('Main'); if (!this.mode.wopi) {
if (!maincontroller.loadMask) var maincontroller = PE.getController('Main');
maincontroller.loadMask = new Common.UI.LoadMask({owner: $('#viewport')}); if (!maincontroller.loadMask)
maincontroller.loadMask.setTitle(this.textLoadHistory); maincontroller.loadMask = new Common.UI.LoadMask({owner: $('#viewport')});
maincontroller.loadMask.show(); maincontroller.loadMask.setTitle(this.textLoadHistory);
maincontroller.loadMask.show();
}
Common.Gateway.requestHistory(); Common.Gateway.requestHistory();
}, },