You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

110 lines
3.4 KiB

/**
**-
* JavaScript providing functions for
* use on Linux Pages
*
* Includes local menus
*
* Author - Philip Osztromok
*
* 2 March 2024
*+
*/
function local_menu(course) {
const new_menu = menu(course);
const new_menu_links = menu_links(course);
const new_base = "/linux/"+course+"/";
const new_local_menu = document.createElement("div");
console.log("local_menu called with value: ", course);
for (let index=0; index < new_menu.length; index++) {
var link = document.createElement("a");
link.innerHTML = new_menu[index];
link.setAttribute("href", new_base+new_menu_links[index]+".html");
console.log("The link is", link);
new_local_menu.append(link);
}
return new_local_menu;
}
export { local_menu }
/*
*
* helper functions
*
*/
function menu(course) {
console.log("local_menu called with value: ", course);
if (course == "linuxkernel") return[
"Surveying the Linux Kernel", "Booting", "Working with Loadable Kernel Modules", "Examining Linux Kernel Source Code", "Configuring and Building a Linux Kernel", "Conclusion"
]
else if (course == "awk") return [
"AWK Command Line Basics", "Understanding Records and Fields", "Understanding Variables and Records", "Quick Introduction to Regular Expressions", "Using Control Structures", "Formatting the Output", "Functions and Arrays", "Combining AWK with Other Tools", "Conclusion"
]
else if (course == "learningansible") return [
"No defined menu."
]
else if (course == "learningbashscripting") return [
"Introduction", "Using Bash", "Programming with Bash", "Bash Control Structures", "Interacting with the User", "Bash in the Real World", "Conclusion"
]
else if (course == "learninglinuxcommandline") return [
"Setting Up the Environment", "Command-Line Basics", "Files, Folders and Permissions", "Common Command-Line Basics", "A Peek at Some Advanced Topics", "Appendix A", "Appendix B"
]
else if (course == "linuxperformancetuning") return [
"Performance Overview", "CPU Bottlenecks", "Memory Bottlenecks", "Disk Bottlenecks", "Conclusion"
]
else if (course == "linuxstoragesystems") return [
"Disk Partitions, Formatting and Mounting", "Logical Volume Manager (LVM)", "Security and Resource Constraints", "Special Storage Features and Considerations", "Networked File Systems", "Conclusion"
]
else if (course == "learningssh") return [
"Configuring an SSH Server", "SSH Basics", "Practical Tasks with SSH", "Conclusion"
]
}
function menu_links(course) {
if (course == "linuxkernel") return[
"surveying", "booting", "loadable", "source-code", "configuring", "conclusion"
]
else if (course == "awk") return [
"basics", "records", "variables", "regex", "control", "output", "functions", "tools", "conclusion"
]
else if (course == "learningansible") return [
"learningansible"
]
else if (course == "learningbashscripting") return [
"introduction", "using", "programming", "control", "user", "world", "conclusion"
]
else if (course == "learninglinuxcommandline") return [
"environment", "basics", "files", "basics", "advanced", "appendixa", "appendixb"
]
else if (course == "linuxperformancetuning") return [
"overview", "cpu", "memory", "disk", "conclusion"
]
else if (course == "linuxstoragesystems") return [
"partitions", "lvm", "security", "features", "nfs", "conclusion"
]
else if (course == "learningssh") return [
"configuring", "basics", "practical", "conclusion"
]
}