Fakultas Ilmu Komputer UI

Commit 5a70361d authored by Farid Wajdi's avatar Farid Wajdi
Browse files

Create function file

parent b71933ef
......@@ -2,10 +2,6 @@ var myCoursesDiv = document.getElementById("inst25");
var myCoursesContent = myCoursesDiv.getElementsByClassName("content")[0];
var courses = myCoursesDiv.getElementsByTagName("li")
function getCourseSemester(courseId) {
return 1
}
var coursePerSemester = {};
// Group every course to its semester
for (var i = 0; i < courses.length; i++) {
......
function getCourseSemester(courseId, courseGroup) {
for (var key in courseGroup) {
// skip loop if the property is from prototype
if (!courseGroup.hasOwnProperty(key)) continue;
var courses = validation_messages[key];
if (courseId in courses) {
return key
}
}
throw "Course not found"
}
......@@ -18,6 +18,7 @@
],
"js": [
"course-group.js",
"functions.js",
"contentScript.js"
]
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment