mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Created settings sections system.
This commit is contained in:
parent
991a950a42
commit
6288af5899
@ -1075,6 +1075,27 @@ var ComunicWeb = {
|
||||
navigationPane: {
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
/**
|
||||
* Settings sections list
|
||||
*/
|
||||
sectionsList: {
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
/**
|
||||
* Settings sections script
|
||||
*/
|
||||
sections: {
|
||||
|
||||
/**
|
||||
* General section
|
||||
*/
|
||||
general: {
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -32,8 +32,38 @@ ComunicWeb.pages.settings.main = {
|
||||
class: "col-md-3"
|
||||
});
|
||||
|
||||
//Right area
|
||||
var rightArea = createElem2({
|
||||
appendTo: row,
|
||||
type: "div",
|
||||
class: "col-md-9"
|
||||
});
|
||||
|
||||
//Display left navigation pane
|
||||
ComunicWeb.pages.settings.navigationPane.display(leftArea);
|
||||
|
||||
//Determine which page to open
|
||||
var section = args.subfolder ? args.subfolder : "general";
|
||||
|
||||
//Check if the section exists or not
|
||||
if(ComunicWeb.pages.settings.sectionsList[section]){
|
||||
|
||||
//Extract section information
|
||||
var section = ComunicWeb.pages.settings.sectionsList[section];
|
||||
|
||||
//Update document title
|
||||
document.title += section.title;
|
||||
|
||||
//Call handler
|
||||
eval(section.handler + "(args, rightArea);");
|
||||
|
||||
}
|
||||
|
||||
//The section is not found
|
||||
else {
|
||||
//Display error page (404)
|
||||
ComunicWeb.common.error.pageNotFound(args, target);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
19
assets/js/pages/settings/sections/general.js
Normal file
19
assets/js/pages/settings/sections/general.js
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Settings general section
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.pages.settings.sections.general = {
|
||||
|
||||
/**
|
||||
* Open settings section
|
||||
*
|
||||
* @param {object} args Additionnal arguments
|
||||
* @param {HTMLElement} target The target for the page
|
||||
*/
|
||||
open: function(args, target){
|
||||
alert("hey");
|
||||
}
|
||||
|
||||
};
|
17
assets/js/pages/settings/sectionsList.js
Normal file
17
assets/js/pages/settings/sectionsList.js
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Settings pages list
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.pages.settings.sectionsList = {
|
||||
|
||||
/**
|
||||
* General settings
|
||||
*/
|
||||
general: {
|
||||
title: "General",
|
||||
handler: "ComunicWeb.pages.settings.sections.general.open",
|
||||
},
|
||||
|
||||
}
|
@ -321,6 +321,9 @@ class Dev {
|
||||
//User settings page
|
||||
"js/pages/settings/main.js",
|
||||
"js/pages/settings/navigationPane.js",
|
||||
"js/pages/settings/sectionsList.js",
|
||||
//Settings sections
|
||||
"js/pages/settings/sections/general.js",
|
||||
|
||||
//Login page
|
||||
"js/pages/login.js",
|
||||
|
Loading…
Reference in New Issue
Block a user