|
|
|
@ -8402,18 +8402,18 @@ function(font_index,stream_index){this.embeddedFontFiles[font_index].SetStreamIn
|
|
|
|
|
false;var oThis=this;if(window["AscDesktopEditor"]&&window["AscDesktopEditor"]["IsLocalFile"]&&window["AscDesktopEditor"]["isBlockchainSupport"]){this.isBlockchainSupport=window["AscDesktopEditor"]["isBlockchainSupport"]()&&!window["AscDesktopEditor"]["IsLocalFile"]();if(this.isBlockchainSupport){Image.prototype.preload_crypto=function(_url){window["crypto_images_map"]=window["crypto_images_map"]||{};if(!window["crypto_images_map"][_url])window["crypto_images_map"][_url]=[];window["crypto_images_map"][_url].push(this);
|
|
|
|
|
window["AscDesktopEditor"]["PreloadCryptoImage"](_url,AscCommon.g_oDocumentUrls.getLocal(_url));oThis.Api.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.LoadImage)};Image.prototype["onload_crypto"]=function(_src,_crypto_data){if(_crypto_data&&AscCommon.EncryptionWorker&&AscCommon.EncryptionWorker.isCryptoImages()){AscCommon.EncryptionWorker.decryptImage(_src,this,_crypto_data);return}this.crossOrigin="";this.src=_src;oThis.Api.sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction,
|
|
|
|
|
Asc.c_oAscAsyncAction.LoadImage)}}}this.put_Api=function(_api){this.Api=_api;if(this.Api.IsAsyncOpenDocumentImages!==undefined){this.bIsAsyncLoadDocumentImages=this.Api.IsAsyncOpenDocumentImages();if(this.bIsAsyncLoadDocumentImages)if(undefined===this.Api.asyncImageEndLoadedBackground)this.bIsAsyncLoadDocumentImages=false}};this.LoadDocumentImagesCallback=function(){if(this.ThemeLoader==null)this.Api.asyncImagesDocumentEndLoaded();else this.ThemeLoader.asyncImagesEndLoaded()};this.LoadDocumentImages=
|
|
|
|
|
function(_images){if(this.ThemeLoader==null)this.Api.asyncImagesDocumentStartLoaded();else this.ThemeLoader.asyncImagesStartLoaded();this.images_loading=[];for(var id in _images)this.images_loading[this.images_loading.length]=AscCommon.getFullImageSrc2(_images[id]);if(!this.bIsAsyncLoadDocumentImages){this.nNoByOrderCounter=0;this._LoadImages()}else{var _len=this.images_loading.length;for(var i=0;i<_len;i++)this.LoadImageAsync(i);this.images_loading.splice(0,_len);var that=this;setTimeout(function(){that.LoadDocumentImagesCallback()},
|
|
|
|
|
3E3)}};this.loadImageByUrl=function(_image,_url){if(this.isBlockchainSupport)_image.preload_crypto(_url);else _image.src=_url};this._LoadImages=function(){var _count_images=this.images_loading.length;if(0==_count_images){this.nNoByOrderCounter=0;if(this.ThemeLoader==null)this.Api.asyncImagesDocumentEndLoaded();else this.ThemeLoader.asyncImagesEndLoaded();return}for(var i=0;i<_count_images;i++){var _id=this.images_loading[i];var oImage=new CImage(_id);oImage.Status=ImageLoadStatus.Loading;oImage.Image=
|
|
|
|
|
new Image;oThis.map_image_index[oImage.src]=oImage;oImage.Image.parentImage=oImage;oImage.Image.onload=function(){this.parentImage.Status=ImageLoadStatus.Complete;oThis.nNoByOrderCounter++;if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentImage++;oThis.Api.SendOpenProgress()}if(!oThis.bIsLoadDocumentImagesNoByOrder){oThis.images_loading.shift();oThis._LoadImages()}else if(oThis.nNoByOrderCounter==oThis.images_loading.length){oThis.images_loading=[];oThis._LoadImages()}};
|
|
|
|
|
oImage.Image.onerror=function(){this.parentImage.Status=ImageLoadStatus.Complete;this.parentImage.Image=null;oThis.nNoByOrderCounter++;if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentImage++;oThis.Api.SendOpenProgress()}if(!oThis.bIsLoadDocumentImagesNoByOrder){oThis.images_loading.shift();oThis._LoadImages()}else if(oThis.nNoByOrderCounter==oThis.images_loading.length){oThis.images_loading=[];oThis._LoadImages()}};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,
|
|
|
|
|
img.src)});oThis.loadImageByUrl(oImage.Image,oImage.src);if(!oThis.bIsLoadDocumentImagesNoByOrder)return}};this.LoadImage=function(src,Type){var _image=this.map_image_index[src];if(undefined!=_image)return _image;this.Api.asyncImageStartLoaded();var oImage=new CImage(src);oImage.Type=Type;oImage.Image=new Image;oImage.Status=ImageLoadStatus.Loading;oThis.map_image_index[oImage.src]=oImage;oImage.Image.onload=function(){oImage.Status=ImageLoadStatus.Complete;oThis.Api.asyncImageEndLoaded(oImage)};
|
|
|
|
|
oImage.Image.onerror=function(){oImage.Image=null;oImage.Status=ImageLoadStatus.Complete;oThis.Api.asyncImageEndLoaded(oImage)};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});this.loadImageByUrl(oImage.Image,oImage.src);return null};this.LoadImageAsync=function(i){var _id=oThis.images_loading[i];var oImage=new CImage(_id);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;oThat.Api.asyncImageEndLoadedBackground(oImage)};oImage.Image.onerror=function(){oImage.Status=ImageLoadStatus.Complete;oImage.Image=null;oThat.Api.asyncImageEndLoadedBackground(oImage)};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});console.log("Loading image "+i);console.log(oImage);window.parent.APP.getImageURL(oImage.src,function(url){if(url=="")oThis.loadImageByUrl(oImage.Image,oImage.src);else{oThis.loadImageByUrl(oImage.Image,
|
|
|
|
|
url);oThis.map_image_index[url]=oImage}})};this.LoadImagesWithCallback=function(arr,loadImageCallBack,loadImageCallBackArgs){var arrAsync=[];var i=0;for(i=0;i<arr.length;i++)if(this.map_image_index[arr[i]]===undefined)arrAsync.push(arr[i]);if(arrAsync.length==0){loadImageCallBack.call(this.Api,loadImageCallBackArgs);return}this.loadImageCallBackCounter=0;this.loadImageCallBackCounterMax=arrAsync.length;this.loadImageCallBack=loadImageCallBack;this.loadImageCallBackArgs=loadImageCallBackArgs;for(i=
|
|
|
|
|
0;i<arrAsync.length;i++){var oImage=new CImage(arrAsync[i]);oImage.Image=new Image;oImage.Image.parentImage=oImage;oImage.Status=ImageLoadStatus.Loading;this.map_image_index[oImage.src]=oImage;oImage.Image.onload=function(){this.parentImage.Status=ImageLoadStatus.Complete;oThis.loadImageCallBackCounter++;if(oThis.loadImageCallBackCounter==oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};oImage.Image.onerror=function(){this.parentImage.Image=null;this.parentImage.Status=ImageLoadStatus.Complete;
|
|
|
|
|
oThis.loadImageCallBackCounter++;if(oThis.loadImageCallBackCounter==oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});this.loadImageByUrl(oImage.Image,oImage.src)}};this.LoadImagesWithCallbackEnd=function(){this.loadImageCallBack.call(this.Api,this.loadImageCallBackArgs);this.loadImageCallBack=null;this.loadImageCallBackArgs=null;this.loadImageCallBackCounterMax=0;this.loadImageCallBackCounter=
|
|
|
|
|
0}}var g_flow_anchor=new Image;g_flow_anchor.asc_complete=false;g_flow_anchor.onload=function(){g_flow_anchor.asc_complete=true};g_flow_anchor.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC";var g_flow_anchor2=new Image;g_flow_anchor2.asc_complete=
|
|
|
|
|
false;g_flow_anchor2.onload=function(){g_flow_anchor2.asc_complete=true};g_flow_anchor2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC";
|
|
|
|
|
function(_images){if(this.ThemeLoader==null)this.Api.asyncImagesDocumentStartLoaded();else this.ThemeLoader.asyncImagesStartLoaded();this.images_loading=[];for(var id in _images)this.images_loading[this.images_loading.length]=AscCommon.getFullImageSrc2(_images[id]);if(!this.bIsAsyncLoadDocumentImages){this.nNoByOrderCounter=0;this._LoadImages()}else{var _len=this.images_loading.length;if(_len===0)return void this.LoadDocumentImagesCallback();var todo=_len;var that=this;var done=function(){todo--;
|
|
|
|
|
if(todo===0){that.images_loading.splice(0,_len);setTimeout(function(){that.LoadDocumentImagesCallback()},100);done=function(){}}};for(var i=0;i<_len;i++)this.LoadImageAsync(i,done);return;this.images_loading.splice(0,_len);var that=this;setTimeout(function(){that.LoadDocumentImagesCallback()},3E3)}};this.loadImageByUrl=function(_image,_url){if(this.isBlockchainSupport)_image.preload_crypto(_url);else _image.src=_url};this._LoadImages=function(){var _count_images=this.images_loading.length;if(0==_count_images){this.nNoByOrderCounter=
|
|
|
|
|
0;if(this.ThemeLoader==null)this.Api.asyncImagesDocumentEndLoaded();else this.ThemeLoader.asyncImagesEndLoaded();return}for(var i=0;i<_count_images;i++){var _id=this.images_loading[i];var oImage=new CImage(_id);oImage.Status=ImageLoadStatus.Loading;oImage.Image=new Image;oThis.map_image_index[oImage.src]=oImage;oImage.Image.parentImage=oImage;oImage.Image.onload=function(){this.parentImage.Status=ImageLoadStatus.Complete;oThis.nNoByOrderCounter++;if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentImage++;
|
|
|
|
|
oThis.Api.SendOpenProgress()}if(!oThis.bIsLoadDocumentImagesNoByOrder){oThis.images_loading.shift();oThis._LoadImages()}else if(oThis.nNoByOrderCounter==oThis.images_loading.length){oThis.images_loading=[];oThis._LoadImages()}};oImage.Image.onerror=function(){this.parentImage.Status=ImageLoadStatus.Complete;this.parentImage.Image=null;oThis.nNoByOrderCounter++;if(oThis.bIsLoadDocumentFirst===true){oThis.Api.OpenDocumentProgress.CurrentImage++;oThis.Api.SendOpenProgress()}if(!oThis.bIsLoadDocumentImagesNoByOrder){oThis.images_loading.shift();
|
|
|
|
|
oThis._LoadImages()}else if(oThis.nNoByOrderCounter==oThis.images_loading.length){oThis.images_loading=[];oThis._LoadImages()}};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});oThis.loadImageByUrl(oImage.Image,oImage.src);if(!oThis.bIsLoadDocumentImagesNoByOrder)return}};this.LoadImage=function(src,Type){var _image=this.map_image_index[src];if(undefined!=_image)return _image;this.Api.asyncImageStartLoaded();var oImage=new CImage(src);oImage.Type=Type;oImage.Image=
|
|
|
|
|
new Image;oImage.Status=ImageLoadStatus.Loading;oThis.map_image_index[oImage.src]=oImage;oImage.Image.onload=function(){oImage.Status=ImageLoadStatus.Complete;oThis.Api.asyncImageEndLoaded(oImage)};oImage.Image.onerror=function(){oImage.Image=null;oImage.Status=ImageLoadStatus.Complete;oThis.Api.asyncImageEndLoaded(oImage)};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});this.loadImageByUrl(oImage.Image,oImage.src);return null};this.LoadImageAsync=function(i,
|
|
|
|
|
cb){var _id=oThis.images_loading[i];var oImage=new CImage(_id);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;oThat.Api.asyncImageEndLoadedBackground(oImage)};oImage.Image.onerror=function(){oImage.Status=ImageLoadStatus.Complete;oImage.Image=null;oThat.Api.asyncImageEndLoadedBackground(oImage)};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,
|
|
|
|
|
img.src)});console.log("Loading image "+i);console.log(oImage);window.parent.APP.getImageURL(oImage.src,function(url){if(url=="")oThis.loadImageByUrl(oImage.Image,oImage.src);else{oThis.loadImageByUrl(oImage.Image,url);oThis.map_image_index[url]=oImage}if(typeof cb==="function")cb()})};this.LoadImagesWithCallback=function(arr,loadImageCallBack,loadImageCallBackArgs){var arrAsync=[];var i=0;for(i=0;i<arr.length;i++)if(this.map_image_index[arr[i]]===undefined)arrAsync.push(arr[i]);if(arrAsync.length==
|
|
|
|
|
0){loadImageCallBack.call(this.Api,loadImageCallBackArgs);return}this.loadImageCallBackCounter=0;this.loadImageCallBackCounterMax=arrAsync.length;this.loadImageCallBack=loadImageCallBack;this.loadImageCallBackArgs=loadImageCallBackArgs;for(i=0;i<arrAsync.length;i++){var oImage=new CImage(arrAsync[i]);oImage.Image=new Image;oImage.Image.parentImage=oImage;oImage.Status=ImageLoadStatus.Loading;this.map_image_index[oImage.src]=oImage;oImage.Image.onload=function(){this.parentImage.Status=ImageLoadStatus.Complete;
|
|
|
|
|
oThis.loadImageCallBackCounter++;if(oThis.loadImageCallBackCounter==oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};oImage.Image.onerror=function(){this.parentImage.Image=null;this.parentImage.Status=ImageLoadStatus.Complete;oThis.loadImageCallBackCounter++;if(oThis.loadImageCallBackCounter==oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};AscCommon.backoffOnErrorImg(oImage.Image,function(img){oThis.loadImageByUrl(img,img.src)});this.loadImageByUrl(oImage.Image,
|
|
|
|
|
oImage.src)}};this.LoadImagesWithCallbackEnd=function(){this.loadImageCallBack.call(this.Api,this.loadImageCallBackArgs);this.loadImageCallBack=null;this.loadImageCallBackArgs=null;this.loadImageCallBackCounterMax=0;this.loadImageCallBackCounter=0}}var g_flow_anchor=new Image;g_flow_anchor.asc_complete=false;g_flow_anchor.onload=function(){g_flow_anchor.asc_complete=true};g_flow_anchor.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC";
|
|
|
|
|
var g_flow_anchor2=new Image;g_flow_anchor2.asc_complete=false;g_flow_anchor2.onload=function(){g_flow_anchor2.asc_complete=true};g_flow_anchor2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC";
|
|
|
|
|
window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_font_loader=new CGlobalFontLoader;window["AscCommon"].g_image_loader=new CGlobalImageLoader;window["AscCommon"].g_flow_anchor=g_flow_anchor;window["AscCommon"].g_flow_anchor2=g_flow_anchor2})(window,window.document);"use strict";(function(window,undefined){var g_dKoef_mm_to_pix=AscCommon.g_dKoef_mm_to_pix;function CBounds(){this.L=0;this.T=0;this.R=0;this.B=0;this.isAbsL=false;this.isAbsT=false;this.isAbsR=false;this.isAbsB=false;this.AbsW=
|
|
|
|
|
-1;this.AbsH=-1;this.SetParams=function(_l,_t,_r,_b,abs_l,abs_t,abs_r,abs_b,absW,absH){this.L=_l;this.T=_t;this.R=_r;this.B=_b;this.isAbsL=abs_l;this.isAbsT=abs_t;this.isAbsR=abs_r;this.isAbsB=abs_b;this.AbsW=absW;this.AbsH=absH}}function CAbsolutePosition(){this.L=0;this.T=0;this.R=0;this.B=0}var g_anchor_left=1;var g_anchor_top=2;var g_anchor_right=4;var g_anchor_bottom=8;function CControl(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=null;this.TabIndex=
|
|
|
|
|
null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Resize=function(_width,_height,api){if(null==this.Parent||null==this.HtmlElement)return;var _x=0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else if(g_anchor_right==
|
|
|
|
|