ComunicWeb/assets/js/init.js

59 lines
1.3 KiB
JavaScript
Raw Normal View History

/**
* 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();
/**
* Language initator
*/
ComunicWeb.common.langs.initLanguages();
2017-01-21 18:30:27 +00:00
/**
* What to do after login refresh
2017-01-21 18:30:27 +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
/**
* Get login state
*/
ComunicWeb.user.userLogin.refreshLoginState(afterLoginRefresh);
2017-01-21 18:30:27 +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);
}