2017-01-08 14:54:25 +00:00
|
|
|
/**
|
|
|
|
* Comunic WebApp init script
|
|
|
|
*
|
|
|
|
* @author Pierre HUBERT
|
|
|
|
*/
|
|
|
|
|
|
|
|
//Anonymous function
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
//Start init
|
|
|
|
ComunicWeb.debug.logMessage("Start initialization...");
|
|
|
|
|
2017-01-21 18:30:27 +00:00
|
|
|
/**
|
|
|
|
* Prepare login
|
|
|
|
*/
|
|
|
|
//Clean current page content
|
|
|
|
ComunicWeb.common.page.emptyPage();
|
|
|
|
|
|
|
|
//Show a wait splash screen
|
|
|
|
ComunicWeb.common.page.showWaitSplashScreen();
|
|
|
|
|
2017-01-08 14:54:25 +00:00
|
|
|
/**
|
|
|
|
* Language initator
|
|
|
|
*/
|
|
|
|
ComunicWeb.common.langs.initLanguages();
|
|
|
|
|
2017-01-21 18:30:27 +00:00
|
|
|
/**
|
2017-02-18 17:26:30 +00:00
|
|
|
* What to do after login refresh
|
2017-01-21 18:30:27 +00:00
|
|
|
*/
|
2017-02-18 17:26:30 +00:00
|
|
|
var afterLoginRefresh = function(){
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Open a page
|
|
|
|
*/
|
|
|
|
//Get current page URI
|
|
|
|
var currentPage = ComunicWeb.common.url.getCurrentWebsiteURL();
|
|
|
|
|
|
|
|
//Open a page
|
|
|
|
ComunicWeb.common.page.openPage(currentPage);
|
|
|
|
}
|
2017-01-21 18:30:27 +00:00
|
|
|
|
2017-02-18 17:26:30 +00:00
|
|
|
/**
|
|
|
|
* Get login state
|
|
|
|
*/
|
|
|
|
ComunicWeb.user.userLogin.refreshLoginState(afterLoginRefresh);
|
2017-01-21 18:30:27 +00:00
|
|
|
|
2017-01-08 14:54:25 +00:00
|
|
|
//End of init
|
|
|
|
ComunicWeb.debug.logMessage("Application is ready !");
|
|
|
|
})();
|
|
|
|
|
|
|
|
//Create a quick language access function shorcut
|
|
|
|
function lang(stringName, stringParams){
|
|
|
|
//Check if any params has been specified
|
|
|
|
if(!stringParams)
|
|
|
|
var stringParams = [];
|
|
|
|
|
|
|
|
//Call function
|
|
|
|
return ComunicWeb.common.langs.getTranslatedText(stringName, stringParams);
|
|
|
|
}
|