change
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
function isMobileApp(){return Unibase.Platform.Helpers.MobileHelper!==undefined&&Unibase.Platform.Helpers.MobileHelper.Instance()!==undefined}var Unibase;(function(n){let t;(function(t){let i;(function(t){let r;(function(n){n[n.Js=1]="Js";n[n.Css=2]="Css";n[n.Html=3]="Html";n[n.Image=4]="Image"})(r=t.FileType||(t.FileType={}));class f{}t.FileCacheOptions=f;class u{}t.FileCallBack=u;class i{constructor(){}updateFileLoadStatus(n){let t=i.loadedFile_callbacks[n];t.IsLoaded=!0;this.executeCallBackForFile(n)}executeCallBackForFile(n){let t=i.loadedFile_callbacks[n];if(t!==undefined&&t.IsLoaded){let n=t.Callbacks;if(n!=undefined&&n.length>0&&(n=t.Callbacks.filter(n=>n.IsExecuted==!1),n!=undefined&&n.length>0))for(let t=0;t<n.length;t++){let i=n[t];i!=undefined&&i.Callback!=null&&(i.Args!=undefined?(i.IsExecuted=!0,i.Callback(i.Args)):(i.IsExecuted=!0,i.Callback()))}}}executeCallback(n,t,u){let f=i.loadedFile_callbacks[n];if(t==undefined&&(t=f.FileType),t==undefined&&(u=!1),t===r.Html)f.FileRef!=undefined&&f.Element!=null?f.Element.load(f.FileRef,f.Callbacks[0].Callback):f.FileRef!=undefined&&$.get(f.FileRef,function(n){let t=f.Callbacks[0].Callback;t(n)});else if(t===r.Image)f.FileRef!=undefined&&f.Element!=null&&$(f.Element).attr("src",f.FileRef.replace(window.location.origin,"")+"?loaded=true");else if(u||f==undefined)this.executeCallBackForFile(n);else try{if(document.getElementsByTagName("head")[0].appendChild(f.FileRef),f.FileRef!=undefined&&f.Callbacks!=null){var e=function(){i.Instance().updateFileLoadStatus(n)};f.FileRef.onload=e}}catch(o){o}}loadFiles(n,t){if(n.length==1)return this.loadFile(n[0],t);var r=n[0],i=n.slice(1,n.length),u=this;this.loadFile(r,function(){i.length!==0&&u.loadFiles(i,t)})}addCacheFiles(n){var r,t;for((i.cached_files===null||i.cached_files===undefined)&&(i.cached_files=[]),r=0;r<n.length;r++)t=n[r],t[0]=="/"&&(t=t.substring(1)),i.cached_files.indexOf(t)===-1}loadFile(t,e){if(t!==undefined){let s=t.FileName;s=isMobileApp()?s:window._appsettings.client_url()+s;t.FileType==r.Js&&s.indexOf("wwwroot/")<-1&&(s=s.replace("wwwroot/",""));s[0]=="/"&&(s=s.substring(1),t.FileName=s);(i.cached_files===null||i.cached_files===undefined)&&(i.cached_files=[]);var o;let c=0,h=new f;if(h.Callbacks=[],i.cached_files.indexOf(s)===-1){i.cached_files.push(s);c=i.callback_index;let f=null;e!=null&&e!=undefined&&(f=new u,f.Callback=e,f.Args=t.Args,f.IsExecuted=!1,h.Callbacks.push(f));h.FileName=s;h.FileType=t.FileType;h.IsLoaded=!1;const l=t.FileType;if(l===r.Js?(o=document.createElement("script"),o.setAttribute("type","text/javascript"),o.setAttribute("src",s),h.FileRef=o):l===r.Css?(o=document.createElement("link"),o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href",s),h.FileRef=o):l===r.Image&&(s=t.Element.attributes.src.value,h.FileRef=s,h.Element=t.Element),(i.loadedFile_callbacks===null||i.loadedFile_callbacks===undefined)&&(i.loadedFile_callbacks=[]),i.loadedFile_callbacks[c]=h,i.callback_index+=1,isMobileApp())try{n.Platform.Helpers.MobileHelper.Instance().loadFileFromDevice(s,c)}catch(s){}else this.executeCallback(c,l,!1,t.Args)}else{if(c=i.loadedFile_callbacks.findIndex(n=>n.FileName==s),c>-1){let n=new u;n.Callback=e;n.Args=t.Args;n.IsExecuted=!1;i.loadedFile_callbacks[c].Callbacks.push(n)}e!==null&&this.executeCallback(c,t.FileType,!0,t.Args)}}}loadJsFiles(n,t){var u=[],i;const f={};for(i=0;i<n.length;i++)f[n[i]]==undefined&&(f[n[i]]=!0,u.push({FileName:n[i],FileType:r.Js}));return this.loadFiles(u,t)}loadJsFile(n,t){return this.loadFile({FileName:n,FileType:r.Js},t)}loadJsFileAsync(n,t){return this.loadFile({FileName:n,FileType:r.Js,Async:!0},t)}loadCssFile(n,t){return this.loadFile({FileName:n,FileType:r.Css},t)}loadCssFiles(n,t){var u=[],i;const f={};for(i=0;i<n.length;i++)f[n[i]]==undefined&&(f[n[i]]=!0,u.push({FileName:n[i],FileType:r.Css}));return this.loadFiles(u,t)}loadImage(n,t,u){if(i.cached_files.indexOf(n)>-1){let t=i.loadedFile_callbacks.findIndex(t=>t.FileName==n);t!=undefined&&t>0&&(i.loadedFile_callbacks[t].Element=u)}this.loadFile({FileName:n,FileType:r.Image,Element:u},t)}isFileRegistered(n){return i.cached_files===undefined||i.cached_files.indexOf(n)===-1?!1:!0}static Instance(){return this._instance===undefined&&(this._instance=new i),this._instance}}i.callback_index=0;t.FileCacheHelper=i})(i=t.Helpers||(t.Helpers={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
Reference in New Issue
Block a user