|
|
@ -204531,6 +204531,11 @@ function DecodeBase64(imData, szSrc)
|
|
|
|
|
|
|
|
|
|
|
|
this.LoadDocumentImages = function(_images, isUrl)
|
|
|
|
this.LoadDocumentImages = function(_images, isUrl)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// CryptPad added logging
|
|
|
|
|
|
|
|
console.log("Loading images");
|
|
|
|
|
|
|
|
console.log(_images);
|
|
|
|
|
|
|
|
// CryptPad end logging
|
|
|
|
|
|
|
|
|
|
|
|
// сначала заполним массив
|
|
|
|
// сначала заполним массив
|
|
|
|
if (this.ThemeLoader == null)
|
|
|
|
if (this.ThemeLoader == null)
|
|
|
|
this.Api.asyncImagesDocumentStartLoaded();
|
|
|
|
this.Api.asyncImagesDocumentStartLoaded();
|
|
|
@ -204694,16 +204699,18 @@ function DecodeBase64(imData, szSrc)
|
|
|
|
oThat.Api.asyncImageEndLoadedBackground(oImage);
|
|
|
|
oThat.Api.asyncImageEndLoadedBackground(oImage);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//oImage.Image.crossOrigin = 'anonymous';
|
|
|
|
//oImage.Image.crossOrigin = 'anonymous';
|
|
|
|
|
|
|
|
console.log("Loading image " + i);
|
|
|
|
|
|
|
|
console.log(oImage);
|
|
|
|
// CRYPTPAD: if we find an image URL with #channel= in it
|
|
|
|
// CRYPTPAD: if we find an image URL with #channel= in it
|
|
|
|
// then we need to ask cryptpad to get the blob
|
|
|
|
// then we need to ask cryptpad to get the blob
|
|
|
|
if (oImage.src.indexOf("#src=")!=-1)
|
|
|
|
if (oImage.src.indexOf("#src=")!=-1) {
|
|
|
|
window.parent.APP.getImageURL(oImage.src, function(url) {
|
|
|
|
window.parent.APP.getImageURL(oImage.src, function(url) {
|
|
|
|
oThis.loadImageByUrl(oImage.Image, url);
|
|
|
|
oThis.loadImageByUrl(oImage.Image, url);
|
|
|
|
oThis.map_image_index[url] = oImage;
|
|
|
|
oThis.map_image_index[url] = oImage;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
else
|
|
|
|
} else {
|
|
|
|
oThis.loadImageByUrl(oImage.Image, oImage.src);
|
|
|
|
oThis.loadImageByUrl(oImage.Image, oImage.src);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this.LoadImagesWithCallback = function(arr, loadImageCallBack, loadImageCallBackArgs)
|
|
|
|
this.LoadImagesWithCallback = function(arr, loadImageCallBack, loadImageCallBackArgs)
|
|
|
@ -205226,6 +205233,11 @@ CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges = function (aImage
|
|
|
|
if(false === oApi.isSaveFonts_Images){
|
|
|
|
if(false === oApi.isSaveFonts_Images){
|
|
|
|
oApi.isSaveFonts_Images = true;
|
|
|
|
oApi.isSaveFonts_Images = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CryptPad - bypassing image loading which is breaking
|
|
|
|
|
|
|
|
AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
oApi.fCurCallback = function (oRes) {
|
|
|
|
oApi.fCurCallback = function (oRes) {
|
|
|
|
var aData, i, oUrls;
|
|
|
|
var aData, i, oUrls;
|
|
|
|
if(oRes['status'] === 'ok')
|
|
|
|
if(oRes['status'] === 'ok')
|
|
|
@ -205241,6 +205253,7 @@ CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges = function (aImage
|
|
|
|
AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad);
|
|
|
|
AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
AscCommon.sendCommand(oApi, null, rData);
|
|
|
|
AscCommon.sendCommand(oApi, null, rData);
|
|
|
|
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
CCollaborativeEditingBase.prototype.SendImagesCallback = function (aImages) {
|
|
|
|
CCollaborativeEditingBase.prototype.SendImagesCallback = function (aImages) {
|
|
|
@ -205454,15 +205467,16 @@ CCollaborativeEditingBase.prototype.Clear_NewImages = function()
|
|
|
|
};
|
|
|
|
};
|
|
|
|
CCollaborativeEditingBase.prototype.Add_NewImage = function(Url)
|
|
|
|
CCollaborativeEditingBase.prototype.Add_NewImage = function(Url)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
this.m_aNewImages.push( Url );
|
|
|
|
// CryptPad - Modify URL for local loading
|
|
|
|
// CryptPad - Modify URL for local loading
|
|
|
|
var that = this;
|
|
|
|
/*
|
|
|
|
|
|
|
|
console.log("Add Image " + Url);
|
|
|
|
if (Url.indexOf("#src=")!=-1) {
|
|
|
|
if (Url.indexOf("#src=")!=-1) {
|
|
|
|
window.parent.APP.getImageURL(Url, function(url) {
|
|
|
|
window.parent.APP.getImageURL(Url, function(url) {
|
|
|
|
that.m_aNewImages.push( Url );
|
|
|
|
console.log("CryptPad Image " + url);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.m_aNewImages.push( Url );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
// CryptPad - End modification
|
|
|
|
// CryptPad - End modification
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|