|
|
|
/**
|
|
|
|
**-
|
|
|
|
* JavaScript providing functions for
|
|
|
|
* creating the button groups seen at
|
|
|
|
* the bottom of most pages
|
|
|
|
*
|
|
|
|
* Author - Philip Osztromok
|
|
|
|
*
|
|
|
|
* 27 March 2022
|
|
|
|
*+
|
|
|
|
*/
|
|
|
|
|
|
|
|
import { addButtonGroup, addSmallButtonGroup } from '/scripts/visuals.js';
|
|
|
|
|
|
|
|
function menu(course) {
|
|
|
|
const menu = getChapters(course);
|
|
|
|
console.log(menu);
|
|
|
|
const buttons = addButtonGroup(menu);
|
|
|
|
|
|
|
|
return buttons;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getChapters(course) {
|
|
|
|
if (course == "linuxPerformanceTuning") return [
|
|
|
|
"Chapter 1", "./overview.html",
|
|
|
|
"Chapter 2", "./cpu_bottlenecks.html",
|
|
|
|
"Chapter 3", "./memory_bottlenecks.html",
|
|
|
|
"Chapter 4", "./disk_bottlenecks.html",
|
|
|
|
"Conclusion", "./conclusion.html",
|
|
|
|
"Linux", "/linux/linux.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "learnbashscripting") return [
|
|
|
|
"Chapter 1", "./introduction.html",
|
|
|
|
"Chapter 2", "./using.html",
|
|
|
|
"Chapter 3", "./programming.html",
|
|
|
|
"Conclusion", "./conclusion.html",
|
|
|
|
"Linux", "/linux/linux.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "awk") return [
|
|
|
|
"AWK Command Line Basics", "./basics.html",
|
|
|
|
"Understanding Records and Fields", "./records.html",
|
|
|
|
"Understanding Variables and Operators", "./variables.html",
|
|
|
|
"Quick Introduction to Regular Expressions", "./regex.html",
|
|
|
|
"Using Control Structures", "./control.html",
|
|
|
|
"Formatting the Output", "./output.html",
|
|
|
|
"Functions and Arrays", "./functions.html",
|
|
|
|
"Combining AWK with Other Tools", "./tools.html",
|
|
|
|
"Conclusion", "./conclusion.html",
|
|
|
|
"Linux", "/linux/linux.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "ssh") return [
|
|
|
|
"Linux", "/linux/linux.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "dockerfw") return [
|
|
|
|
"Introduction", "./introduction.html",
|
|
|
|
"Understanding Containers", "./understanding.html",
|
|
|
|
"Getting Started", "./getting_started.html",
|
|
|
|
"Deploying and Configuring Containers", "./deploying.html",
|
|
|
|
"Docker Enterprise", "./enterprise.html",
|
|
|
|
"Conclusion", "./conclusion.html",
|
|
|
|
"In Progress", "/temp/temp.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "storage") return [
|
|
|
|
"Disk Partitions", "./partitions.html",
|
|
|
|
"Logical Volume Manager", "./lvm.html",
|
|
|
|
"Security and Resource Constraints", "./security.html",
|
|
|
|
"Storage Features", "./features.html",
|
|
|
|
"Networked File Systems", "./nfs.html",
|
|
|
|
"Conclusion", "./conclusion.html",
|
|
|
|
"In Progress", "/temp/temp.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "japanese_language") return [
|
|
|
|
"Hiragana", "./hiragana.html",
|
|
|
|
"Homework", "./homework.html",
|
|
|
|
"Japan", "/japan/japan.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
else if (course == "nomenu") return [
|
|
|
|
"Android Development", "/android.html",
|
|
|
|
"Linux", "/linux/linux.html",
|
|
|
|
"Programming", "/programming/programming.html",
|
|
|
|
"Raspberry Pi", "/raspberrypi/raspberrypi/html",
|
|
|
|
"Web Development", "/webdevelopment/webdevelopment.html",
|
|
|
|
"Hungary", "/hungary/hungary.html",
|
|
|
|
"Japan", "Japan.html",
|
|
|
|
"In Progress", "/temp/temp.html",
|
|
|
|
"Home", "/index.html"
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* helper functions
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
export { menu }
|