');}catch(ignoredJsonError){}}else{refreshTimer=window.setTimeout(refreshCode2,3000);}Container.find('.ReloadBtn').on('click',refreshCode2);FullScreenElementOnTop(Container,wipeDom);if(typeof window.Framework==='object'&&window.Framework!==null){window.Framework.teapot=true;}stopFrameworkActivity();return;case 0:title='Connection Lost';if(errorText===''||errorText==='error'||errorText==='abort'){errorText='The server could not be reached. Check your internet '+'connection and try again.';}message='
',extraButtons:''});Container.css({background:'blue',color:'white',textAlign:'center'});Container.find('.ReloadBtn').on('click',refreshCode2);FullScreenElementOnTop(Container,wipeDom);stopFrameworkActivity();return;}if(status===500){return window.__handleConnectionError(e,500,errorText,true,wipeDom,fromApp);}stopFrameworkActivity();};if(typeof(window.CachedControls)!=='object')window.CachedControls={};if(typeof(window.Framework.Methods)==='undefined')window.Framework.Methods={};window.Framework.Methods.LogDataSize=function(connection,data){var size=(connection.getResponseHeader('Content-Length'));if(size===null){try{size=((encodeURI(data).split(/%..|./).length-1)/1024);}catch(e){size=0;}}else{size=(size/1024);}window.DataSize+=size;var d=document.getElementById('TotalDataUsage');if(d===null)return;if(window.DataSize<=1024){d=document.getElementById('TotalDataUsage');if(d===null)throw new Error('No stylesheet?');d.innerHTML=StaticLib.Math.Round(window.DataSize,4);d=document.getElementById('TotalDataUsage');if(d===null)throw new Error('No stylesheet?');d.innerHTML=StaticLib.Math.Round(window.DataSize,4);}else{d=document.getElementById('DataMeasure');if(d===null)throw new Error('No stylesheet?');d.innerHTML='MB';d=document.getElementById('TotalDataUsage');if(d===null)throw new Error('No stylesheet?');d.innerHTML=StaticLib.Math.Round((window.DataSize/1024),4);}};StaticLib.DeepSeal(window.Framework.Methods.LogDataSize);StaticLib.DeepFreeze(window.Framework.Methods.LogDataSize);var DependencyLoader=function(dependencies,RunWhenDone,showLoading,loadAsControls){var __ShowLoading=false;var __ShowSubLoading=false;var __LoadAsControls=false;var __LoadedArray={};var _WhenDone=function(){};var _WhenPriorityDone=function(){};var __LowerPriorityURLS='';var _Ctor=jQuery.proxy(function(dependencies,RunWhenDone,showLoading,loadAsControls){window.FilesLoadedList=[];window.LoadedDependencyKeyList=[];if(typeof(RunWhenDone)!=='function')throw new Error('DependencyLoader: Argument 2 (RunWhenDone) must be a function');if(showLoading===true)__ShowLoading=true;if(loadAsControls===true)__LoadAsControls=true;_WhenDone=RunWhenDone;_WhenPriorityDone=RunWhenDone;var type=typeof(dependencies);var isString=(type==='string');var isNumeric=(type==='number');var isArray=StaticLib.IsArray(dependencies);if((dependencies===null)||((!isString)&&(!isNumeric)&&(!isArray)))throw new Error('DependencyLoader: Argument 1 (dependencies) must be a Dependency Key, or a list or URLs');if((isString===true)||(isNumeric===true)){_LoadByKey(dependencies);if((typeof(window.LoadingScreenTaskTypes)!=='undefined')&&(typeof(window.LoadingScreenTaskTypes.api)!=='undefined')){if(__ShowLoading===false)return;var task={Type:window.LoadingScreenTaskTypes.api,TaskID:'dependencies',TaskDescription:'Loading Dependencies',Priority:0};if((window.DependencyLoadingScreen===null)||(typeof(window.DependencyLoadingScreen)==='undefined')){window.DependencyLoadingScreen=new LoadingScreen({TaskList:[task]});}else{window.DependencyLoadingScreen.AddTask(task);}}}else{if((dependencies===null)||(typeof(dependencies)==='undefined')||(typeof(dependencies.length)!=='number')||(dependencies.length===0))throw new Error('Dependency loader expects an array of URLs, or a dependency key (string or number)');if(typeof(dependencies[0].priority)!=='undefined')dependencies=_RecursiveArray(dependencies);_LoadByURLs(dependencies);}},this);var _LoadByKey=jQuery.proxy(function(key){if((window.LoadedDependencyKeyList.indexOf(key))===-1){window.LoadedDependencyKeyList.push(key);var postData={'key':key};var stylesheet=document.getElementById('currentStyleSheet');if(stylesheet!==null){var themeName=stylesheet.href;if(themeName!==''){var removeBefore='themes/';var index=themeName.indexOf(removeBefore);if(index!==-1){themeName=themeName.substring((index+removeBefore.length));}var removeAfter='/';index=themeName.indexOf(removeAfter);if(index!==-1){themeName=themeName.substring(0,index);}postData.theme=themeName;}}var api=new window.Framework.Methods.GetAPI('system','GetDependancyFiles',this,_Callback_ProcessDependencies,postData);api.servletGroup='platform';api.showLoading=false;api.invoke();}else{_DoneLoading();}},this);var _LoadByURLs=jQuery.proxy(function(urlList,tries){if((typeof(urlList)==='undefined')||(urlList===null)||(urlList.length===0))return _DoneLoading();if(typeof(tries)==='undefined')tries=0;var extension='';var url='';var callback=null;var AlreadyLoaded=jQuery('script[fromurl], style[fromurl]');var length=AlreadyLoaded.length;var tag;var i;for(i=0;i0){if(url.indexOf('.php?type=')===-1){var res=url.split('?');extension=res[0].slice(-3);}}if(extension==='')extension=url.slice(-3);if(extension==='css'){callback=__Callback_ReceiveCSS;}else if(extension==='.js'){callback=_Callback_ReceiveJS;if(__LoadAsControls){callback=_Callback_ReceiveControl;if(window.Framework.GlobalControls.indexOf(url)!==-1)callback=_Callback_ReceiveJS;}}else{callback=_Callback_ReceiveJS;if(__LoadAsControls){callback=_Callback_ReceiveControl;if(window.Framework.GlobalControls.indexOf(url)!==-1)callback=_Callback_ReceiveJS;}}extension='';jQuery.ajax({'url':url,'method':'GET','dataType':'text','error':_Callback_TryAgain,'success':callback}).ActionObj={URL:url,OriginalContext:this,NumberOfTries:(tries+1)};}else{if(StaticLib.IsArray(url)){__LowerPriorityURLS=url;_WhenDone=jQuery.proxy(loadDep,this);}if(__ShowLoading===true){__ShowLoading=false;__ShowSubLoading=true;}}}var filesToCheck=Object.keys(__LoadedArray);length=filesToCheck.length;var urlToCheck='';for(i=0;idata[i].priority)priority=data[i].priority;}var primaryArray=[];var secondaryArray=[];for(i=0;idata[j].priority)priority=data[j].priority;continue;}if(__ShowLoading===true){var task={Type:window.LoadingScreenTaskTypes.api,TaskID:data[i].file,TaskDescription:'Loading Files...',Priority:(10-data[i].priority)};if(typeof(data[i].message)!=='undefined')task.TaskDescription=data[i].message;if((window.DependencyLoadingScreen===null)||(typeof(window.DependencyLoadingScreen)==='undefined')){window.DependencyLoadingScreen=new LoadingScreen({TaskList:[task]});}else{window.DependencyLoadingScreen.AddTask(task);}}if(priority===data[i].priority){primaryArray.push(data[i].file);}else{if((typeof(data[i].file)!=='undefined')&&(!StaticLib.Empty(data[i].file)))secondaryArray.push(data[i]);}}if(secondaryArray.length>0){var sortedSecondaryArray=_RecursiveArray(secondaryArray);primaryArray.push(sortedSecondaryArray);}return primaryArray;},this);var __Callback_ReceiveCSS=jQuery.proxy(function(data,status,connection){var ct=connection.getResponseHeader('content-type')||'';if(ct.indexOf('text/css')===-1)throw new Error('Invalid data received');window.Framework.Methods.LogDataSize(connection,data);if(connection.status!==200)window.__handleConnectionError(connection,connection.status,connection.statusText,false);var depLoad=connection.ActionObj.OriginalContext;if((depLoad===null)||(typeof(connection.ActionObj.URL)!=='string')||(connection.ActionObj.URL.length===0))return;var newStyle=document.createElement('STYLE');newStyle.innerHTML=data;newStyle.setAttribute('fromurl',connection.ActionObj.URL);document.head.appendChild(newStyle);__LoadedArray[connection.ActionObj.URL]=true;if(((window.DependencyLoadingScreen!==null)||(typeof(window.DependencyLoadingScreen)!=='undefined'))&&(window.DependencyLoadingScreen.HasTask(connection.ActionObj.URL)))window.DependencyLoadingScreen.CompleteTask(connection.ActionObj.URL);var filesToCheck=Object.keys(__LoadedArray);var length=filesToCheck.length;var urlToCheck=null;for(var i=0;i-1)||(ct.indexOf('text/javascript')>-1)){}else if(ct.indexOf('html')>-1){if(StaticLib.IsJSONString(data)){if((typeof(window.Framework)!=='undefined')&&(typeof(window.Framework.prop)!=='undefined')&&(window.Framework.prop.developer))window.Framework.UI.MsgBox({title:'_Callback_ReceiveControl Error',message:'Data returned is not HTML but instead JSON, please specify your content-type header before returning your data',modal:false,width:400,height:300});data=JSON.parse(data);}}else if(ct.indexOf('json')>-1){if(StaticLib.IsJSONString(data)===false)throw new Error('Not a valid JSON string');data=JSON.parse(data);}else{throw new Error('Unknown content type');}var depLoad=connection.ActionObj.OriginalContext;if((depLoad===null)||(typeof(connection.ActionObj.URL)!=='string')||(connection.ActionObj.URL.length===0))return;if(((window.DependencyLoadingScreen!==null)||(typeof(window.DependencyLoadingScreen)!=='undefined'))&&(window.DependencyLoadingScreen.HasTask(connection.ActionObj.URL)))window.DependencyLoadingScreen.CompleteTask(connection.ActionObj.URL);var filename=connection.ActionObj.URL;if(filename.indexOf('?')!==-1)filename=filename.substr(0,filename.indexOf('?'));window.CachedControls[filename]=data;__LoadedArray[connection.ActionObj.URL]=true;var filesToCheck=Object.keys(__LoadedArray);var length=filesToCheck.length;var urlToCheck='';for(var i=0;i-1){}else if(ct.indexOf('html')>-1){if(StaticLib.IsJSONString(data)){data=JSON.parse(data);}}else if(ct.indexOf('json')>-1){if(StaticLib.IsJSONString(data)===false)throw new Error('Not a valid JSON string');data=JSON.parse(data);}else{throw new Error('Unknown content type');}var depLoad=connection.ActionObj.OriginalContext;if((depLoad===null)||(typeof(connection.ActionObj.URL)!=='string')||(connection.ActionObj.URL.length===0))return;if(((window.DependencyLoadingScreen!==null)||(typeof(window.DependencyLoadingScreen)!=='undefined'))&&(window.DependencyLoadingScreen.HasTask(connection.ActionObj.URL)))window.DependencyLoadingScreen.CompleteTask(connection.ActionObj.URL);var newStyle=document.createElement('SCRIPT');try{jQuery.proxy(eval,window)(data);}catch(e){return window.__handleConnectionError(null,500,'Could not compile the framework, please quote the following code: '+connection.ActionObj.URL+': '+e.message,true);}newStyle.setAttribute('fromurl',connection.ActionObj.URL);document.head.appendChild(newStyle);__LoadedArray[connection.ActionObj.URL]=true;var filesToCheck=Object.keys(__LoadedArray);var length=filesToCheck.length;var urlToCheck='';for(var i=0;i