mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Created a restart function
This commit is contained in:
parent
42cd5dcd1c
commit
bf372d5322
@ -27,4 +27,12 @@
|
||||
text-align: center;
|
||||
opacity: 0.5;
|
||||
padding-top: 30%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait message
|
||||
*/
|
||||
.waitSplashScreen .text {
|
||||
padding: 50px;
|
||||
font-size: 200%;
|
||||
}
|
@ -113,8 +113,10 @@ var ComunicWeb = {
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -39,14 +39,23 @@ ComunicWeb.common.page = {
|
||||
|
||||
/**
|
||||
* 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
|
||||
this.emptyPage();
|
||||
|
||||
//Log message
|
||||
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
|
||||
var imgElem = document.createElement("img");
|
||||
imgElem.src = ComunicWeb.__config.assetsURL+"img/roundProgress.gif";
|
||||
|
@ -54,4 +54,17 @@ ComunicWeb.common.system = {
|
||||
//Sucess
|
||||
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;
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user