2018-02-20 14:53:31 +00:00
|
|
|
import {GlobalStore} from '../lib/gstore'
|
|
|
|
|
|
|
|
window.gstore = new GlobalStore();
|
|
|
|
|
|
|
|
|
|
|
|
/* (1) Main components
|
|
|
|
---------------------------------------------------------*/
|
|
|
|
/* (1) Header */
|
|
|
|
gstore.add('header_title', 'ndli1718');
|
|
|
|
|
|
|
|
/* (2) Menu */
|
|
|
|
gstore.add('menu_item', {
|
|
|
|
dashboard: {
|
|
|
|
label: 'Accueil',
|
|
|
|
theme: 'dashboard'
|
|
|
|
}, emergency: {
|
|
|
|
label: 'Urgences',
|
|
|
|
theme: 'emergency'
|
|
|
|
}, event: {
|
|
|
|
label: 'Signalements',
|
|
|
|
theme: 'event'
|
|
|
|
}, inbox: {
|
|
|
|
label: 'Messagerie',
|
|
|
|
theme: 'inbox'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
gstore.add('URI', document.URL.replace(/^(?:\/\/|[^\/]+)*/, ''));
|
2018-02-20 15:00:55 +00:00
|
|
|
gstore.add('is_local', document.URL.replace(/^https?:\/\/([^\/:]+).*$/, '$1') == 'ptut.com');
|
2018-02-20 14:53:31 +00:00
|
|
|
gstore.add('min_menu', false);
|
|
|
|
|
|
|
|
// // Proccess current page from url
|
|
|
|
// if( /^\/(\w+)(?:\/?.*)$/.test(gstore.data.URI) ){
|
|
|
|
// var mi_keys = Object.keys( gstore.data.menu_item );
|
|
|
|
|
|
|
|
// // if current page exists
|
|
|
|
// if( !!~mi_keys.indexOf(RegExp.$1) ) gstore.add('menu_item_active', RegExp.$1);
|
|
|
|
// else gstore.add('menu_item_active', 'dashboard');
|
|
|
|
|
|
|
|
// }else
|
|
|
|
// gstore.add('menu_item_active', 'dashboard');
|