mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Created system object
This commit is contained in:
		@@ -14,6 +14,13 @@ var ComunicWeb = {
 | 
			
		||||
     * Common functions
 | 
			
		||||
     */
 | 
			
		||||
    common:{
 | 
			
		||||
        /**
 | 
			
		||||
         * Application system functions
 | 
			
		||||
         */
 | 
			
		||||
        system:{
 | 
			
		||||
            //TODO: implement
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * API functions
 | 
			
		||||
         */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										57
									
								
								assets/js/common/system.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								assets/js/common/system.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,57 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Application background system functions
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.common.system = {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializate the application
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return {Boolean} True for a success
 | 
			
		||||
	 */
 | 
			
		||||
	init: function(){
 | 
			
		||||
		//Start init
 | 
			
		||||
		ComunicWeb.debug.logMessage("Start initialization...");
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * Prepare login
 | 
			
		||||
		 */
 | 
			
		||||
		//Clean current page content
 | 
			
		||||
		ComunicWeb.common.page.emptyPage();
 | 
			
		||||
		
 | 
			
		||||
		//Show a wait splash screen
 | 
			
		||||
		ComunicWeb.common.page.showWaitSplashScreen();
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * Language initator
 | 
			
		||||
		 */
 | 
			
		||||
		ComunicWeb.common.langs.initLanguages();
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * What to do after login refresh
 | 
			
		||||
		 */
 | 
			
		||||
		var afterLoginRefresh = function(){
 | 
			
		||||
			
 | 
			
		||||
			/**
 | 
			
		||||
			 * Open a page
 | 
			
		||||
			 */
 | 
			
		||||
			//Get current page URI
 | 
			
		||||
			var currentPage = ComunicWeb.common.url.getCurrentWebsiteURL();
 | 
			
		||||
 | 
			
		||||
			//Open a page
 | 
			
		||||
			ComunicWeb.common.page.openPage(currentPage);
 | 
			
		||||
 | 
			
		||||
			//End of init
 | 
			
		||||
			ComunicWeb.debug.logMessage("Application is ready !");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * Get login state
 | 
			
		||||
		 */
 | 
			
		||||
		ComunicWeb.user.userLogin.refreshLoginState(afterLoginRefresh);
 | 
			
		||||
 | 
			
		||||
		//Sucess
 | 
			
		||||
		return true;
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
@@ -29,4 +29,16 @@ function createElem(nodeType, appendTo){
 | 
			
		||||
 */
 | 
			
		||||
function byId(nodeName){
 | 
			
		||||
	return document.getElementById(nodeName);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Create a quick language access function shorcut
 | 
			
		||||
 */
 | 
			
		||||
function lang(stringName, stringParams){
 | 
			
		||||
    //Check if any params has been specified
 | 
			
		||||
    if(!stringParams)
 | 
			
		||||
        var stringParams = [];
 | 
			
		||||
 | 
			
		||||
    //Call translate function
 | 
			
		||||
    return ComunicWeb.common.langs.getTranslatedText(stringName, stringParams);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user