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.
82 lines
2.5 KiB
82 lines
2.5 KiB
/** |
|
**- |
|
* JavaScript providing functions for |
|
* use on Linux Pages |
|
* |
|
* Includes local menus |
|
* |
|
* Author - Philip Osztromok |
|
* |
|
* 2 March 2024 |
|
*+ |
|
*/ |
|
|
|
function local_menu(course) { |
|
console.log("Course is ",course) |
|
const new_menu = menu(course); |
|
const new_menu_links = menu_links(course); |
|
const new_base = "/programming/"+course+"/"; |
|
const new_local_menu = document.createElement("div"); |
|
|
|
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("Called the menu() function") |
|
|
|
if (course == "dockerforwindows") return [ |
|
"Introduction", "Understanding Containers", "Docker for Windows: Getting Started", "Deploying and Configuring Containers", "Docker Enterprise in the Windows Datacenter", "Conclusion" |
|
] |
|
|
|
else if (course == "learningdocker") return [ |
|
"Installing Docker", "Using Docker", "When Things Go Wrong", "Additional Docker Resources", "Conclusion" |
|
] |
|
|
|
else if (course == "programming_fundamentals") return [ |
|
"Fundamentals", "Beyond the Fundamentals", "Programming Concepts for Python", "Object-Oriented Design", "Algorithms", "Data Structures", "Design Patterns", "Databases", "Memory, Pointers and Garbage Collection", "APIs and Web Services", "Secure Coding", "Test-Driven Development", "Software Testing/QA" |
|
] |
|
|
|
else if (course == "versioncontrolwithgit") return [ |
|
"Introduction to Version Control", "Git and the Command Line", "Git and Graphical User Interface", "Conclusion" |
|
] |
|
|
|
else console.log("Course not found!"); |
|
} |
|
|
|
function menu_links(course) { |
|
if (course == "dockerforwindows") return [ |
|
"introduction", "understanding", "getting_started", "deploying", "conclusion" |
|
] |
|
|
|
else if (course == "learningdocker") return [ |
|
"installing", "using", "wrong", "resources", "conclusion" |
|
] |
|
|
|
else if (course == "programming_fundamentals") return [ |
|
"fundamentals", "beyondthefundamentals", "template", "template", "template", "template", "template", "template", "template", "template", "template", "template", "template" |
|
] |
|
|
|
else if (course == "versioncontrolwithgit") return [ |
|
"introduction", "commandline", "guis", "conclusion" |
|
] |
|
|
|
else console.log("Course not found!"); |
|
} |