mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Created a restart function
This commit is contained in:
		@@ -27,4 +27,12 @@
 | 
				
			|||||||
    text-align: center;
 | 
					    text-align: center;
 | 
				
			||||||
    opacity: 0.5;
 | 
					    opacity: 0.5;
 | 
				
			||||||
    padding-top: 30%;
 | 
					    padding-top: 30%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Wait message
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					.waitSplashScreen .text {
 | 
				
			||||||
 | 
					    padding: 50px;
 | 
				
			||||||
 | 
					    font-size: 200%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -113,8 +113,10 @@ var ComunicWeb = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            /**
 | 
					            /**
 | 
				
			||||||
             * Show a full wait splash screen
 | 
					             * Show a full wait splash screen
 | 
				
			||||||
 | 
					             * 
 | 
				
			||||||
 | 
					             * @param {String} message A message to explain the reason of the splash screen (optionnal)
 | 
				
			||||||
             */
 | 
					             */
 | 
				
			||||||
            showWaitSplashScreen: function(){},
 | 
					            showWaitSplashScreen: function(message){},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /**
 | 
					            /**
 | 
				
			||||||
             * Show a transparent wait splash screen
 | 
					             * Show a transparent wait splash screen
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,14 +39,23 @@ ComunicWeb.common.page = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Show a full wait splash screen
 | 
					     * Show a full wait splash screen
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     * @param {String} message A message to explain the reason of the splash screen (optionnal)
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    showWaitSplashScreen: function(){
 | 
					    showWaitSplashScreen: function(message){
 | 
				
			||||||
        //First, empty the screen
 | 
					        //First, empty the screen
 | 
				
			||||||
        this.emptyPage();
 | 
					        this.emptyPage();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Log message
 | 
					        //Log message
 | 
				
			||||||
        ComunicWeb.debug.logMessage("Display a wait splash screen the screen.");
 | 
					        ComunicWeb.debug.logMessage("Display a wait splash screen the screen.");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Create message element (if required)
 | 
				
			||||||
 | 
					        if(message){
 | 
				
			||||||
 | 
					            var messageElem = createElem("div", document.body);
 | 
				
			||||||
 | 
					            messageElem.className = "text";
 | 
				
			||||||
 | 
					            messageElem.innerHTML = message;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Create image element
 | 
					        //Create image element
 | 
				
			||||||
        var imgElem = document.createElement("img");
 | 
					        var imgElem = document.createElement("img");
 | 
				
			||||||
        imgElem.src = ComunicWeb.__config.assetsURL+"img/roundProgress.gif";
 | 
					        imgElem.src = ComunicWeb.__config.assetsURL+"img/roundProgress.gif";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,4 +54,17 @@ ComunicWeb.common.system = {
 | 
				
			|||||||
		//Sucess
 | 
							//Sucess
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Restart the application
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 * @return {Boolean} True for a success
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						restart: function(){
 | 
				
			||||||
 | 
							//Show a wait splashscreen message
 | 
				
			||||||
 | 
							ComunicWeb.common.page.showWaitSplashScreen("Restarting...");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Reload the page
 | 
				
			||||||
 | 
							location.href = document.location;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
		Reference in New Issue
	
	Block a user