|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright (C) Ascensio System SIA 2012-2019. All rights reserved
|
|
|
|
* Copyright (C) Ascensio System SIA 2012-2020. All rights reserved
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* https://www.onlyoffice.com/
|
|
|
|
* https://www.onlyoffice.com/
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -12384,6 +12384,10 @@ function isRealObject(obj)
|
|
|
|
|
|
|
|
|
|
|
|
function UploadImageFiles(files, documentId, documentUserId, jwt, callback)
|
|
|
|
function UploadImageFiles(files, documentId, documentUserId, jwt, callback)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// CryptPad: we need to take control of the upload
|
|
|
|
|
|
|
|
window.parent.APP.UploadImageFiles(files, documentId, documentUserId, jwt, callback);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (files.length > 0)
|
|
|
|
if (files.length > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var url = sUploadServiceLocalUrl + '/' + documentId + '/' + documentUserId + '/' + g_oDocumentUrls.getMaxIndex();
|
|
|
|
var url = sUploadServiceLocalUrl + '/' + documentId + '/' + documentUserId + '/' + g_oDocumentUrls.getMaxIndex();
|
|
|
@ -15594,6 +15598,7 @@ window["AscDesktopEditor_Save"] = function()
|
|
|
|
window["AscDesktopEditor"]["OnSave"]();
|
|
|
|
window["AscDesktopEditor"]["OnSave"]();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* (c) Copyright Ascensio System SIA 2010-2018
|
|
|
|
* (c) Copyright Ascensio System SIA 2010-2018
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -21398,7 +21403,16 @@ CCollaborativeEditingBase.prototype.Clear_NewImages = function()
|
|
|
|
};
|
|
|
|
};
|
|
|
|
CCollaborativeEditingBase.prototype.Add_NewImage = function(Url)
|
|
|
|
CCollaborativeEditingBase.prototype.Add_NewImage = function(Url)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// CryptPad - Modify URL for local loading
|
|
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
|
|
if (Url.indexOf("#src=")!=-1) {
|
|
|
|
|
|
|
|
window.parent.APP.getImageURL(Url, function(url) {
|
|
|
|
|
|
|
|
that.m_aNewImages.push( Url );
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
this.m_aNewImages.push( Url );
|
|
|
|
this.m_aNewImages.push( Url );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// CryptPad - End modification
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
// Функции для работы с массивом m_aDC
|
|
|
|
// Функции для работы с массивом m_aDC
|
|
|
@ -24305,9 +24319,32 @@ function (window, undefined)
|
|
|
|
baseEditorsApi.prototype._addImageUrl = function()
|
|
|
|
baseEditorsApi.prototype._addImageUrl = function()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// CRYPTPAD
|
|
|
|
|
|
|
|
// This method is necessary to add the loaded images to the list of loaded images
|
|
|
|
|
|
|
|
// The code is in slide/api.js
|
|
|
|
|
|
|
|
baseEditorsApi.prototype.asc_addImageCallback = function(res)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
};
|
|
|
|
baseEditorsApi.prototype.asc_addImage = function()
|
|
|
|
baseEditorsApi.prototype.asc_addImage = function()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var t = this;
|
|
|
|
var t = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CryptPad: we need to take control of the upload
|
|
|
|
|
|
|
|
// t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
|
|
|
|
|
|
|
|
// This method calls back to the cryptpad onlyoffice inner.js to load the cryptad file dialog
|
|
|
|
|
|
|
|
window.parent.APP.AddImage(function(res) {
|
|
|
|
|
|
|
|
// This method adds the loaded image to the list of loaded images
|
|
|
|
|
|
|
|
t.asc_addImageCallback(res);
|
|
|
|
|
|
|
|
// This method activats the image
|
|
|
|
|
|
|
|
t._addImageUrl([res.url]);
|
|
|
|
|
|
|
|
// t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
|
|
|
|
|
|
|
|
}, function() {
|
|
|
|
|
|
|
|
// t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
|
|
|
|
|
|
|
|
t.sendEvent("asc_onError", error, c_oAscError.Level.NoCritical);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Cryptpad end
|
|
|
|
|
|
|
|
|
|
|
|
AscCommon.ShowImageFileDialog(this.documentId, this.documentUserId, this.CoAuthoringApi.get_jwt(), function(error, files)
|
|
|
|
AscCommon.ShowImageFileDialog(this.documentId, this.documentUserId, this.CoAuthoringApi.get_jwt(), function(error, files)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
t._uploadCallback(error, files);
|
|
|
|
t._uploadCallback(error, files);
|
|
|
@ -31279,6 +31316,16 @@ background-repeat: no-repeat;\
|
|
|
|
return this.WordControl.m_oLogicDocument.canUnGroup();
|
|
|
|
return this.WordControl.m_oLogicDocument.canUnGroup();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CRYPTPAD
|
|
|
|
|
|
|
|
// This method is necessary to add the loaded images to the list of loaded images
|
|
|
|
|
|
|
|
asc_docs_api.prototype.asc_addImageCallback = function(res)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
g_oDocumentUrls.addImageUrl(res.name, res.url)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
asc_docs_api.prototype.asyncImageEndLoadedBackground = function(_image)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
asc_docs_api.prototype._addImageUrl = function(urls)
|
|
|
|
asc_docs_api.prototype._addImageUrl = function(urls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(this.isImageChangeUrl || this.isShapeImageChangeUrl || this.isSlideImageChangeUrl || this.isTextArtChangeUrl){
|
|
|
|
if(this.isImageChangeUrl || this.isShapeImageChangeUrl || this.isSlideImageChangeUrl || this.isTextArtChangeUrl){
|
|
|
|