ComunicWeb/assets/js/common/functionsSchema.js

495 lines
7.8 KiB
JavaScript
Raw Normal View History

/**
* Comunic WebApp schema
*
* @author Pierre HUBERT
*/
/**
* ComunicWeb main object
*/
var ComunicWeb = {
2017-05-22 16:06:17 +00:00
/**
* Configuration inclusion
*/
__config: ComunicConfig,
/**
* List of available pages
*/
pagesList:{},
2017-05-22 16:06:17 +00:00
/**
* Common functions
*/
common:{
/**
* Application system functions
*/
system:{
2017-05-25 13:46:38 +00:00
/**
* Initializate the application
*/
init: function(){},
/**
* Restart the application
*/
restart: function(){},
2017-05-22 16:06:17 +00:00
},
/**
* API functions
*/
api: {
/**
* Make an API request
*/
makeAPIrequest: function(apiURI, params, requireLoginTokens, nextAction){},
},
/**
* Langs functions
*/
langs: {
/**
* Return current language
*/
getCurrentLanguage: function(){},
/**
* Include and install specified language
*/
installLanguage: function(languageID){},
/**
* Initializate languages
*/
initLanguages: function(){},
/**
* Return a string in correct language
*/
getTranslatedText: function(stringName, stringParams){},
},
/**
* Messages functions
*/
messages: {
/**
* Create and return a callout element
*/
createCalloutElem: function(calloutTitle, calloutMessage, calloutType){},
},
/**
* Error functions
*/
error:{
/**
* Submit an error
*/
submitError: function(errorLevel, errorMessage, errorCode, errorData){},
/**
* Handle and show a fatal error
*/
fatalError: function(errorMessage, errorCode, errorData){},
/**
* Handle a 404 not found error
*/
pageNotFound: function(additionnalData, targetElement){},
},
/**
* URL functions
*/
url:{
/**
* Return current URL opened on the website
*/
getCurrentWebsiteURL: function(){},
/**
* Change the current website URI
*/
changeURI: function(newTitle, newURI){},
},
/**
* Page functions
*/
page: {
/**
* Empty current page
*/
emptyPage: function(createWrapper){},
/**
* Show a full wait splash screen
*
* @param {String} message A message to explain the reason of the splash screen (optionnal)
*/
showWaitSplashScreen: function(message){},
/**
* Show a transparent wait splash screen
*/
showTransparentWaitSplashScreen: function(){},
/**
* Open a page
*/
openPage: function(pageURI, additionnalData){},
/**
* Prepare a template load by specifying datas
*/
prepareLoadTemplate: function(){},
/**
* Load, parse and show an HTML template
*/
getAndShowTemplate: function(targetElem, dataTemplate, templateURI, nextAction, cleanContener){},
/**
* Convert a JSON object into html elements
*/
convertJSONobjectTOhtmlElement: function(parentNodeChilds, values){},
/**
* Get and show a JSON template
*/
getAndShowJSONtemplate: function(targetElem, templateURI, additionalData, afterParsingJSONtemplate, cleanContener){},
},
/**
* Functions to check data input in forms
*/
formChecker: {
2017-05-25 13:46:38 +00:00
/**
* Check an input
*/
checkInput: function(input, inFormGroup){},
2017-05-22 16:06:17 +00:00
},
/**
* Notification system
*/
notificationSystem: {
/**
* Display a notification
*/
showNotification: function(message, notifType, notifDuration, notifTitle){},
},
/**
* Network common requests
*/
network: {
/**
* @var {object} Cache contener
*/
cache: {},
/**
* Make a get request
*/
getRequest: function(url, cache, GETnextAction){},
},
/**
* Operations on JS files
*/
jsFiles:{
/**
* Include a Javascript file
*/
includeFile: function(fileURL){},
/**
* Execute some source code contained in a variable
*/
executeJSsource: function(source){},
},
},
/**
* Debug functions
*/
debug:{
/**
* @var {Object} Internal log variable
*/
__log: {},
/**
* Display message on browser console
*/
logMessage: function(message){},
/**
* Save a new log message
*/
saveLogMessage: function(message){},
/**
* Get log content in a string
*/
getLogContent: function(){},
},
/**
* User functions
*/
user:{
/**
* Login tokens storage controller
*/
loginTokens: {
/**
* Set User tokens
*/
setUserTokens: function(tokens, storageType){},
/**
* Check if there is any login tokens available
*/
checkLoginTokens: function(){},
/**
* Get login tokens
*/
getLoginTokens: function(){},
/**
* Perform user logout
*/
deleteLoginTokens: function(){},
},
/**
* Manage user login
*/
userLogin: {
/**
* @var {Boolean} Store user login state (true by default)
*/
__userLogin: true,
/**
* @var {Integer} Store the current user ID
*/
__userID: 0,
/**
* Tell if user is logged in or not
*/
getUserLoginState: function(){},
/**
* Get user ID (if logged in)
*/
getUserID: function(){},
/**
* Try to get and store current user ID
*/
getCurrentUserId: function(afterGetCurrentUserID){},
/**
* Refresh the user login state
*/
refreshLoginState: function(afterLogin){},
/**
* Try to login user
*/
loginUser: function(usermail, userpassword, permanentLogin, afterLogin){},
/**
* Logout user
*/
logoutUser: function(afterLogout){},
},
/**
* Get user infos
*/
userInfos: {
2017-05-25 13:46:38 +00:00
/**
* @var {String} User infos cache
*/
usersInfos: {},
/**
* Get user informations
*/
getUserInfos: function(userID, afterGetUserInfos){},
/**
* Empty user informations cache
* Remove all entries from user informations cache
*/
2017-05-25 13:53:41 +00:00
emptyUserInfosCache: function(){},
2017-05-22 16:06:17 +00:00
},
},
/**
* Application components
*/
components: {
/**
* Menubar
*/
menuBar: {
/**
* Menu bar object - common methods
*/
common:{
2017-05-25 13:53:41 +00:00
/**
* Display menu bar
*/
display: function(){},
/**
* Initializate a menubar
*/
init: function(menuContainer){},
/**
* Reset a specified menubar
*/
reset: function(menuBar){},
},
/**
* Not authenticated menu bar components
*/
notAuthenticated: {
2017-05-25 13:53:41 +00:00
/**
* Add not-authenticated user specific elements
*/
addElements: function(container){},
},
/**
* Menubar for authenticated users complements
*/
authenticated:{
2017-05-25 13:53:41 +00:00
/**
* Add authenticated user specific elements
*/
addElements: function(container){},
/**
* Add dropdown menu
*/
addDropdown: function(navbarElem){},
/**
* Add user name element
*/
addUserName: function(navbarElem){},
},
2017-05-22 16:06:17 +00:00
},
2017-05-24 14:37:41 +00:00
/**
* Mails caching component
*/
mailCaching: {
2017-05-25 13:53:41 +00:00
/**
* @var Mail caching variable name
*/
__mailCachingVarName: "lastLoginMail",
/**
* Get current cached value
*/
get: function(){},
/**
* Set a new mail value
*/
set: function(mail){},
2017-05-24 14:37:41 +00:00
}
2017-05-22 16:06:17 +00:00
},
/**
* Pages controllers
*/
pages:{
/**
* Home page
*/
home: {
/**
* Common homes functions
*/
home:{
/**
* Open home page
*/
openHomePage: function(additionnalData, targetElement){},
},
2017-05-22 16:12:50 +00:00
/**
* Landing home page
*/
landingPage:{
2017-05-25 13:53:41 +00:00
/**
* Display home landing page
*/
display: function(targetElement){},
2017-05-22 16:12:50 +00:00
}
2017-05-22 16:06:17 +00:00
},
/**
* Login controller
*/
login:{
/**
* Open login page
*/
openLoginPage: function(additionnalData, targetElement){},
/**
* Perform user login
*/
loginSubmit: function(){},
/**
* Display login error message
*
* @return {Boolean} True for a success
*/
displayLoginError: function(){},
2017-05-22 16:06:17 +00:00
},
/**
* Logout controller
*/
logout: {
/**
* Open logout page and perform logout
*/
openLogoutPage: function(additionnalData, targetElement){},
},
},
};