From ff3318409f0b97ecf97d3f7b90dc84dfbe05e62d Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 21 Jan 2017 19:30:27 +0100 Subject: [PATCH] Added a wait splash screen --- .htaccess | 7 +++ assets/css/common/page/waitSplashScreen.css | 11 ++++ assets/img/roundProgress.gif | Bin 0 -> 2608 bytes assets/js/common/functionsSchema.js | 6 +++ assets/js/common/page.js | 54 ++++++++++++++++++++ assets/js/common/url.js | 20 +++++++- assets/js/init.js | 18 +++++++ corePage/config/dev.config.php | 8 +++ index.php | 17 ++++++ 9 files changed, 140 insertions(+), 1 deletion(-) create mode 100755 .htaccess create mode 100644 assets/css/common/page/waitSplashScreen.css create mode 100755 assets/img/roundProgress.gif create mode 100644 assets/js/common/page.js diff --git a/.htaccess b/.htaccess new file mode 100755 index 00000000..3eb91039 --- /dev/null +++ b/.htaccess @@ -0,0 +1,7 @@ + +RewriteEngine On +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule . index.php [L] + diff --git a/assets/css/common/page/waitSplashScreen.css b/assets/css/common/page/waitSplashScreen.css new file mode 100644 index 00000000..47449750 --- /dev/null +++ b/assets/css/common/page/waitSplashScreen.css @@ -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; +} \ No newline at end of file diff --git a/assets/img/roundProgress.gif b/assets/img/roundProgress.gif new file mode 100755 index 0000000000000000000000000000000000000000..7b2d7616b0fef0de55159e129da0cf7a198f3f3b GIT binary patch literal 2608 zcmdVcdr(tX9tZGC9yiG~=H_)Fxq%QcD5LUNs}vvGfn1(hfgn`FM!SSdLV{HzjS8}^ zAc}z4vOE?A>nINkXkDN_Kt+gP1i{K9N+^_o5_B93K3W9SWrN+$&i=98*_rl_p1;q` zIrEv{`F>AuXprw}r8D3R`~U!Rb8|fH(5MrJ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%4xtb1+I;-7?N{wRILWDWr%M3zs|_16{5L#p(PpbYLw(*GZBI$g zt`x9V8f&Ht4?(3YvGkbl^C>s#FZS9xsn$FDaoZ>fMF_J0-;r&LB#ARGE9;LxMz(^4 zF-l8;;&-{^ScNzV^%$qj7EEwGBDM9Jnn0^Z1%`kE1+k=xf7=#LB>Q@YUJSy?+9oQT z1o&M%JDK42B%*rTwjgDU>2aiZzpF=JOzk5^;EILR&^qEHYtio$&8CBkZf)do-uLPW zIqO<=I&fQ1p1bmac&J$PU!DFe_O^%q72MI&J9SIt%S8sOE2FQPQsA-U>Xrkp>*CXF z?O#$COO!loxHd@jnoWsGNTmS_cLhN7&43E!JILnSO_M<1ijj&DCs3edvkqxU7$p@D z?gqA|#sbtN7UxR|r$S>(@Kp9?jGam#CNT^Ff71|8Xy6Vk=nOfjqz6hOgGtOD2{Q?_ z^bBc+Eu)(C_s0e_VM*PVKCMyHZt2_-(cIITbgD}dwM_20`WjG?|FGuXvek8fFJ34j zct=)%ZoaDmST{WxLicAr)xB<>$IIUIwC6F)F(ult+*%Kpl8;d9o=R?wwjl+nCh=PD a+6A3nV|!N(Ub0o(T3f}fo&O)bTmJ;ag0;B- literal 0 HcmV?d00001 diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index 6b8b1d5e..2d5b559e 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -83,6 +83,12 @@ var ComunicWeb = { }, + /** + * Page functions + */ + page: { + + }, /** * Operations on JS files diff --git a/assets/js/common/page.js b/assets/js/common/page.js new file mode 100644 index 00000000..1cf521b3 --- /dev/null +++ b/assets/js/common/page.js @@ -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); + } +}; \ No newline at end of file diff --git a/assets/js/common/url.js b/assets/js/common/url.js index afdcb9ba..b48fc2e7 100644 --- a/assets/js/common/url.js +++ b/assets/js/common/url.js @@ -2,4 +2,22 @@ * URL functions * * @author Pierre HUBERT - */ \ No newline at end of file + */ + +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; + }, +}; \ No newline at end of file diff --git a/assets/js/init.js b/assets/js/init.js index 42208310..7bc46cd0 100644 --- a/assets/js/init.js +++ b/assets/js/init.js @@ -10,11 +10,29 @@ //Start init 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 */ 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 ComunicWeb.debug.logMessage("Application is ready !"); })(); diff --git a/corePage/config/dev.config.php b/corePage/config/dev.config.php index ba715d87..99e0c29c 100644 --- a/corePage/config/dev.config.php +++ b/corePage/config/dev.config.php @@ -10,17 +10,24 @@ $config['pathAssets'] = $config['siteURL']."assets/"; //CSS files to include $config['CSSfiles'] = array( + //CSS files "%PATH_ASSETS%adminLTE/bootstrap/css/bootstrap.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/dist/css/AdminLTE.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) $config['JSfiles'] = array( + //Framewokr inclusions "%PATH_ASSETS%adminLTE/plugins/jQuery/jquery-2.2.3.min.js", "%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js", + + //App scripts "%PATH_ASSETS%js/common/functionsSchema.js", "%PATH_ASSETS%js/common/api.js", "%PATH_ASSETS%js/common/errors.js", @@ -30,6 +37,7 @@ $config['JSfiles'] = array( "%PATH_ASSETS%js/common/jsFiles.js", "%PATH_ASSETS%js/common/debug.js", "%PATH_ASSETS%js/langs/en.inc.js", + "%PATH_ASSETS%js/common/page.js", //Init script "%PATH_ASSETS%js/init.js", diff --git a/index.php b/index.php index 4e54114d..4472fe76 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,17 @@ ", $_SERVER["REDIRECT_URL"])){ + //This is a 404 not found error... + echo "

Error! 404 not found

"; + http_response_code(404); + exit(); + } + } ?>