Fixes for image support
This commit is contained in:
@@ -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/
|
||||
*
|
||||
@@ -204606,7 +204606,7 @@ function DecodeBase64(imData, szSrc)
|
||||
{
|
||||
this.Api = _api;
|
||||
};
|
||||
|
||||
|
||||
this.LoadEmbeddedFonts = function(url, _fonts)
|
||||
{
|
||||
this.embeddedFilesPath = url;
|
||||
@@ -204875,7 +204875,7 @@ function DecodeBase64(imData, szSrc)
|
||||
oThis.Api.OpenDocumentProgress.CurrentFont++;
|
||||
oThis.Api.SendOpenProgress();
|
||||
}
|
||||
|
||||
|
||||
oThis.fonts_loading_after_style[oThis.fonts_loading_after_style.length] = oThis.fonts_loading[0];
|
||||
oThis.fonts_loading.shift();
|
||||
oThis._LoadFonts();
|
||||
@@ -204950,7 +204950,7 @@ function DecodeBase64(imData, szSrc)
|
||||
{
|
||||
this.embeddedFontFiles[font_index].SetStreamIndex(stream_index);
|
||||
};
|
||||
|
||||
|
||||
function CGlobalImageLoader()
|
||||
{
|
||||
this.map_image_index = {};
|
||||
@@ -204962,7 +204962,7 @@ function DecodeBase64(imData, szSrc)
|
||||
|
||||
this.bIsLoadDocumentFirst = false;
|
||||
|
||||
this.bIsAsyncLoadDocumentImages = false;
|
||||
this.bIsAsyncLoadDocumentImages = true;
|
||||
|
||||
this.bIsLoadDocumentImagesNoByOrder = true;
|
||||
this.nNoByOrderCounter = 0;
|
||||
@@ -205023,7 +205023,15 @@ function DecodeBase64(imData, szSrc)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.LoadDocumentImagesCallback = function() {
|
||||
|
||||
if (this.ThemeLoader == null)
|
||||
this.Api.asyncImagesDocumentEndLoaded();
|
||||
else
|
||||
this.ThemeLoader.asyncImagesEndLoaded();
|
||||
}
|
||||
|
||||
this.LoadDocumentImages = function(_images, isUrl)
|
||||
{
|
||||
// сначала заполним массив
|
||||
@@ -205051,13 +205059,10 @@ function DecodeBase64(imData, szSrc)
|
||||
{
|
||||
this.LoadImageAsync(i);
|
||||
}
|
||||
|
||||
this.images_loading.splice(0, _len);
|
||||
|
||||
if (this.ThemeLoader == null)
|
||||
this.Api.asyncImagesDocumentEndLoaded();
|
||||
else
|
||||
this.ThemeLoader.asyncImagesEndLoaded();
|
||||
var that = this;
|
||||
setTimeout(function() { that.LoadDocumentImagesCallback() }, 3000);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -205181,17 +205186,27 @@ function DecodeBase64(imData, szSrc)
|
||||
oImage.Status = ImageLoadStatus.Loading;
|
||||
oImage.Image = new Image();
|
||||
oThis.map_image_index[oImage.src] = oImage;
|
||||
var oThat = oThis;
|
||||
oImage.Image.onload = function(){
|
||||
oImage.Status = ImageLoadStatus.Complete;
|
||||
oThis.Api.asyncImageEndLoadedBackground(oImage);
|
||||
oThat.Api.asyncImageEndLoadedBackground(oImage);
|
||||
};
|
||||
oImage.Image.onerror = function(){
|
||||
oImage.Status = ImageLoadStatus.Complete;
|
||||
oImage.Image = null;
|
||||
oThis.Api.asyncImageEndLoadedBackground(oImage);
|
||||
oThat.Api.asyncImageEndLoadedBackground(oImage);
|
||||
};
|
||||
//oImage.Image.crossOrigin = 'anonymous';
|
||||
oThis.loadImageByUrl(oImage.Image, oImage.src);
|
||||
|
||||
// CRYPTPAD: if we find an image URL with #channel= in it
|
||||
// then we need to ask cryptpad to get the blob
|
||||
if (oImage.src.indexOf("#src=")!=-1)
|
||||
window.parent.APP.getImageURL(oImage.src, function(url) {
|
||||
oThis.loadImageByUrl(oImage.Image, url);
|
||||
oThis.map_image_index[url] = oImage;
|
||||
});
|
||||
else
|
||||
oThis.loadImageByUrl(oImage.Image, oImage.src);
|
||||
};
|
||||
|
||||
this.LoadImagesWithCallback = function(arr, loadImageCallBack, loadImageCallBackArgs)
|
||||
|
||||
Reference in New Issue
Block a user