diff --git a/public_html/index.php b/public_html/index.php index f184767..4c138f6 100755 --- a/public_html/index.php +++ b/public_html/index.php @@ -92,7 +92,7 @@ // nomPage/arg1/arg2 -> inclusion de la page $R->get('(.*)', function($m){ // Liste des pages du site - $page_list = [ 'history', 'profile', 'machines', 'users', 'groups', 'analytics', 'settings' ]; + $page_list = [ 'history', 'profile', 'machines', 'users', 'groups', 'extensions', 'settings' ]; if( !preg_match('#^(?:'.implode('|', $page_list).')(?:/[\w-]+)*/?$#i', $m[0]) ) diff --git a/public_html/js/action-script.js b/public_html/js/action-script.js index 671209a..0b24853 100755 --- a/public_html/js/action-script.js +++ b/public_html/js/action-script.js @@ -134,7 +134,7 @@ function navMenu(section, persistence){ //pageManager.activeXHR.addEventListener('loadend', - + var handlerX = function(){ @@ -175,7 +175,7 @@ function navMenu(section, persistence){ // init page-manager -pageManager.setPage(null, '/view', DOM.CONTAINER, ['history', 'profile', 'machines', 'users', 'groups', 'analytics', 'settings'] ); +pageManager.setPage(null, '/view', DOM.CONTAINER, ['history', 'profile', 'machines', 'users', 'groups', 'extensions', 'settings'] ); // launch pageManager navMenu(pageManager.page); @@ -192,7 +192,7 @@ navMenu(pageManager.page); pageManager.refresher = function(){ /* (1) Loads page */ navSubMenu( this.vars[0] ); - + /* (2) Set listener for sub-menu nav */ document.querySelector('#CONTAINER > .sub-menu-side').addEventListener('click', function(e){ var target = e.target; diff --git a/public_html/js/min/action-script.js b/public_html/js/min/action-script.js index 59a3aeb..89fa259 100755 --- a/public_html/js/min/action-script.js +++ b/public_html/js/min/action-script.js @@ -1,24 +1 @@ -// TODO: Attendre que API soit chargée, sinon erreur: le CONTAINER prend comme contenu la dépendance JS -// init page-manager -// launch pageManager -// set default refresher -function navSubMenu(e){var a=document.querySelector('#CONTAINER > .sub-menu-side > span[data-sublink="'+pageManager.vars[0]+'"]'),n=null -if(n=e instanceof Element?e:null,n="string"==typeof e?document.querySelector('#CONTAINER > .sub-menu-side > span[data-sublink="'+e+'"]'):n,n=null==n?document.querySelector("#CONTAINER > .sub-menu-side > span[data-sublink]"):n,null==n)return!1 -null!=a&&a.remClass("active") -for(var t=document.querySelectorAll("#CONTAINER > section[data-sublink].active"),r=0;r section[data-sublink="'+n.getData("sublink")+'"]') -null!=u&&u.addClass("active")}if(!n.getData("sublink"))return!1 -var l=pageManager.vars[0]!=n.getData("sublink") -pageManager.vars[0]=n.getData("sublink"),l&&pageManager.updateURL()}function navMenu(e,a){var n=document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.page+'"]'),t=null -if(t=e instanceof Element?e:null,t="string"==typeof e?document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+e+'"]'):t,t=t||document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.pagelist[0]+'"]'),null==t)return!1 -a=a===!0,n&&n.remClass("active"),t&&t.addClass("active") -if(a||n==t||(pageManager.vars=[]),t.getData("link")){DOM.HEADER.addClass("loading") -var r=function(){var e=pageManager.vars.length>0&&null!=document.querySelector('#CONTAINER > .sub-menu-side > [data-sublink="'+pageManager.vars[0]+'"]') -navSubMenu(e?pageManager.vars[0]:null),document.querySelector("#CONTAINER > .sub-menu-side").addEventListener("click",function(e){for(var a=e.target;a!=document.body&&!a.getData("sublink");)a=a.parentNode -a.getData("sublink")&&navSubMenu(a)},!1),DOM.HEADER.remClass("loading")} -pageManager.page!=t.getData("link")&&pageManager.setPage(t.getData("link")),pageManager.activeXHR?pageManager.activeXHR.addEventListener("loadend",r,!1):r.call()}}DOM={WRAPPER:$("WRAPPER"),HEADER:$("HEADER"),MENUSIDE:$("MENU-SIDE"),CONTAINER:$("CONTAINER")} -var pageManager=new pageManagerClass,api=new APIClass("/api/") -pageManager.setPage(null,"/view",DOM.CONTAINER,["history","profile","machines","users","groups","analytics","settings"]),navMenu(pageManager.page),pageManager.refresher=function(){navSubMenu(this.vars[0]),document.querySelector("#CONTAINER > .sub-menu-side").addEventListener("click",function(e){for(var a=e.target;a!=document.body&&!a.getData("sublink");)a=a.parentNode -a.getData("sublink")&&navSubMenu(a)},!1)},DOM.MENUSIDE.addEventListener("click",function(e){for(var a=e.target;a!=document.body&&!a.getData("link");)a=a.parentNode -a.getData("link")&&navMenu(a.getData("link"))},!1) +function navSubMenu(e){var a=document.querySelector('#CONTAINER > .sub-menu-side > span[data-sublink="'+pageManager.vars[0]+'"]'),n=null;if(n=e instanceof Element?e:null,n="string"==typeof e?document.querySelector('#CONTAINER > .sub-menu-side > span[data-sublink="'+e+'"]'):n,n=null==n?document.querySelector("#CONTAINER > .sub-menu-side > span[data-sublink]"):n,null==n)return!1;null!=a&&a.remClass("active");for(var t=document.querySelectorAll("#CONTAINER > section[data-sublink].active"),r=0;r section[data-sublink="'+n.getData("sublink")+'"]');null!=u&&u.addClass("active")}if(!n.getData("sublink"))return!1;var l=pageManager.vars[0]!=n.getData("sublink");pageManager.vars[0]=n.getData("sublink"),l&&pageManager.updateURL()}function navMenu(e,a){var n=document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.page+'"]'),t=null;if(t=e instanceof Element?e:null,t="string"==typeof e?document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+e+'"]'):t,t=t||document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.pagelist[0]+'"]'),null==t)return!1;a=a===!0?!0:!1,n&&n.remClass("active"),t&&t.addClass("active");if(a||n==t||(pageManager.vars=[]),t.getData("link")){DOM.HEADER.addClass("loading");var r=function(){var e=pageManager.vars.length>0&&null!=document.querySelector('#CONTAINER > .sub-menu-side > [data-sublink="'+pageManager.vars[0]+'"]');navSubMenu(e?pageManager.vars[0]:null),document.querySelector("#CONTAINER > .sub-menu-side").addEventListener("click",function(e){for(var a=e.target;a!=document.body&&!a.getData("sublink");)a=a.parentNode;a.getData("sublink")&&navSubMenu(a)},!1),DOM.HEADER.remClass("loading")};pageManager.page!=t.getData("link")&&pageManager.setPage(t.getData("link")),pageManager.activeXHR?pageManager.activeXHR.addEventListener("loadend",r,!1):r.call()}}DOM={WRAPPER:$("WRAPPER"),HEADER:$("HEADER"),MENUSIDE:$("MENU-SIDE"),CONTAINER:$("CONTAINER")};var pageManager=new pageManagerClass,api=new APIClass("/api/");pageManager.setPage(null,"/view",DOM.CONTAINER,["history","profile","machines","users","groups","extensions","settings"]),navMenu(pageManager.page),pageManager.refresher=function(){navSubMenu(this.vars[0]),document.querySelector("#CONTAINER > .sub-menu-side").addEventListener("click",function(e){for(var a=e.target;a!=document.body&&!a.getData("sublink");)a=a.parentNode;a.getData("sublink")&&navSubMenu(a)},!1)},DOM.MENUSIDE.addEventListener("click",function(e){for(var a=e.target;a!=document.body&&!a.getData("link");)a=a.parentNode;a.getData("link")&&navMenu(a.getData("link"))},!1); \ No newline at end of file diff --git a/public_html/src/static/menu-side/extensions.svg b/public_html/src/static/menu-side/extensions.svg new file mode 100644 index 0000000..db173f5 --- /dev/null +++ b/public_html/src/static/menu-side/extensions.svg @@ -0,0 +1,96 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/public_html/view/css/analytics.css b/public_html/view/css/extensions.css similarity index 100% rename from public_html/view/css/analytics.css rename to public_html/view/css/extensions.css diff --git a/public_html/view/analytics.php b/public_html/view/extensions.php similarity index 98% rename from public_html/view/analytics.php rename to public_html/view/extensions.php index f4e6a54..8688b35 100755 --- a/public_html/view/analytics.php +++ b/public_html/view/extensions.php @@ -10,7 +10,7 @@