Added a wait splash screen

This commit is contained in:
Pierre 2017-01-21 19:30:27 +01:00
parent 2352a47ab8
commit ff3318409f
9 changed files with 140 additions and 1 deletions

7
.htaccess Executable file
View File

@ -0,0 +1,7 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

View File

@ -0,0 +1,11 @@
/**
* Wait splash screen style sheet
*
* @author Pierre HUBERT
*/
.waitSplashScreen {
background-color: rgba(128, 128, 128, 0.06);
padding-top: 10%;
text-align: center;
}

BIN
assets/img/roundProgress.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -83,6 +83,12 @@ var ComunicWeb = {
}, },
/**
* Page functions
*/
page: {
},
/** /**
* Operations on JS files * Operations on JS files

54
assets/js/common/page.js Normal file
View 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);
}
};

View File

@ -3,3 +3,21 @@
* *
* @author Pierre HUBERT * @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;
},
};

View File

@ -10,11 +10,29 @@
//Start init //Start init
ComunicWeb.debug.logMessage("Start initialization..."); ComunicWeb.debug.logMessage("Start initialization...");
/**
* Prepare login
*/
//Clean current page content
ComunicWeb.common.page.emptyPage();
//Show a wait splash screen
ComunicWeb.common.page.showWaitSplashScreen();
/** /**
* Language initator * Language initator
*/ */
ComunicWeb.common.langs.initLanguages(); ComunicWeb.common.langs.initLanguages();
/**
* Open a page
*/
//Get current page URI
var currentPage = ComunicWeb.common.url.getCurrentWebsiteURL();
//Open a page
ComunicWeb.common.page.openPage(currentPage);
//End of init //End of init
ComunicWeb.debug.logMessage("Application is ready !"); ComunicWeb.debug.logMessage("Application is ready !");
})(); })();

View File

@ -10,17 +10,24 @@ $config['pathAssets'] = $config['siteURL']."assets/";
//CSS files to include //CSS files to include
$config['CSSfiles'] = array( $config['CSSfiles'] = array(
//CSS files
"%PATH_ASSETS%adminLTE/bootstrap/css/bootstrap.min.css", "%PATH_ASSETS%adminLTE/bootstrap/css/bootstrap.min.css",
"%PATH_ASSETS%adminLTE/plugins/font-awesome/css/font-awesome.min.css", "%PATH_ASSETS%adminLTE/plugins/font-awesome/css/font-awesome.min.css",
"%PATH_ASSETS%adminLTE/plugins/ionicons/css/ionicons.min.css", "%PATH_ASSETS%adminLTE/plugins/ionicons/css/ionicons.min.css",
"%PATH_ASSETS%adminLTE/dist/css/AdminLTE.min.css", "%PATH_ASSETS%adminLTE/dist/css/AdminLTE.min.css",
"%PATH_ASSETS%adminLTE/dist/css/skins/_all-skins.min.css", "%PATH_ASSETS%adminLTE/dist/css/skins/_all-skins.min.css",
//App stylesheets
"%PATH_ASSETS%css/common/page/waitSplashScreen.css",
); );
//JS files to include (at the end of the page) //JS files to include (at the end of the page)
$config['JSfiles'] = array( $config['JSfiles'] = array(
//Framewokr inclusions
"%PATH_ASSETS%adminLTE/plugins/jQuery/jquery-2.2.3.min.js", "%PATH_ASSETS%adminLTE/plugins/jQuery/jquery-2.2.3.min.js",
"%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js", "%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js",
//App scripts
"%PATH_ASSETS%js/common/functionsSchema.js", "%PATH_ASSETS%js/common/functionsSchema.js",
"%PATH_ASSETS%js/common/api.js", "%PATH_ASSETS%js/common/api.js",
"%PATH_ASSETS%js/common/errors.js", "%PATH_ASSETS%js/common/errors.js",
@ -30,6 +37,7 @@ $config['JSfiles'] = array(
"%PATH_ASSETS%js/common/jsFiles.js", "%PATH_ASSETS%js/common/jsFiles.js",
"%PATH_ASSETS%js/common/debug.js", "%PATH_ASSETS%js/common/debug.js",
"%PATH_ASSETS%js/langs/en.inc.js", "%PATH_ASSETS%js/langs/en.inc.js",
"%PATH_ASSETS%js/common/page.js",
//Init script //Init script
"%PATH_ASSETS%js/init.js", "%PATH_ASSETS%js/init.js",

View File

@ -1,6 +1,17 @@
<?php <?php
//Include page initiator //Include page initiator
include("corePage/initPage.php"); include("corePage/initPage.php");
//We check if it is a redirection
if(isset($_SERVER["REDIRECT_URL"])){
//We check if it is an asset request
if(preg_match("<assets>", $_SERVER["REDIRECT_URL"])){
//This is a 404 not found error...
echo "<p>Error! 404 not found</p>";
http_response_code(404);
exit();
}
}
?> ?>
<!-- <!--
Comunic web app client Comunic web app client
@ -30,6 +41,12 @@
//Production mode //Production mode
productionMode: <?php echo config['productionMode']; ?>, productionMode: <?php echo config['productionMode']; ?>,
//Assets URL
assetsURL: "<?php echo config['pathAssets']; ?>",
//Site URL
siteURL: "<?php echo config['siteURL']; ?>",
//apiURL //apiURL
apiURL: "<?php echo config['API_URL']; ?>", apiURL: "<?php echo config['API_URL']; ?>",