mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Added a wait splash screen
This commit is contained in:
@ -83,6 +83,12 @@ var ComunicWeb = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Page functions
|
||||
*/
|
||||
page: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Operations on JS files
|
||||
|
54
assets/js/common/page.js
Normal file
54
assets/js/common/page.js
Normal file
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Page functions
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.common.page = {
|
||||
/**
|
||||
* Empty current page content
|
||||
*/
|
||||
emptyPage: function(){
|
||||
//Empty body tag
|
||||
document.body.innerHTML = "";
|
||||
|
||||
//Remove body speicific tags
|
||||
document.body.className = "";
|
||||
document.body.id = "";
|
||||
document.body.onclick = "";
|
||||
|
||||
//Log message
|
||||
ComunicWeb.debug.logMessage("Clean the screen.");
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Show a full wait splash screen
|
||||
*/
|
||||
showWaitSplashScreen: function(){
|
||||
//First, empty the screen
|
||||
this.emptyPage();
|
||||
|
||||
//Log message
|
||||
ComunicWeb.debug.logMessage("Display a wait splash screen the screen.");
|
||||
|
||||
//Create image element
|
||||
var imgElem = document.createElement("img");
|
||||
imgElem.src = ComunicWeb.__config.assetsURL+"img/roundProgress.gif";
|
||||
document.body.appendChild(imgElem);
|
||||
|
||||
//Change body className
|
||||
document.body.className = "waitSplashScreen";
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Open a page
|
||||
*
|
||||
* @param {String} pageURI The URI to the page
|
||||
*/
|
||||
openPage: function(pageURI){
|
||||
//Log message
|
||||
ComunicWeb.debug.logMessage("Open the following page: " + pageURI);
|
||||
}
|
||||
};
|
@ -2,4 +2,22 @@
|
||||
* URL functions
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
*/
|
||||
|
||||
ComunicWeb.common.url = {
|
||||
/**
|
||||
* Return current URL opened on the website
|
||||
*
|
||||
* @return {String} The URL opened on the website
|
||||
*/
|
||||
getCurrentWebsiteURL: function(){
|
||||
//Retrieve website URL
|
||||
var websiteURL = location.href;
|
||||
|
||||
//Extract the URI part for the app
|
||||
var uripage = websiteURL.replace(ComunicWeb.__config.siteURL, "");
|
||||
|
||||
//Return result
|
||||
return uripage;
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user